Example #1
0
        public Result Delete(int id)
        {
            try
            {
                var rlt = UnitOfWorkService.Execute(() =>
                {
                    var entity      = _repo.Get(id);
                    entity.IsEnable = 0;
                    var result      = _repo.Update(entity);
                    return(result);
                });
                if (rlt)
                {
                    return(new Result(true, ""));
                }

                return(new Result(false, "数据操作失败"));
            }
            catch (Exception ex)
            {
                Logger.Error("delete org error:", ex);
                return(new Result(false, "内部服务器错误"));
            }
        }
 public Org Get(int id)
 {
     return(_orgRepository.Get(id));
 }