コード例 #1
0
 public EditProfileModel()
 {
     ChangePasswordModel = new ChangePasswordModel();
     EditMainInfoModel = new EditMainInfoModel();
     EditAdvanceInfoModel = new EditAdvanceInfoModel();
     EditBindInfoModel = new EditBindInfoModel();
 }
コード例 #2
0
        public ActionResult EditMainInfo(EditMainInfoModel model)
        {
            if (ModelIsValid)
            {
                var data = new UserInfoData
                {
                    UserId = model.UserId,
                    UserName = model.UpdateUserName,
                    UserEmail = model.UpdateUserEmail,
                    FirstName = model.FirstName,
                    LastName = model.LastName,
                    SexId = model.SexId,
                    ShowUserEmail = model.ShowEmail
                };

                Execute(() => _accountService.UpdateMainInfo(data));

                if (CurrentUser.IsMe(model.UserId))
                    Execute(() => CurrentUser = _accountService.GetUser(model.UserId));
            }
            return View("_EditMainInfoPartial", model);
        }