本文整理匯總了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";
}
示例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 { }
}
}
}
示例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;
}
}
}