public ActionResult Edit(BrandModel brand) { if (ModelState.IsValid) { Entities.BrandInfo model = new Entities.BrandInfo() { Id = brand.ID, Name = brand.BrandName.Trim(), Description = brand.BrandDesc, Logo = brand.BrandLogo, Meta_Description = brand.MetaDescription, Meta_Keywords = brand.MetaKeyWord, Meta_Title = brand.MetaTitle, //RewriteName = brand.BrandEnName, IsRecommend = brand.IsRecommend, }; _iBrandService.UpdateBrand(model); //更新商品搜索冗余数据 Task.Factory.StartNew(() => { _iSearchProductService.UpdateBrand(model); }); return(RedirectToAction("Management")); } return(View(brand)); }
public ActionResult Add(BrandModel brand) { if (ModelState.IsValid) { Entities.BrandInfo model = new Entities.BrandInfo() { Name = brand.BrandName.Trim(), Description = brand.BrandDesc, Logo = brand.BrandLogo, Meta_Description = brand.MetaDescription, Meta_Keywords = brand.MetaKeyWord, Meta_Title = brand.MetaTitle, //RewriteName = brand.BrandEnName, //ShopId = 0, IsRecommend = brand.IsRecommend, //AuditStatus = BrandInfo.BrandAuditStatus.Audited }; bool flag = _iBrandService.IsExistBrand(brand.BrandName.Trim()); if (flag == false) { _iBrandService.AddBrand(model); } return(RedirectToAction("Management")); } return(View(brand)); }
public JsonResult UpdateSellerBrand(BrandModel brand) { Entities.BrandInfo model = new Entities.BrandInfo() { Id = brand.ID, Name = brand.BrandName, Description = brand.BrandDesc, Logo = brand.BrandLogo, //AuditStatus = BrandInfo.BrandAuditStatus.UnAudit }; //_iBrandService.UpdateSellerBrand(model); return(Json(new Result() { success = true, msg = "更新成功" })); }
public JsonResult EditApply(BrandApplyModel brand) { var shopId = CurrentSellerManager.ShopId; Entities.ShopBrandApplyInfo model = _iBrandService.GetBrandApply(brand.Id); if (model == null) { throw new Himall.Core.HimallException("该品牌审核不通过,请重新编辑"); } if (model.ApplyMode == 1) { var m = _iBrandService.GetBrand(brand.BrandId); if (m == null) { throw new Himall.Core.HimallException("品牌不存在"); } model.BrandName = m.Name; model.Logo = m.Logo; model.Description = m.Description; model.BrandId = brand.BrandId; } else { if (brand.BrandDesc.Length > 200) { return(Json(new Result() { success = false, msg = "简介过长!" })); } model.BrandId = 0; model.BrandName = brand.BrandName.Trim(); model.Logo = brand.BrandLogo; model.Description = brand.BrandDesc; } model.Remark = brand.Remark; model.AuthCertificate = brand.BrandAuthPic; model.ShopId = shopId; model.ApplyTime = DateTime.Now; var oldapply = _iBrandService.GetExistApply(shopId, model.BrandName); if (oldapply == null) { model.AuditStatus = 0; _iBrandService.UpdateApplyBrand(model); } else { Entities.BrandInfo orderband = null; if (oldapply.BrandId > 0) { orderband = _iBrandService.GetBrand(oldapply.BrandId); } if (orderband != null && orderband.IsDeleted) { model.Id = oldapply.Id; } else { if (oldapply.AuditStatus == (int)ShopBrandApplyInfo.BrandAuditStatus.Audited || oldapply.AuditStatus == (int)ShopBrandApplyInfo.BrandAuditStatus.UnAudit) { throw new Himall.Core.HimallException("该品牌申请已存在,请选择申请其他品牌"); } model.AuditStatus = 0; _iBrandService.UpdateApplyBrand(model); } } return(Json(new Result() { success = true, msg = "重新编辑品牌申请成功!" })); }