コード例 #1
0
 public bool UserRegister(UserInsertModel userInsertModel)
 {
     if (userInsertModel.Password.Equals(userInsertModel.ConfirmPassword))
     {
         var user = mapper.Map <UserInsertModel, Data.Entities.User>(userInsertModel);
         user.Password = MD5Hash.getMd5Hash(user.Password);
         userRepository.Add(user);
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #2
0
 public BaseResponseModel PostUserRegister([FromBody] UserInsertModel userInsertModel)
 {
     try
     {
         var result = userService.UserRegister(userInsertModel);
         if (result)
         {
             return(new SuccessResponseModel <bool>(result));
         }
         else
         {
             return(new BaseResponseModel(ReadOnlyValues.UnexpectedErrorMessage));
         }
     }
     catch (Exception ex)
     {
         return(new BaseResponseModel(ex.Message));
     }
 }
コード例 #3
0
        public IActionResult UserRegister(UserInsertModel userInsertModel)
        {
            if (ModelState.IsValid)
            {
                var userRegister = Post <bool>(MyApiRequestModel.PostUserRegister, userInsertModel);
                var checkUserBaseResponseError = CheckBaseControllerError(userRegister);

                if (checkUserBaseResponseError == null)
                {
                    return(Login());
                }
                else
                {
                    return(Error(checkUserBaseResponseError));
                }
            }
            else
            {
                return(UserRegister());
            }
        }