protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (CurrentOrder != null) { litPaymentStatus.Text = LocalizationUtils.GetOrderPaymentStatus(CurrentOrder.PaymentStatus); litShippingStatus.Text = LocalizationUtils.GetOrderShippingStatus(CurrentOrder.ShippingStatus); if (lstStatus.Items.FindByValue(CurrentOrder.StatusCode) != null) { lstStatus.ClearSelection(); lstStatus.Items.FindByValue(CurrentOrder.StatusCode).Selected = true; } } }
protected string RenderStatusHtml(IDataItemContainer cont) { var o = cont.DataItem as OrderSnapshot; var sb = new StringBuilder(); var url = ResolveUrl("~/DesktopModules/Hotcakes/Core/Admin/Orders/ViewOrder.aspx?id=" + o.bvin); var payText = LocalizationUtils.GetOrderPaymentStatus(o.PaymentStatus, HccRequestContext.Current.MainContentCulture); var payImage = ""; var payLink = ResolveUrl("~/DesktopModules/Hotcakes/Core/Admin/Orders/OrderPayments.aspx?id=" + o.bvin); switch (o.PaymentStatus) { case OrderPaymentStatus.Overpaid: payImage = ResolveImgUrl("Lights/PaymentError.gif"); break; case OrderPaymentStatus.PartiallyPaid: payImage = ResolveImgUrl("Lights/PaymentAuthorized.gif"); break; case OrderPaymentStatus.Paid: payImage = ResolveImgUrl("Lights/PaymentComplete.gif"); break; case OrderPaymentStatus.Unknown: payImage = ResolveImgUrl("Lights/PaymentNone.gif"); break; case OrderPaymentStatus.Unpaid: payImage = ResolveImgUrl("Lights/PaymentNone.gif"); break; } sb.Append("<a href=\"" + payLink + "\" title=\"" + payText + "\"><img src=\"" + payImage + "\" alt=\"" + payText + "\" /></a>"); var shipText = LocalizationUtils.GetOrderShippingStatus(o.ShippingStatus, HccRequestContext.Current.MainContentCulture); var shipImage = ""; var shipLink = ResolveUrl("~/DesktopModules/Hotcakes/Core/Admin/Orders/ShipOrder.aspx?id=" + o.bvin); switch (o.ShippingStatus) { case OrderShippingStatus.FullyShipped: shipImage = ResolveImgUrl("Lights/ShippingShipped.gif"); break; case OrderShippingStatus.NonShipping: shipImage = ResolveImgUrl("Lights/ShippingNone.gif"); break; case OrderShippingStatus.PartiallyShipped: shipImage = ResolveImgUrl("Lights/ShippingPartially.gif"); break; case OrderShippingStatus.Unknown: shipImage = ResolveImgUrl("Lights/ShippingNone.gif"); break; case OrderShippingStatus.Unshipped: shipImage = ResolveImgUrl("Lights/ShippingNone.gif"); break; } sb.Append("<a href=\"" + shipLink + "\" title=\"" + shipText + "\"><img src=\"" + shipImage + "\" alt=\"" + shipText + "\" /></a>"); var statusText = LocalizationUtils.GetOrderStatus(o.StatusName, HccRequestContext.Current.MainContentCulture); var statImage = ""; switch (o.StatusCode) { case OrderStatusCode.Completed: statImage = ResolveImgUrl("lights/OrderComplete.gif"); break; case OrderStatusCode.Received: statImage = ResolveImgUrl("lights/OrderInProcess.gif"); break; case OrderStatusCode.OnHold: statImage = ResolveImgUrl("lights/OrderOnHold.gif"); break; case OrderStatusCode.ReadyForPayment: statImage = ResolveImgUrl("lights/OrderInProcess.gif"); break; case OrderStatusCode.ReadyForShipping: statImage = ResolveImgUrl("lights/OrderInProcess.gif"); break; default: statImage = ResolveImgUrl("lights/OrderInProcess.gif"); break; } sb.Append("<a href=\"" + url + "\"><img src=\"" + statImage + "\" alt=\"" + statusText + "\" style='margin-right:4px' /></a>"); sb.Append("<div><a href=\"" + url + "\">" + statusText + "</a></div>"); return(sb.ToString()); }