當前位置: 首頁>>代碼示例>>C#>>正文


C# Cart.SetStatus方法代碼示例

本文整理匯總了C#中Cart.SetStatus方法的典型用法代碼示例。如果您正苦於以下問題:C# Cart.SetStatus方法的具體用法?C# Cart.SetStatus怎麽用?C# Cart.SetStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cart的用法示例。


在下文中一共展示了Cart.SetStatus方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ChangeStatus

 public string ChangeStatus(int id = 0, int statusID = 0) {
     Profile p = ViewBag.profile;
     Cart order = new Cart();
     order = order.GetByPayment(id);
     order.SetStatus(statusID, p.first + " " + p.last);
     return "success";
 }
開發者ID:curt-labs,項目名稱:CURTeCommerce,代碼行數:7,代碼來源:OrdersController.cs

示例2: ReadAcknowledgement

        internal void ReadAcknowledgement(string editext) {
            List<string> purchaseOrderIDs = new List<string>();
            Cart order = new Cart();
            Settings settings = new Settings();
            string EDIPOPreface = settings.Get("EDIPOPreface");

            List<string> edilines = editext.Split('~').ToList<string>();
            foreach (string line in edilines) {
                List<string> lineelements = line.Split('*').ToList<string>();
                switch (lineelements[0]) {
                    case "AK1":
                        // Original Shipment Number from Shipper
                        string purchaseOrderID = lineelements[2];
                        if (EDIPOPreface != "") {
                            purchaseOrderID = purchaseOrderID.Replace(EDIPOPreface, "");
                        }
                        if(!String.IsNullOrWhiteSpace(purchaseOrderID)) {
                            purchaseOrderIDs.Add(purchaseOrderID);
                        }
                        break;
                }
            }
            foreach(string purchaseOrderID in purchaseOrderIDs) {
                if (!String.IsNullOrWhiteSpace(purchaseOrderID)) {
                    try {
                        order = new Cart().GetByPaymentID(Convert.ToInt32(purchaseOrderID));
                        order.SetStatus((int)OrderStatuses.Processed);
                        OrderEDI edi = new OrderEDI().GetByOrderID(order.ID);
                        if (edi != null && edi.ID > 0) {
                            edi.SetAcknowledged();
                        }
                    } catch { }
                }
            }
        }
開發者ID:curt-labs,項目名稱:CURTeCommerce,代碼行數:35,代碼來源:EDI.cs

示例3: ReadShippingNotification

        internal void ReadShippingNotification(string editext) {
            string trackingcode = "";
            string purchaseOrderID = "";
            string shipmentNumber = "";
            string weight = "";
            Cart order = new Cart();
            List<Shipment> shipments = new List<Shipment>();
            DateTime shipdate = DateTime.Now;
            Settings settings = new Settings();
            string EDIPOPreface = settings.Get("EDIPOPreface");

            List<string> edilines = editext.Split('~').ToList<string>();
            foreach (string line in edilines) {
                List<string> lineelements = line.Split('*').ToList<string>();
                switch (lineelements[0]) {
                    case "ST":
                        // Beginning of invoice
                        order = new Cart();
                        shipments = new List<Shipment>();
                        weight = "";
                        break;
                    case "BSN":
                        // Original Shipment Number from Shipper
                        shipmentNumber = lineelements[2];
                        break;
                    case "PRF":
                        // Purchase Order Reference
                        purchaseOrderID = lineelements[1];
                        if (EDIPOPreface != "") {
                            purchaseOrderID = purchaseOrderID.Replace(EDIPOPreface, "");
                        }
                        break;
                    case "REF":
                        // Tracking Code reference
                        trackingcode = lineelements[2];
                        Shipment shipment = new Shipment {
                            tracking_number = trackingcode
                        };
                        shipments.Add(shipment);
                        break;
                    case "DTM":
                        shipdate = Convert.ToDateTime(lineelements[2].Substring(4, 2) + "/" + lineelements[2].Substring(6, 2) + "/20" + lineelements[2].Substring(2, 2));
                        break;
                    case "TD1":
                        weight = lineelements[7] + " " + lineelements[8];
                        break;
                    case "SE":
                        // End of Invoice
                        try {
                            order = new Cart().GetByPaymentID(Convert.ToInt32(purchaseOrderID));
                            order.SetStatus((int)OrderStatuses.Shipped);
                            foreach (Shipment s in shipments) {
                                s.order_id = order.ID;
                                s.dateShipped = shipdate;
                                s.shipment_number = shipmentNumber;
                                s.weight = weight;
                            }
                            EcommercePlatformDataContext db = new EcommercePlatformDataContext();
                            db.Shipments.InsertAllOnSubmit(shipments);
                            db.SubmitChanges();
                            order.SendShippingNotification();
                        } catch { }
                        break;
                }
            }
        }
開發者ID:curt-labs,項目名稱:CURTeCommerce,代碼行數:66,代碼來源:EDI.cs


注:本文中的Cart.SetStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。