当前位置: 首页>>代码示例>>C#>>正文


C# OrderStatus.ToString方法代码示例

本文整理汇总了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);
        }
开发者ID:valdisiljuconoks,项目名称:Ascend15,代码行数:8,代码来源:PurchaseOrderBaseActivity.cs

示例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);
		}
开发者ID:Chuhukon,项目名称:uWebshop-Releases,代码行数:10,代码来源:PetaPocoSpike.cs

示例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());

        }
开发者ID:richinoz,项目名称:Orchard1.6,代码行数:19,代码来源:OrderService.cs

示例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);
            }
        }
开发者ID:LaOrigin,项目名称:Leorigin,代码行数:94,代码来源:OrderProcessingService.cs

示例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()));
 }
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:4,代码来源:ScheduledWorkflowTests.cs

示例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);
        }
开发者ID:smchristenson,项目名称:CommerceStarterKit,代码行数:8,代码来源:PurchaseOrderBaseActivity.cs

示例7: ModelBinderAttribute_UseModelBinderOnEnum

 public string ModelBinderAttribute_UseModelBinderOnEnum(OrderStatus status)
 {
     return status.ToString();
 }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:4,代码来源:ModelBinderAttribute_ProductController.cs

示例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);
//.........这里部分代码省略.........
开发者ID:cole2295,项目名称:nopCommerce-Linux-Mysql,代码行数:101,代码来源:OrderProcessingService.cs

示例9: SetOrderInfo

		public static void SetOrderInfo(Guid orderId, string serializedOrderInfoObject, OrderStatus orderStatus)
		{
			SetOrderInfo(orderId, serializedOrderInfoObject, orderStatus.ToString());
		}
开发者ID:Chuhukon,项目名称:uWebshop-Releases,代码行数:4,代码来源:uWebshopOrders.cs

示例10: UpdateOrder

 public void UpdateOrder(OrderRecord order, OrderStatus status)
 {
     order.OrderStatusRecord = _orderStatusRepository.Get(int.Parse(status.ToString("d")));
     _orderRepository.Update(order);
 }
开发者ID:omidam81,项目名称:Ver1.0,代码行数:5,代码来源:OrderService.cs

示例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);
            }*/
        }
开发者ID:SeptemberWind,项目名称:AlvisFrameworkProject,代码行数:59,代码来源:OrderProcessingService.cs


注:本文中的OrderStatus.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。