public static string OrderShippingStatus(OrderShippingStatus e) { var result = string.Empty; switch (e) { case Orders.OrderShippingStatus.FullyShipped: result = "Shipped"; break; case Orders.OrderShippingStatus.NonShipping: result = "Non Shipping"; break; case Orders.OrderShippingStatus.PartiallyShipped: result = "Partially Shipped"; break; case Orders.OrderShippingStatus.Unknown: result = "Unknown"; break; case Orders.OrderShippingStatus.Unshipped: result = "Unshipped"; break; } return(result); }
public static string GetOrderShippingStatus(OrderShippingStatus shippingStatus, string culture = null) { var value = OrderShippingStatusesLocalization.GetFormattedString(shippingStatus.ToString(), culture); if (string.IsNullOrEmpty(value)) { value = OrderShippingStatusesLocalization.GetString(OrderShippingStatus.Unknown.ToString(), culture); } return(value); }
private void ReloadOrder(OrderShippingStatus previousShippingStatus) { o = MTApp.OrderServices.Orders.FindForCurrentStore(Request.QueryString["id"]); o.EvaluateCurrentShippingStatus(); MTApp.OrderServices.Orders.Update(o); MerchantTribe.Commerce.BusinessRules.OrderTaskContext context = new MerchantTribe.Commerce.BusinessRules.OrderTaskContext(MTApp); context.Order = o; context.UserId = o.UserID; context.Inputs.Add("bvsoftware", "PreviousShippingStatus", previousShippingStatus.ToString()); MerchantTribe.Commerce.BusinessRules.Workflow.RunByName(context, MerchantTribe.Commerce.BusinessRules.WorkflowNames.ShippingChanged); LoadOrder(); this.OrderStatusDisplay1.LoadStatusForOrder(o); }
private void ReloadOrder(OrderShippingStatus previousShippingStatus, bool SendEmail = true) { CurrentOrder.EvaluateCurrentShippingStatus(); HccApp.OrderServices.Orders.Update(CurrentOrder); var context = new OrderTaskContext { Order = CurrentOrder, UserId = CurrentOrder.UserID }; context.Inputs.Add("hcc", "PreviousShippingStatus", previousShippingStatus.ToString()); Workflow.RunByName(context, WorkflowNames.ShippingChanged); LoadOrder(); }
protected void PackagesGridView_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { Order order = MTApp.OrderServices.Orders.FindForCurrentStore(Request.QueryString["id"]); OrderShippingStatus previousShippingStatus = order.ShippingStatus; long Id = (long)PackagesGridView.DataKeys[e.RowIndex].Value; var p = order.Packages.Where(y => y.Id == Id).SingleOrDefault(); if (p != null) { order.Packages.Remove(p); MTApp.OrderServices.Orders.Update(order); } ReloadOrder(previousShippingStatus); }
private void ShipOrPackageItems(bool dontShip) { Order order = MTApp.OrderServices.Orders.FindForCurrentStore(Request.QueryString["id"]); OrderShippingStatus previousShippingStatus = order.ShippingStatus; string serviceCode = string.Empty; if (this.lstTrackingProvider.SelectedValue != null) { serviceCode = this.lstTrackingProvider.SelectedValue; } OrderPackage p = ShipItems(order, this.TrackingNumberField.Text.Trim(), order.ShippingProviderId, serviceCode, dontShip); ReloadOrder(previousShippingStatus); }
protected Order CreateOrder(double amount = 2.34334, string label = "", OrderShippingStatus shippingStatus = OrderShippingStatus.Unshipped) => new Order { Amount = amount, Label = label };