public void DealComplaint(long id) { OrderComplaintInfo orderComplaintInfo = context.OrderComplaintInfo.FindById <OrderComplaintInfo>(id); orderComplaintInfo.Status = OrderComplaintInfo.ComplaintStatus.End; context.SaveChanges(); }
public JsonResult AddOrderComplaint(OrderComplaintInfo model) { model.UserId = base.CurrentUser.Id; model.UserName = base.CurrentUser.UserName; model.ComplaintDate = DateTime.Now; model.Status = OrderComplaintInfo.ComplaintStatus.WaitDeal; ShopInfo shop = ServiceHelper.Create <IShopService>().GetShop(model.ShopId, false); OrderInfo order = ServiceHelper.Create <IOrderService>().GetOrder(model.OrderId, base.CurrentUser.Id); if (model.ComplaintReason.Length < 5) { throw new HimallException("投诉内容不能小于5个字符!"); } if (string.IsNullOrWhiteSpace(model.UserPhone)) { throw new HimallException("投诉电话不能为空!"); } if (order == null || order.ShopId != model.ShopId) { throw new HimallException("该订单不属于当前用户!"); } model.ShopName = (shop == null ? "" : shop.ShopName); model.ShopPhone = (shop == null ? "" : shop.CompanyPhone); ServiceHelper.Create <IComplaintService>().AddComplaint(model); return(Json(new { success = true, msg = "Success" }, JsonRequestBehavior.AllowGet)); }
public JsonResult AddOrderComplaint(OrderComplaintInfo model) { model.UserId = CurrentUser.Id; model.UserName = CurrentUser.UserName; model.ComplaintDate = DateTime.Now; model.Status = OrderComplaintInfo.ComplaintStatus.WaitDeal; var shop = _iShopService.GetShop(model.ShopId); var order = _iOrderService.GetOrder(model.OrderId, CurrentUser.Id); if (model.ComplaintReason.Length < 5) { throw new HimallException("投诉内容不能小于5个字符!"); } if (string.IsNullOrWhiteSpace(model.UserPhone)) { throw new HimallException("投诉电话不能为空!"); } if (order == null || order.ShopId != model.ShopId) { throw new HimallException("该订单不属于当前用户!"); } model.ShopName = shop == null ? "" : shop.ShopName; model.ShopPhone = shop == null ? "" : shop.CompanyPhone; model.ShopPhone = model.ShopPhone == null ? "" : model.ShopPhone; model.ShopName = model.ShopName == null ? "" : model.ShopName; _iComplaintService.AddComplaint(model); return(Json(new { success = true, msg = "提交成功" }, JsonRequestBehavior.AllowGet)); }
public void SellerDealComplaint(long id, string reply) { OrderComplaintInfo orderComplaintInfo = context.OrderComplaintInfo.FindById <OrderComplaintInfo>(id); orderComplaintInfo.Status = OrderComplaintInfo.ComplaintStatus.Dealed; orderComplaintInfo.SellerReply = reply; context.SaveChanges(); }
public void UserDealComplaint(long id, long userId) { OrderComplaintInfo orderComplaintInfo = context.OrderComplaintInfo.FindById <OrderComplaintInfo>(id); if (orderComplaintInfo.UserId != userId) { throw new HimallException("该投诉不属于此用户!"); } orderComplaintInfo.Status = OrderComplaintInfo.ComplaintStatus.End; context.SaveChanges(); }
public void UserDealComplaint(long id, long userId) { OrderComplaintInfo orderComplaint = DbFactory.Default.Get <OrderComplaintInfo>().Where(p => p.Id == id).FirstOrDefault(); if (orderComplaint != null && orderComplaint.UserId != userId) { throw new MallException("该投诉不属于此用户!"); } orderComplaint.Status = OrderComplaintInfo.ComplaintStatus.End; DbFactory.Default.Update(orderComplaint); }
public void UserApplyArbitration(long id, long userId) { OrderComplaintInfo orderComplaint = Context.OrderComplaintInfo.FindById(id); if (orderComplaint.UserId != userId) { throw new HimallException("该投诉不属于此用户!"); } orderComplaint.Status = OrderComplaintInfo.ComplaintStatus.Dispute; Context.SaveChanges(); }
public void UserApplyArbitration(long id, long userId) { OrderComplaintInfo orderComplaint = DbFactory.Default.Get <OrderComplaintInfo>().Where(p => p.Id == id).FirstOrDefault(); if (orderComplaint.UserId != userId) { throw new HimallException("该投诉不属于此用户!"); } orderComplaint.Status = OrderComplaintInfo.ComplaintStatus.Dispute; DbFactory.Default.Update(orderComplaint); }
public void AddComplaint(OrderComplaintInfo model) { if (context.OrderComplaintInfo.Any((OrderComplaintInfo a) => a.OrderId == model.OrderId)) { throw new HimallException("你已经投诉过了,请勿重复投诉!"); } if (string.IsNullOrEmpty(model.SellerReply)) { model.SellerReply = string.Empty; } context.OrderComplaintInfo.Add(model); context.SaveChanges(); }
//添加一个用户投诉 public void AddComplaint(OrderComplaintInfo model) { var exist = DbFactory.Default.Get <OrderComplaintInfo>().Where(a => a.OrderId == model.OrderId).Exist(); if (exist) { throw new MallException("你已经投诉过了,请勿重复投诉!"); } if (string.IsNullOrEmpty(model.SellerReply)) { model.SellerReply = string.Empty; } DbFactory.Default.Add(model); }