示例#1
0
        public JsonResult Edit(int id, IFormCollection collection)
        {
            SalerEntity entity = new SalerEntity();

            TryUpdateModelAsync(entity);
            var result = service.Update(entity, AppUser, () =>
            {
                SalerUtil.Clear();
            });

            return(Json(result));
        }
示例#2
0
        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));
        }