本文整理汇总了C#中OrderStatus.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# OrderStatus.ToString方法的具体用法?C# OrderStatus.ToString怎么用?C# OrderStatus.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderStatus
的用法示例。
在下文中一共展示了OrderStatus.ToString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeOrderStatus
protected void ChangeOrderStatus(OrderStatus newStatus)
{
RaiseEvent(ChangingOrderStatusEvent, EventArgs.Empty);
this.OrderGroup.Status = newStatus.ToString();
RaiseEvent(ChangedOrderStatusEvent, EventArgs.Empty);
}
示例2: ChangeOrderStatus
public static void ChangeOrderStatus(Guid orderId, OrderStatus orderStatus)
{
var db = ApplicationContext.Current.DatabaseContext.Database;
var fetch = db.Fetch<OrderData>(new Sql().Select("*").From("uWebshopOrders").Where((OrderData o) => o.UniqueId == orderId)).FirstOrDefault() ?? new OrderData {CreateDate = DateTime.Now};
fetch.OrderStatus = orderStatus.ToString();
fetch.UpdateDate = DateTime.Now;
db.Save(fetch);
}
示例3: Save
public void Save(IOrder order, OrderStatus orderStatus) {
var contentItem = _orderPartService.Get(order.UniqueId);
var orderPart = contentItem.As<OrderPart>();
orderPart.Status = orderStatus.ToString();
orderPart.Details = _serialisation.SerializeToXml(order);
orderPart.TransactionId = order.TransactionId;
orderPart.Amount = order.AmountPaid;
var utcNow = _clock.UtcNow;
if (contentItem.Has<CommonPart>()) {
contentItem.As<CommonPart>().ModifiedUtc = utcNow;
contentItem.As<CommonPart>().VersionModifiedUtc = utcNow;
}
if (contentItem.Has<TitlePart>())
contentItem.As<TitlePart>().Title = string.Format("{0}_{1}_{2}", order.Address.FirstName, order.Address.LastName, utcNow.ToShortDateString());
}
示例4: SetOrderStatus
/// <summary>
/// Sets an order status
/// </summary>
/// <param name="order">Order</param>
/// <param name="os">New order status</param>
/// <param name="notifyCustomer">True to notify customer</param>
protected virtual void SetOrderStatus(Order order, OrderStatus os, bool notifyCustomer)
{
if (order == null)
throw new ArgumentNullException("order");
OrderStatus prevOrderStatus = order.OrderStatus;
if (prevOrderStatus == os)
return;
//set and save new order status
order.OrderStatusId = (int)os;
_orderService.UpdateOrder(order);
//order notes, notifications
order.OrderNotes.Add(new OrderNote
{
Note = string.Format("Order status has been changed to {0}", os.ToString()),
DisplayToCustomer = false,
CreatedOnUtc = DateTime.UtcNow
});
_orderService.UpdateOrder(order);
if (prevOrderStatus != OrderStatus.Complete &&
os == OrderStatus.Complete
&& notifyCustomer)
{
//notification
var orderCompletedAttachmentFilePath = _orderSettings.AttachPdfInvoiceToOrderCompletedEmail ?
_pdfService.PrintOrderToPdf(order, 0) : null;
var orderCompletedAttachmentFileName = _orderSettings.AttachPdfInvoiceToOrderCompletedEmail ?
"order.pdf" : null;
int orderCompletedCustomerNotificationQueuedEmailId = _workflowMessageService
.SendOrderCompletedCustomerNotification(order, order.CustomerLanguageId, orderCompletedAttachmentFilePath,
orderCompletedAttachmentFileName);
if (orderCompletedCustomerNotificationQueuedEmailId > 0)
{
order.OrderNotes.Add(new OrderNote
{
Note = string.Format("\"Order completed\" email (to customer) has been queued. Queued email identifier: {0}.", orderCompletedCustomerNotificationQueuedEmailId),
DisplayToCustomer = false,
CreatedOnUtc = DateTime.UtcNow
});
_orderService.UpdateOrder(order);
}
}
if (prevOrderStatus != OrderStatus.Cancelled &&
os == OrderStatus.Cancelled
&& notifyCustomer)
{
//notification
int orderCancelledCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderCancelledCustomerNotification(order, order.CustomerLanguageId);
if (orderCancelledCustomerNotificationQueuedEmailId > 0)
{
order.OrderNotes.Add(new OrderNote
{
Note = string.Format("\"Order cancelled\" email (to customer) has been queued. Queued email identifier: {0}.", orderCancelledCustomerNotificationQueuedEmailId),
DisplayToCustomer = false,
CreatedOnUtc = DateTime.UtcNow
});
_orderService.UpdateOrder(order);
}
}
//reward points
if (_rewardPointsSettings.PointsForPurchases_Awarded == order.OrderStatus)
{
AwardRewardPoints(order);
}
if (_rewardPointsSettings.PointsForPurchases_Canceled == order.OrderStatus)
{
ReduceRewardPoints(order);
}
//gift cards activation
if (_orderSettings.GiftCards_Activated_OrderStatusId > 0 &&
_orderSettings.GiftCards_Activated_OrderStatusId == (int)order.OrderStatus)
{
SetActivatedValueForPurchasedGiftCards(order, true);
}
//gift cards deactivation
if (_orderSettings.GiftCards_Deactivated_OrderStatusId > 0 &&
_orderSettings.GiftCards_Deactivated_OrderStatusId == (int)order.OrderStatus)
{
SetActivatedValueForPurchasedGiftCards(order, false);
}
}
示例5: CheckStatus
private void CheckStatus(OrderStatus status, Order o)
{
Assert.AreEqual(status, o.Status, string.Format("Exptected {0} status {1}", o.GetClass().Name, status.ToString()));
}
示例6: ChangeOrderStatus
protected void ChangeOrderStatus(OrderStatus newStatus)
{
base.RaiseEvent(PurchaseOrderBaseActivity.ChangingOrderStatusEvent, this, EventArgs.Empty);
this.OrderGroup.Status = newStatus.ToString();
base.RaiseEvent(PurchaseOrderBaseActivity.ChangedOrderStatusEvent, this, EventArgs.Empty);
}
示例7: ModelBinderAttribute_UseModelBinderOnEnum
public string ModelBinderAttribute_UseModelBinderOnEnum(OrderStatus status)
{
return status.ToString();
}
示例8: SetOrderStatus
/// <summary>
/// Sets an order status
/// </summary>
/// <param name="order">Order</param>
/// <param name="os">New order status</param>
/// <param name="notifyCustomer">True to notify customer</param>
protected void SetOrderStatus(Order order,
OrderStatus os, bool notifyCustomer)
{
if (order == null)
throw new ArgumentNullException("order");
OrderStatus prevOrderStatus = order.OrderStatus;
if (prevOrderStatus == os)
return;
//set and save new order status
order.OrderStatusId = (int)os;
_orderService.UpdateOrder(order);
//order notes, notifications
order.OrderNotes.Add(new OrderNote()
{
Note = string.Format("Order status has been changed to {0}", os.ToString()),
DisplayToCustomer = false,
CreatedOnUtc = DateTime.UtcNow
});
_orderService.UpdateOrder(order);
if (prevOrderStatus != OrderStatus.Complete &&
os == OrderStatus.Complete
&& notifyCustomer)
{
//notification
int orderCompletedCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderCompletedCustomerNotification(order, order.CustomerLanguageId);
if (orderCompletedCustomerNotificationQueuedEmailId > 0)
{
order.OrderNotes.Add(new OrderNote()
{
Note = string.Format("\"Order completed\" email (to customer) has been queued. Queued email identifier: {0}.", orderCompletedCustomerNotificationQueuedEmailId),
DisplayToCustomer = false,
CreatedOnUtc = DateTime.UtcNow
});
_orderService.UpdateOrder(order);
}
}
if (prevOrderStatus != OrderStatus.Cancelled &&
os == OrderStatus.Cancelled
&& notifyCustomer)
{
//notification
int orderCancelledCustomerNotificationQueuedEmailId = _workflowMessageService.SendOrderCancelledCustomerNotification(order, order.CustomerLanguageId);
if (orderCancelledCustomerNotificationQueuedEmailId > 0)
{
order.OrderNotes.Add(new OrderNote()
{
Note = string.Format("\"Order cancelled\" email (to customer) has been queued. Queued email identifier: {0}.", orderCancelledCustomerNotificationQueuedEmailId),
DisplayToCustomer = false,
CreatedOnUtc = DateTime.UtcNow
});
_orderService.UpdateOrder(order);
}
}
//reward points
if (_rewardPointsSettings.Enabled)
{
if (_rewardPointsSettings.PointsForPurchases_Amount > decimal.Zero)
{
//Ensure that reward points are applied only to registered users
if (order.Customer != null && !order.Customer.IsGuest())
{
int points = (int)Math.Truncate(order.OrderTotal / _rewardPointsSettings.PointsForPurchases_Amount * _rewardPointsSettings.PointsForPurchases_Points);
if (points != 0)
{
if (_rewardPointsSettings.PointsForPurchases_Awarded == order.OrderStatus)
{
//Ensure that reward points were not added before. We should not add reward points if they were already earned for this order
if (!order.RewardPointsWereAdded)
{
//add reward points
order.Customer.AddRewardPointsHistoryEntry(points,
string.Format(_localizationService.GetResource("RewardPoints.Message.EarnedForOrder"),
order.Id));
order.RewardPointsWereAdded = true;
_orderService.UpdateOrder(order);
}
}
if (_rewardPointsSettings.PointsForPurchases_Canceled == order.OrderStatus)
{
//ensure that reward points were added before. We should not reduce reward points if they were already earned for this order
if (order.RewardPointsWereAdded)
{
//reduce reward points
order.Customer.AddRewardPointsHistoryEntry(-points,
string.Format(_localizationService.GetResource("RewardPoints.Message.ReducedForOrder"),
order.Id));
_orderService.UpdateOrder(order);
//.........这里部分代码省略.........
示例9: SetOrderInfo
public static void SetOrderInfo(Guid orderId, string serializedOrderInfoObject, OrderStatus orderStatus)
{
SetOrderInfo(orderId, serializedOrderInfoObject, orderStatus.ToString());
}
示例10: UpdateOrder
public void UpdateOrder(OrderRecord order, OrderStatus status)
{
order.OrderStatusRecord = _orderStatusRepository.Get(int.Parse(status.ToString("d")));
_orderRepository.Update(order);
}
示例11: SetOrderStatus
/// <summary>
/// Sets an order status
/// </summary>
/// <param name="order">Order</param>
/// <param name="os">New order status</param>
/// <param name="notifyCustomer">if set to <c>true</c> [notify customer].</param>
/// <exception cref="System.ArgumentNullException">order</exception>
protected virtual void SetOrderStatus(Order order, OrderStatus os, bool notifyCustomer)
{
if (order == null)
throw new ArgumentNullException("order");
OrderStatus prevOrderStatus = order.OrderStatus;
if (prevOrderStatus == os)
return;
//set and save new order status
order.OrderStatusId = (int)os;
_orderService.UpdateOrder(order);
//order notes, notifications
order.OrderNotes.Add(new OrderNote
{
Note = string.Format("Order status has been changed to {0}", os.ToString()),
CreatedOn = DateTime.Now
});
_orderService.UpdateOrder(order);
/* if (prevOrderStatus != OrderStatus.Complete &&
os == OrderStatus.Complete && notifyCustomer)
{
//notification or email to customer
order.OrderNotes.Add(new OrderNote
{
Note =
string.Format(
"\"Order completed\" email (to customer) has been queued. Queued email identifier: {0}.",
_workContext.CurrentCustomer.Email),
CreatedOn = DateTime.Now
});
_orderService.UpdateOrder(order);
}
if (prevOrderStatus != OrderStatus.Cancelled &&
os == OrderStatus.Cancelled
&& notifyCustomer)
{
//notification
order.OrderNotes.Add(new OrderNote
{
Note =
string.Format(
"\"Order cancelled\" email (to customer) has been queued. Queued email identifier: {0}.",
_workContext.CurrentCustomer.Email),
CreatedOn = DateTime.Now
});
_orderService.UpdateOrder(order);
}*/
}