public int Update(UserBaseUpdateRequest model)
 {
     Adapter.ExecuteQuery("dbo.UserBaseId_Update", new[] {
         SqlDbParameter.Instance.BuildParameter("@Email", model.Email, System.Data.SqlDbType.NVarChar),
         SqlDbParameter.Instance.BuildParameter("@PasswordHash", model.PasswordHash, System.Data.SqlDbType.NVarChar),
         SqlDbParameter.Instance.BuildParameter("@Salt", model.Salt, SqlDbType.NVarChar),
         SqlDbParameter.Instance.BuildParameter("@IsAccountLocked", model.IsAccountLocked, System.Data.SqlDbType.Bit),
         SqlDbParameter.Instance.BuildParameter("@Id", model.Id, System.Data.SqlDbType.Int)
     });
     return(0);
 }
 public IHttpActionResult Put(UserBaseUpdateRequest model)
 {
     try
     {
         ItemResponse <int> response = new ItemResponse <int>
         {
             Item         = _loginService.Update(model),
             IsSuccessful = true
         };
         return(Ok());
     }
     catch (Exception ex) { return(BadRequest(ex.Message)); }
 }
예제 #3
0
        public int Update(UserBaseUpdateRequest request)
        {
            _dataProvider.ExecuteNonQuery(
                "user_update",
                inputParamMapper : delegate(SqlParameterCollection parameters)
            {
                parameters.AddWithValue("@Id", request.Id);
                parameters.AddWithValue("@FullName", request.FullName);
                parameters.AddWithValue("@UserName", request.UserName);
                parameters.AddWithValue("@EmailAddress", request.EmailAddress);
            });

            return(request.Id);
        }
예제 #4
0
 //PUT CALL
 public void Put(UserBaseUpdateRequest model)
 {
     DataProvider.ExecuteNonQuery("dbo.Users_UserBase_Update",
                                  inputParamMapper : delegate(SqlParameterCollection paramCollection)
     {
         paramCollection.AddWithValue("@email", model.Email);
         paramCollection.AddWithValue("@passwordHash", model.PasswordHash);
         paramCollection.AddWithValue("@salt", model.Salt);
         paramCollection.AddWithValue("@isEmailConfirmed", model.IsEmailConfirmed);
         paramCollection.AddWithValue("@isAccountLocked", model.IsAccountLocked);
         paramCollection.AddWithValue("@loginAttempts", model.LoginAttempts);
         paramCollection.AddWithValue("@id", model.Id);
     });
 }
        public IHttpActionResult Put(UserBaseUpdateRequest model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest("invalid model!"));
                }
                _userBaseService.Put(model); // change

                return(Ok(new SuccessResponse()));
            }
            catch (Exception ex)
            {
                _errorLogService.Post(new Models.Requests.Logs.ErrorLogAddRequest
                {
                    ErrorSourceTypeId = 1,
                    Message           = ex.Message,
                    StackTrace        = ex.StackTrace,
                    Title             = "Error in " + GetType().Name + " " + System.Reflection.MethodBase.GetCurrentMethod().Name
                });
                return(BadRequest(ex.Message));
            }
        }