public ActionResult EditCategory(UpdateItemCategoryModel model, int id) { if (ModelState.IsValid) { var r = YunClient.Instance.Execute(new UpdateShopItemCategoryRequest { Id = id, Title = model.Title, Display = Request.Form["IsDisplay"].TryTo(0) == 1, Image = model.Image, NewImage = FileManage.GetFirstFile(), Sort = model.Sort }, Token); if (r.Result) { TempData["success"] = "更新商品分类成功"; return RedirectToAction("Category"); } } return View(model); }
public ActionResult EditShopCat(UpdateItemCategoryModel model, int id) { if (ModelState.IsValid) { var r = YunClient.Instance.Execute(new UpdateShopCategoryRequest { Id = id, Name = model.Title, Sort = model.Sort, ParentId = model.ParentId }, Token); if (r.Result) { TempData["success"] = "更新商户分类成功"; return RedirectToAction("ShopCatList"); } TempData["error"] = "远程更新失败!"; return View(model); } TempData["error"] = "缺少必填项!"; return View(model); }
public ActionResult UpdateItemCat(UpdateItemCategoryModel model, int id = 0) { if (ModelState.IsValid) { var r = YunClient.Instance.Execute(new UpdateItemCatRequest { Id = id, Name = model.Title, Sort = model.Sort, Display = Request.Form["Displays"].TryTo(0) == 1, }, Token).Result; if (r) { TempData["success"] = "已成功修改“" + model.Title + "” 类目"; return RedirectToAction("ItemCat"); } } TempData["error"] = "商品类目修改失败,请刷新后重试"; return View(model); }