Ejemplo n.º 1
0
        public List <Member> GetList(string keyword = "")
        {
            var expression = ExtLinq.True <Member>();

            if (!string.IsNullOrEmpty(keyword))
            {
                expression = expression.And(t => t.UserName.Contains(keyword));
                expression = expression.Or(t => t.RealName.Contains(keyword));
                expression = expression.Or(t => t.NickName.Contains(keyword));
            }
            return(_Respository.Get(expression).OrderBy(t => t.SortCode).ToList());
        }
Ejemplo n.º 2
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>("删除关联的客户信息失败"));
         }
     }
 }
Ejemplo n.º 3
0
 public Member GetMember(string userId)
 {
     return(_Respository.Get(userId));
 }