//----------------------------Tools public static string CreateOrderNo(M_OrderList.OrderEnum orderType) { string result = ""; string name = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.GetRandomString(4, 2); switch (orderType) { case M_OrderList.OrderEnum.Normal: result = "DD" + name; break; case M_OrderList.OrderEnum.IDC: result = "IDC" + name; break; case M_OrderList.OrderEnum.IDCRen: result = "IDCR" + name; break; case M_OrderList.OrderEnum.Score: result = "DP" + name; break; case M_OrderList.OrderEnum.Cloud: result = "YG" + name; break; case M_OrderList.OrderEnum.Purse: //充值 result = "RC" + name; break; case M_OrderList.OrderEnum.Trval: result = "TR" + name; break; case M_OrderList.OrderEnum.Hotel: result = "HT" + name; break; case M_OrderList.OrderEnum.Fast: result = "FT" + name; break; case M_OrderList.OrderEnum.Other: result = "OT" + name; break; case M_OrderList.OrderEnum.Donate: result = "DO" + name; break; default: result = "OT" + name; break; } return(result); }
/// <summary> /// 创建一张新订单 /// </summary> public M_OrderList NewOrder(M_UserInfo mu, M_OrderList.OrderEnum orderType) { M_OrderList orderMod = new M_OrderList(); orderMod.Ordertype = (int)orderType; orderMod.OrderNo = CreateOrderNo(orderType); orderMod.Userid = mu.UserID; orderMod.AddUser = mu.UserName; orderMod.Receiver = mu.UserName; return(orderMod); }
/// <summary> /// 创建一张新订单 /// </summary> public M_OrderList NewOrder(M_UserInfo mu, M_OrderList.OrderEnum orderType) { M_OrderList orderMod = new M_OrderList(); orderMod.Ordertype = (int)orderType; orderMod.OrderNo = CreateOrderNo(orderType); orderMod.Userid = mu.UserID; orderMod.AddUser = mu.UserName; orderMod.Reuser = mu.UserName; orderMod.Receiver = mu.UserName; orderMod.Paymentstatus = (int)M_OrderList.PayEnum.NoPay; orderMod.OrderStatus = (int)M_OrderList.StatusEnum.Normal; orderMod.StateLogistics = (int)M_OrderList.ExpEnum.NoSend; orderMod.StoreID = 0; orderMod.Receivablesamount = 0; orderMod.Suspended = 0; orderMod.Developedvotes = 0; return(orderMod); }