public int UserInfoUpdate(UserInfoUpdateRequest request)
        {
            UserLoginRequest userInfoReq = new UserLoginRequest();

            userInfoReq.UserName = request.UserName;
            userInfoReq.PassWord = request.PassWord;

            UserInfoResponse     userInfoRes   = UserLogin(userInfoReq);
            UserInfoRequestModel userInfoModel = AutoMappingUtils.ConvertTo <UserInfoRequestModel>(request);

            if (userInfoRes != null)
            {
                userInfoModel.UID       = userInfoRes.UID;
                userInfoModel.UserNO    = userInfoRes.UserNO;
                userInfoModel.UserName  = userInfoRes.UserName;
                userInfoModel.UserEmail = userInfoRes.UserEmail;
                userInfoModel.PassWord  = request.NewPassWord;

                return(_userInfoDal.UserInfoUpdate(userInfoModel));
            }
            else
            {
                return(0);
            }
        }
 public IHttpActionResult Put(UserInfoUpdateRequest model)
 {
     try
     {
         ItemResponse <int> response = new ItemResponse <int>
         {
             Item         = _userInfoService.Update(model),
             IsSuccessful = true
         };
         return(Ok());
     }
     catch (Exception ex) { return(BadRequest(ex.Message)); }
 }
示例#3
0
 public int Update(UserInfoUpdateRequest model)
 {
     Adapter.ExecuteQuery("dbo.UserInfo_Update", new[] {
         SqlDbParameter.Instance.BuildParameter("@UserBaseId", model.UserBaseId, System.Data.SqlDbType.Int),
         SqlDbParameter.Instance.BuildParameter("@FirstName", model.FirstName, System.Data.SqlDbType.NVarChar),
         SqlDbParameter.Instance.BuildParameter("@LastName", model.LastName, System.Data.SqlDbType.NVarChar),
         SqlDbParameter.Instance.BuildParameter("@UserAvatar", model.UserAvatar, SqlDbType.NVarChar),
         SqlDbParameter.Instance.BuildParameter("@Bio", model.Bio, System.Data.SqlDbType.NVarChar),
         SqlDbParameter.Instance.BuildParameter("@DateOfBirth", model.DateOfBirth, System.Data.SqlDbType.Date),
         SqlDbParameter.Instance.BuildParameter("@Interest", model.Interest, System.Data.SqlDbType.Int),
         SqlDbParameter.Instance.BuildParameter("@Id", model.Id, System.Data.SqlDbType.Int)
     });
     return(0);
 }
 public object Any(UserInfoUpdateRequest request)
 {
     return(_userBusiness.UserInfoUpdate(request));
 }