예제 #1
0
        public Result Add(OrgDto dto)
        {
            try
            {
                var entity = dto.MapTo <OrgEntity>();
                var rlt    = UnitOfWorkService.Execute(() => _repo.InsertAndGetId(entity));
                if (rlt > 0)
                {
                    return(new Result(true, ""));
                }

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