public bool UpdateStatusByOrderId(OrderStatusType StatusType1, Order_Status StatusValue1, DateTime deliveryFinishTime, string orderIds) { string StatusType = StatusType1.ToString(); string StatusValue = StatusValue1.ToString(); bool result = false; string sql = ""; switch (StatusType) { case "配送": sql = string.Format("update OrderStatus set DeliveryStatus='{0}',DeliveryFinishTime = '{1}' where OrderId in ({2})", StatusValue, deliveryFinishTime, orderIds); result = m_dbo.ExecuteNonQuery(sql); break; case "回单": sql = string.Format("update OrderStatus set FeedBackStatus='{0}',FeedBackFinishTime = '{1}' where OrderId in ({2})", StatusValue, DateTime.Now, orderIds); result = m_dbo.ExecuteNonQuery(sql); break; } return(result); }
/// <summary> /// 修改订单状态 /// ERP FFeedBack.cs 中调用 /// </summary> /// <param name="StatusType1"></param> /// <param name="StatusValue1"></param> /// <param name="deliveryFinishTime"></param> /// <returns></returns> public bool UpdateStatus(OrderStatusType StatusType1, Order_Status StatusValue1, DateTime deliveryFinishTime) { string StatusType = StatusType1.ToString(); string StatusValue = StatusValue1.ToString(); this.Id = Id; this.Load(); switch (StatusType) { case "客服": this.ServiceStatus = StatusValue; if (StatusValue == "已完成") { this.ServiceFinishTime = DateTime.Now; } else { this.ServiceFinishTime = new DateTime(1900, 1, 1); } break; case "采购": this.PurchaseStatus = StatusValue; if (StatusValue == "已完成") { this.PurchaseFinishTime = DateTime.Now; } else { this.PurchaseFinishTime = new DateTime(1900, 1, 1); } break; case "仓库": this.StoreStatus = StatusValue; if (StatusValue == "已完成") { this.StoreFinishTime = DateTime.Now; } else { this.StoreFinishTime = new DateTime(1900, 1, 1); } break; case "配送": this.DeliveryStatus = StatusValue; if (StatusValue == "已完成") { this.DeliveryFinishTime = deliveryFinishTime; } else { this.DeliveryFinishTime = new DateTime(1900, 1, 1); } break; case "回单": this.FeedBackStatus = StatusValue; if (StatusValue == "已完成") { this.FeedBackFinishTime = DateTime.Now; } else { this.FeedBackFinishTime = new DateTime(1900, 1, 1); } break; } if (this.Save() > 0) { return(true); } else { return(false); } }
/// <summary> ///修改订单的状态 /// ERP FFeedBack.cs 中调用 /// </summary> /// <param name="StatusType1"></param> /// <param name="StatusValue1"></param> /// <param name="UserId"></param> /// <returns></returns> public bool UpdateStatus(OrderStatusType StatusType1, Order_Status StatusValue1, int UserId) { string StatusType = StatusType1.ToString(); string StatusValue = StatusValue1.ToString(); this.Id = Id; this.Load(); string Status = string.Empty; int IsInner = -1; int statusId = 0; switch (StatusType) { case "客服": this.ServiceStatus = StatusValue; this.ServiceId = UserId; if (StatusValue == "已完成") { this.ServiceFinishTime = DateTime.Now; Status = "您的订单已确认"; IsInner = 0; } else { IsInner = -1; this.ServiceFinishTime = new DateTime(1900, 1, 1); } break; case "采购": this.PurchaseStatus = StatusValue; if (StatusValue == "已完成") { this.PurchaseFinishTime = DateTime.Now; } else if (StatusValue == "已接受") { IsInner = 1; Status = "采购已接受!"; statusId = 3; this.PurchaseFinishTime = new DateTime(1900, 1, 1); } else { IsInner = -1; this.PurchaseFinishTime = new DateTime(1900, 1, 1); } break; case "仓库": this.StoreStatus = StatusValue; if (StatusValue == "已完成") { this.StoreFinishTime = DateTime.Now; statusId = 4; Status = "您商品已出库"; IsInner = 1; } else if (StatusValue == "已接受") { IsInner = 0; Status = "您的订单正在分拣!"; statusId = 3; this.StoreFinishTime = new DateTime(1900, 1, 1); } else { IsInner = -1; this.StoreFinishTime = new DateTime(1900, 1, 1); } break; case "配送": this.DeliveryStatus = StatusValue; if (StatusValue == "已完成") { this.DeliveryFinishTime = DateTime.Now; Status = "您的订单已配送完成!"; statusId = 5; IsInner = 0; } else if (StatusValue == "已接受") { IsInner = 0; statusId = 4; Status = "您的订单已分配到配送员,我们会尽快送达!"; this.DeliveryFinishTime = new DateTime(1900, 1, 1); } else { IsInner = -1; this.DeliveryFinishTime = new DateTime(1900, 1, 1); } break; case "回单": this.FeedBackStatus = StatusValue; if (StatusValue == "已完成") { IsInner = 1; Status = "订单已完成!"; statusId = 6; this.FeedBackFinishTime = DateTime.Now; } else { IsInner = -1; this.FeedBackFinishTime = new DateTime(1900, 1, 1); } break; } if (this.Save() > 0) { if (IsInner >= 0) { //添加订单状态明细 OrderStatusDetail osd = new OrderStatusDetail(); osd.IsInner = IsInner; osd.OrderId = this.OrderId; osd.Status = Status; osd.UserId = UserId; osd.StatusId = statusId; osd.TPIStatus = CommenClass.Order_Status.已完成.ToString(); if (osd.UserId == 0) { osd.UserName = "******"; } else { Sys_Users sys_users = new Sys_Users(); sys_users.Id = osd.UserId; if (sys_users.Load()) { osd.UserName = sys_users.Name; } } osd.Save(); } return(true); } else { return(false); } }