public ActionResult Edit(ProductTypeViewModel model) { try { if (!ModelState.IsValid) { return(View(model)); } var productType = _mapper.Map <ProductType>(model); productType.UpdatedAt = DateTime.Now; var isSuccess = _repo.Update(productType); if (!isSuccess) { ModelState.AddModelError("", "Something Went Wrong"); return(View(model)); } return(RedirectToAction(nameof(Index))); } catch { ModelState.AddModelError("", "Something Went Wrong"); return(View()); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(MesWeb.Model.ProductType model) { return(dal.Update(model)); }
public static void Update(ProductTypeInfo entity) { dal.Update(entity); CacheHelper.Remove(cacheKey); }