public ActionResult BackOrderAfterService(int asId) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null || orderAfterServiceInfo.StoreId != WorkContext.StoreId) { return(PromptView("订单售后服务不存在")); } if (orderAfterServiceInfo.State != (int)OrderAfterServiceState.Received) { return(PromptView("不能执行此操作")); } BackOrderAfterServiceModel model = new BackOrderAfterServiceModel(); ViewData["asId"] = asId; ViewData["orderAfterServiceInfo"] = orderAfterServiceInfo; List <SelectListItem> shipCompanyList = new List <SelectListItem>(); shipCompanyList.Add(new SelectListItem() { Text = "请选择", Value = "0" }); foreach (ShipCompanyInfo item in ShipCompanies.GetShipCompanyList()) { shipCompanyList.Add(new SelectListItem() { Text = item.Name, Value = item.ShipCoId.ToString() }); } ViewData["shipCompanyList"] = shipCompanyList; return(View(model)); }
public ActionResult CheckOrderAfterService(int asId, CheckOrderAfterServiceModel model) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null || orderAfterServiceInfo.StoreId != WorkContext.StoreId) { return(PromptView("订单售后服务不存在")); } if (orderAfterServiceInfo.State != (int)OrderAfterServiceState.Checking) { return(PromptView("不能执行此操作")); } if (ModelState.IsValid) { if (model.State == 0) { AdminOrderAfterServices.CheckRefuseOrderAfterService(asId, model.CheckResult ?? "", DateTime.Now); } else { AdminOrderAfterServices.CheckAgreeOrderAfterService(asId, model.CheckResult ?? "", DateTime.Now); } return(PromptView("操作成功")); } ViewData["asId"] = asId; return(View(model)); }
/// <summary> /// 获得订单售后服务 /// </summary> /// <param name="asId">售后服务id</param> /// <returns></returns> public static OrderAfterServiceInfo GetOrderAfterServiceByASId(int asId) { OrderAfterServiceInfo orderAfterServiceInfo = null; IDataReader reader = BrnShop.Core.BSPData.RDBS.GetOrderAfterServiceByASId(asId); if (reader.Read()) { orderAfterServiceInfo = BuildOrderAfterServiceFromReader(reader); } reader.Close(); return(orderAfterServiceInfo); }
/// <summary> /// 获得订单商品售后服务列表 /// </summary> /// <param name="recordId">记录id</param> /// <returns></returns> public static List <OrderAfterServiceInfo> GetOrderProductAfterServiceList(int recordId) { List <OrderAfterServiceInfo> orderAfterServiceList = new List <OrderAfterServiceInfo>(); IDataReader reader = BrnShop.Core.BSPData.RDBS.GetOrderProductAfterServiceList(recordId); while (reader.Read()) { OrderAfterServiceInfo orderAfterServiceInfo = BuildOrderAfterServiceFromReader(reader); orderAfterServiceList.Add(orderAfterServiceInfo); } reader.Close(); return(orderAfterServiceList); }
/// <summary> /// 获得订单售后服务列表 /// </summary> /// <param name="oid">订单id</param> /// <returns></returns> public static List <OrderAfterServiceInfo> GetOrderAfterServiceList(int oid) { List <OrderAfterServiceInfo> orderAfterServiceList = new List <OrderAfterServiceInfo>(); IDataReader reader = BrnMall.Core.BMAData.RDBS.GetOrderAfterServiceList(oid); while (reader.Read()) { OrderAfterServiceInfo orderAfterServiceInfo = BuildOrderAfterServiceFromReader(reader); orderAfterServiceList.Add(orderAfterServiceInfo); } reader.Close(); return(orderAfterServiceList); }
/// <summary> /// 订单售后服务信息 /// </summary> /// <param name="asId">售后服务id</param> /// <returns></returns> public ActionResult OrderAfterServiceInfo(int asId) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null || orderAfterServiceInfo.StoreId != WorkContext.StoreId) { return(PromptView("订单售后服务不存在")); } OrderAfterServiceModel model = new OrderAfterServiceModel(); model.OrderAfterServiceInfo = orderAfterServiceInfo; model.RegionInfo = Regions.GetRegionById(orderAfterServiceInfo.RegionId); ViewData["referer"] = MallUtils.GetMallAdminRefererCookie(); return(View(model)); }
public ActionResult BackOrderAfterService(int asId, BackOrderAfterServiceModel model) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null) { return(PromptView("订单售后服务不存在")); } if (orderAfterServiceInfo.State != (int)OrderAfterServiceState.Received) { return(PromptView("不能执行此操作")); } ShipCompanyInfo shipCompanyInfo = ShipCompanies.GetShipCompanyById(model.ShipCoId); if (shipCompanyInfo == null) { ModelState.AddModelError("ShipCoId", "配送公司不存在"); } if (ModelState.IsValid) { AdminOrderAfterServices.BackOrderAfterService(asId, model.ShipCoId, shipCompanyInfo.Name, model.ShipSN); return(PromptView("操作成功")); } ViewData["asId"] = asId; ViewData["orderAfterServiceInfo"] = orderAfterServiceInfo; ViewData["orderAfterServiceInfo"] = orderAfterServiceInfo; List <SelectListItem> shipCompanyList = new List <SelectListItem>(); shipCompanyList.Add(new SelectListItem() { Text = "请选择", Value = "0" }); foreach (ShipCompanyInfo item in ShipCompanies.GetShipCompanyList()) { shipCompanyList.Add(new SelectListItem() { Text = item.Name, Value = item.ShipCoId.ToString() }); } ViewData["shipCompanyList"] = shipCompanyList; return(View(model)); }
public ActionResult CheckOrderAfterService(int asId) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null || orderAfterServiceInfo.StoreId != WorkContext.StoreId) { return(PromptView("订单售后服务不存在")); } if (orderAfterServiceInfo.State != (int)OrderAfterServiceState.Checking) { return(PromptView("不能执行此操作")); } CheckOrderAfterServiceModel model = new CheckOrderAfterServiceModel(); ViewData["asId"] = asId; return(View(model)); }
/// <summary> /// 通过IDataReader创建OrderAfterServiceInfo /// </summary> public static OrderAfterServiceInfo BuildOrderAfterServiceFromReader(IDataReader reader) { OrderAfterServiceInfo orderAfterServiceInfo = new OrderAfterServiceInfo(); orderAfterServiceInfo.ASId = TypeHelper.ObjectToInt(reader["asid"]); orderAfterServiceInfo.State = TypeHelper.ObjectToInt(reader["state"]); orderAfterServiceInfo.Uid = TypeHelper.ObjectToInt(reader["uid"]); orderAfterServiceInfo.Oid = TypeHelper.ObjectToInt(reader["oid"]); orderAfterServiceInfo.RecordId = TypeHelper.ObjectToInt(reader["recordid"]); orderAfterServiceInfo.Pid = TypeHelper.ObjectToInt(reader["pid"]); orderAfterServiceInfo.CateId = TypeHelper.ObjectToInt(reader["cateid"]); orderAfterServiceInfo.BrandId = TypeHelper.ObjectToInt(reader["brandid"]); orderAfterServiceInfo.StoreId = TypeHelper.ObjectToInt(reader["storeid"]); orderAfterServiceInfo.PName = reader["pname"].ToString(); orderAfterServiceInfo.PShowImg = reader["pshowimg"].ToString(); orderAfterServiceInfo.Count = TypeHelper.ObjectToInt(reader["count"]); orderAfterServiceInfo.Money = TypeHelper.ObjectToDecimal(reader["money"]); orderAfterServiceInfo.Type = TypeHelper.ObjectToInt(reader["type"]); orderAfterServiceInfo.ApplyReason = reader["applyreason"].ToString(); orderAfterServiceInfo.ApplyTime = TypeHelper.ObjectToDateTime(reader["applytime"]); orderAfterServiceInfo.CheckResult = reader["checkresult"].ToString(); orderAfterServiceInfo.CheckTime = TypeHelper.ObjectToDateTime(reader["checktime"]); orderAfterServiceInfo.ShipCoId1 = TypeHelper.ObjectToInt(reader["shipcoid1"]); orderAfterServiceInfo.ShipCoName1 = reader["shipconame1"].ToString(); orderAfterServiceInfo.ShipSN1 = reader["shipsn1"].ToString(); orderAfterServiceInfo.RegionId = TypeHelper.ObjectToInt(reader["regionid"]); orderAfterServiceInfo.Consignee = reader["consignee"].ToString(); orderAfterServiceInfo.Mobile = reader["mobile"].ToString(); orderAfterServiceInfo.Phone = reader["phone"].ToString(); orderAfterServiceInfo.Email = reader["email"].ToString(); orderAfterServiceInfo.ZipCode = reader["zipcode"].ToString(); orderAfterServiceInfo.Address = reader["address"].ToString(); orderAfterServiceInfo.SendTime = TypeHelper.ObjectToDateTime(reader["sendtime"]); orderAfterServiceInfo.ReceiveTime = TypeHelper.ObjectToDateTime(reader["receivetime"]); orderAfterServiceInfo.ShipCoId2 = TypeHelper.ObjectToInt(reader["shipcoid2"]); orderAfterServiceInfo.ShipCoName2 = reader["shipconame2"].ToString(); orderAfterServiceInfo.ShipSN2 = reader["shipsn2"].ToString(); orderAfterServiceInfo.BackTime = TypeHelper.ObjectToDateTime(reader["backtime"]); return(orderAfterServiceInfo); }
/// <summary> /// 商城收到客户邮寄的商品 /// </summary> public ActionResult ReceiveOrderAfterService(int asId) { OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId); if (orderAfterServiceInfo == null || orderAfterServiceInfo.StoreId != WorkContext.StoreId) { return(PromptView("订单售后服务不存在")); } if (orderAfterServiceInfo.State != (int)OrderAfterServiceState.Sended) { return(PromptView("不能执行此操作")); } if (orderAfterServiceInfo.Type == 0) { AdminOrderAfterServices.CompleteOrderAfterService(asId); OrderInfo orderInfo = AdminOrders.GetOrderByOid(orderAfterServiceInfo.Oid); OrderRefunds.ApplyRefund(new OrderRefundInfo() { State = (int)OrderRefundState.Applied, StoreId = orderInfo.StoreId, StoreName = orderInfo.StoreName, Oid = orderInfo.Oid, OSN = orderInfo.OSN, Uid = orderInfo.Uid, ASId = orderAfterServiceInfo.ASId, PaySystemName = orderInfo.PaySystemName, PayFriendName = orderInfo.PayFriendName, PaySN = orderInfo.PaySN, PayMoney = orderAfterServiceInfo.Money, RefundMoney = orderAfterServiceInfo.Money, ApplyTime = DateTime.Now }); } else { AdminOrderAfterServices.ReceiveOrderAfterService(asId, DateTime.Now); } return(PromptView("操作成功")); }