Example #1
0
 public SingleApiResponse Save(TestSaveRequest req)
 {
     //编辑
     if (req.UID.HasValue)
     {
         var result = RepoBase.Instance.GetWhere <SysUserInfoes>(x => x.UID == req.UID).ToList().FirstOrDefault();
         if (result == null)
         {
             return new SingleApiResponse()
                    {
                        BizErrorMsg = "不包含此用户"
                    }
         }
         ;
         result.ULoginName = req.ULoginName;
         result.ULoginPWD  = req.ULoginPWD;
         result.URealName  = req.URealName;
         RepoBase.Instance.Update(result);
     }
     //新增
     else
     {
         RepoBase.Instance.Add(new SysUserInfoes()
         {
             ULoginName = req.ULoginName, ULoginPWD = req.ULoginPWD, URealName = req.URealName
         });
     }
     return(new SingleApiResponse());
 }
Example #2
0
        public SingleApiResponse Delete(TestSaveRequest req)
        {
            var result = RepoBase.Instance.GetWhere <SysUserInfoes>(x => x.UID == req.UID).ToList().FirstOrDefault();

            if (result == null)
            {
                return new SingleApiResponse()
                       {
                           BizErrorMsg = "不包含此用户"
                       }
            }
            ;

            RepoBase.Instance.Delete(result);
            //throw new Exception("xxx");
            return(new SingleApiResponse());
        }
 public SingleApiResponse Delete([FromBody] TestSaveRequest req)
 {
     return(TestBiz.Delete(req));
 }