Page 1 of 1
How to High light item with Problem on status?
Posted: Wed Jan 26, 2011 1:15 pm
by speedythinker
Hello:
I need some help. For paid item but with an issue, I changed the status to "Problem". But without paying attention to it (other staff), it's easy for them to ship it out. I'm wondering if there is a way to high light the row with different color when status is "Problem"
Also, is it way to tell that customer leave a note in the "History & note". I found that we sometimes missed some important instruction from the customer without checking the email. May be add a "!" or some sort of indication to let us know that customer had left message.
Thanks a lot
Speedy
Re: How to High light item with Problem on status?
Posted: Fri Feb 04, 2011 9:52 am
by mazhar
need some help. For paid item but with an issue, I changed the status to "Problem". But without paying attention to it (other staff), it's easy for them to ship it out. I'm wondering if there is a way to high light the row with different color when status is "Problem"
Yep that would be easy. Edit Admin/Orders/Default.aspx.cs file and locate following code
and update it like
Code: Select all
e.Row.DataItem = order;
if (order.OrderStatus.Name.Contains("Problem"))
e.Row.Style.Add("background-color", "red");
About your second part edit Admin/Orders/Default.aspx and locate
Code: Select all
<asp:TemplateField HeaderText="Shipment">
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:PlaceHolder ID="phShipmentStatus" runat="server"></asp:PlaceHolder>
<asp:Label ID="ShipmentStatus" runat="server" Text='<%# Eval("ShipmentStatus") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
and then make it look like
Code: Select all
<asp:TemplateField HeaderText="Shipment">
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:PlaceHolder ID="phShipmentStatus" runat="server"></asp:PlaceHolder>
<asp:Label ID="ShipmentStatus" runat="server" Text='<%# Eval("ShipmentStatus") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Notes">
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Center" />
<ItemTemplate>
<%# GetNotesAlert(Container.DataItem)%>
</ItemTemplate>
</asp:TemplateField>
Finally edit Admin/Orders/Default.aspx.cs file and add following method to it
Code: Select all
protected string GetNotesAlert(Object dataItem)
{
string alert = "<span>No</span>";
Order order = dataItem as Order;
if (order != null)
{
foreach (OrderNote note in order.Notes)
{
if (note.NoteType == NoteType.Public)
{
alert = "<span style='color:yellow;'>!</span>";
break;
}
}
}
return alert;
}
This will print ! in new column when order has at least one public comment otherwise it will say NO.
Re: How to High light item with Problem on status?
Posted: Fri Feb 04, 2011 10:48 am
by speedythinker
Morning Mazhar:
Thank you for your reply. I tried both and so far only the 1st one (high light Problem item) works very good. But the added "!" seems not working as I click on some orders with customer note left, it won't show any any "!" .
Thanks
Speedy
Re: How to High light item with Problem on status?
Posted: Fri Feb 04, 2011 10:51 am
by speedythinker
By the way, I saw the new coloumn added with "No" when there is no public note left by the customer. I can live with that.
Thanks again. Great help!!
Speedy
Re: How to High light item with Problem on status?
Posted: Fri Feb 04, 2011 10:53 am
by speedythinker
Oh... I saw it now. It's just that my eyes didn't see the yellow "!" well. It works!!
Thank you Master
Speedy
Re: How to High light item with Problem on status?
Posted: Mon Feb 07, 2011 4:18 am
by mazhar
Actually it would be better to simply replace ! with Yes. That would be easily visible. You can update that information in this line
Code: Select all
alert = "<span style='color:yellow;'>!</span>";
for example like
Code: Select all
alert = "<span style='color:yellow;'>Yes</span>";
Re: How to High light item with Problem on status?
Posted: Thu Feb 10, 2011 9:41 am
by kens
Good Morning-
I am using the code posted here to make rows with problem orders red. I wanted to do the same for orders where the payment status is either unprocessed or authorization pending. I tried a variant of your code, but it didn't seem to work, so obviously I'm missing something. Any help would be appreciated. Here is what I tried:
Code: Select all
if (payment.PaymentStatus == PaymentStatus.Unprocessed)
e.Row.Style.Add("background-color", "red");
Thanks
Ken
Re: How to High light item with Problem on status?
Posted: Thu Feb 10, 2011 10:37 am
by mazhar
do it like this, hopefully it will workout
Code: Select all
if (order.PaymentStatus == PaymentStatus.Unprocessed)
e.Row.Style.Add("background-color", "red");
Re: How to High light item with Problem on status?
Posted: Fri Feb 11, 2011 11:49 am
by speedythinker
Hello Mazhar:
I want to show you our gradatude for your help. Now, it really a big release of pressure we used to have of worring missing an instruction left by a customer or shipping out problematic order without knowlege. Without your great work, we're living in a dark room and wasting much time to deal with tedious job by reading email and checking "History and Note" order by order.
Again, my appreciation for your great effort. You're the man!!
Cheers!
Speedy
Re: How to High light item with Problem on status?
Posted: Wed May 11, 2011 2:53 pm
by Mizmo67
This code addition below e.Row.DataItem = order;
Code: Select all
if (order.PaymentStatus = PaymentStatus.Unprocessed)
e.Row.Style.Add("background-color", "red");
Gives ERROR: e:\hshome\scottsbt\store.scottsbt.com\Admin\Orders\Default.aspx.cs(371): error CS0266: Cannot implicitly convert type 'CommerceBuilder.Payments.PaymentStatus' to 'CommerceBuilder.Orders.OrderPaymentStatus'. An explicit conversion exists (are you missing a cast?)
I've been trying all kinds of variations but cannot get it to work?
Thanks, ~Mo
Re: How to High light item with Problem on status?
Posted: Thu May 12, 2011 2:15 am
by mazhar
You are using single = operator in this line
Code: Select all
if (order.PaymentStatus = PaymentStatus.Unprocessed)
correct it like
Code: Select all
if (order.PaymentStatus == PaymentStatus.Unprocessed)
Single = sign means assignment while two = signs means check for equality.
Re: How to High light item with Problem on status?
Posted: Thu May 12, 2011 12:10 pm
by Mizmo67
Unfortunately,
Code: Select all
if (order.PaymentStatus == PaymentStatus.Unprocessed)
e.Row.Style.Add("background-color", "red");
Gets me another error: e:\hshome\scottsbt\store.scottsbt.com\Admin\Orders\Default.aspx.cs(371): error CS0019: Operator '==' cannot be applied to operands of type 'CommerceBuilder.Orders.OrderPaymentStatus' and 'CommerceBuilder.Payments.PaymentStatus'
