コード例 #1
0
 public InvokeResult <bool> DeleteForm(string keyValue)
 {
     using (var db = _Respository.BeginTransaction())
     {
         var b = true;
         try
         {
             if (_MemRespository.Any(w => w.GroupId == keyValue))
             {//级联归组:未分组
                 var mems = _MemRespository.Get(w => w.GroupId == keyValue).ToList();
                 mems.ForEach(mem =>
                 {
                     mem.GroupId = null;
                 });
                 b = _MemRespository.UpdateFields(mems, "GroupId");
             }
             if (!b)
             {
                 db.Rollback();
                 return(RequestResult.Failed <bool>("删除关联的客户信息失败"));
             }
             _Respository.Delete(keyValue);
             db.Commit();
             return(RequestResult.Success(true));
         }
         catch (Exception ex)
         {
             db.Rollback();
             _Logger.LogError(ex, "修改备注失败-文件重命名失败:" + ex.Message);
             return(RequestResult.Failed <bool>("删除关联的客户信息失败"));
         }
     }
 }
コード例 #2
0
        public InvokeResult <bool> ChangeEmail(string userId, string email)
        {
            var entity = GetMember(userId);

            entity.Email = email;
            var result = _Respository.UpdateFields(entity, "Email");

            return(RequestResult.Result(result, "邮箱修改失败!"));
        }