Exemplo n.º 1
0
        public async Task <JsonResult> PostAsync([FromBody] Sys_UserDTO value)
        {
            var user = _mapper.Map <Sys_UserDTO, Sys_Users>(value);

            user.PassWord = user.PassWord ?? SystemConfig.DEAFULT_PWD;
            var rs = await _service.SaveSys_User(user);

            return(Json(rs));
        }
Exemplo n.º 2
0
 public HttpResponseMessage Modify(Sys_UserDTO udto)
 {
     try
     {
         server.Modify(udto);
         return(HttpResponseExtension.toJson(new { info = "成功", content = "恭喜你修改成功了哦!" }));
     }
     catch (Exception ex)
     {
         UnitExtension.Log(ex);
         return(HttpResponseExtension.toJson(new { info = "错误", content = "更新信息出错啦!" }));
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 取所有用户
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public bool GetAllUserList(Sys_UserDTO dto)
        {
            var entity = Mapper.Map <Sys_UserDTO, Sys_User>(dto);
            var isnull = user.UserRegist(entity);

            if (isnull != null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 4
0
Arquivo: Boot.cs Projeto: yobur/KuRuMi
        public void TestMethod()
        {
            //IIocManager ioc = new IocManager();
            //var s = ioc.Resolve<CostomRepositoryImpl>();
            UserRepositoryImpl s = new UserRepositoryImpl();
            Sys_UserDTO        u = new Sys_UserDTO();

            u.Id       = Guid.NewGuid();
            u.userName = "******";
            u.passWord = "******";
            u.email    = "*****@*****.**";
            MapperConfigurationImpl ip = new MapperConfigurationImpl();
            var z = Mapper.Map <Sys_UserDTO, Sys_User>(u);

            s.Add(z);
            UnitExtension.Log("添加成功");
        }
Exemplo n.º 5
0
 public HttpResponseMessage UserRegist(Sys_UserDTO udto)
 {
     try
     {
         var obj = server.GetAllUserList(udto);
         if (obj)
         {
             //注册前先查询注册的账户是否存在
             server.UserRegist(udto);
             return(HttpResponseExtension.toJson("注册成功!"));
         }
         else
         {
             return(HttpResponseExtension.toJson("请检查用户名和邮箱"));
         }
     }
     catch (Exception e)
     {
         return(HttpResponseExtension.toJson("注册失败"));
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// 修改账户
        /// </summary>
        /// <param name="dto"></param>
        public void Modify(Sys_UserDTO dto)
        {
            var entity = Mapper.Map <Sys_UserDTO, Sys_User>(dto);

            user.Update(entity);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="dto"></param>
        public void UserRegist(Sys_UserDTO dto)
        {
            var entity = Mapper.Map <Sys_UserDTO, Sys_User>(dto);

            user.Add(entity);
        }