public JsonResult Edit(int id, IFormCollection collection) { SalerEntity entity = new SalerEntity(); TryUpdateModelAsync(entity); var result = service.Update(entity, AppUser, () => { SalerUtil.Clear(); }); return(Json(result)); }
public JsonResult Delete(int id) { var entity = service.Load(id); if (entity == null) { return(Json(ResultUtil.AuthFail("请求的数据不存在"))); } var result = service.Remove(entity, AppUser, () => { SalerUtil.Clear(); }); // 如果有缓存,注意在这里要清空缓存 return(Json(result)); }