本文整理匯總了C#中Cart.SendShippingNotification方法的典型用法代碼示例。如果您正苦於以下問題:C# Cart.SendShippingNotification方法的具體用法?C# Cart.SendShippingNotification怎麽用?C# Cart.SendShippingNotification使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Cart
的用法示例。
在下文中一共展示了Cart.SendShippingNotification方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: 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;
}
}
}
示例2: SendShippingNotification
public string SendShippingNotification(int id = 0) {
Cart order = new Cart();
order = order.GetByPayment(id);
order.SendShippingNotification();
return "";
}