コード例 #1
0
        public ActionResult ChangeProfileInfo(ChangeUserProfileModel profile)
        {
            if (ModelState.IsValid)
            {
                var u = GetCurrentUser();
                u = profile.ToModel(u);

                //SỬAAAAAAAAAAAAAAAAAA
                var managementItem = new AccountManagementItem <User_Profile, IUserProfileService>();
                //var type = RoleTypeEnum.User;

                //không sửaaaaaaaaaaa
                managementItem.ModelState = ModelState;
                //managementItem.profile = profile;

                var acc = managementItem.ChangeProfile(this.ControllerContext, u);
                if (acc != null)//~ account != null && account.IsValid() trong ChangeProfile
                {
                    SetLoginAuthentication(acc);
                    SetSuccess("Cập nhật thành công");
                }
                else
                {
                    SetCustomError("Có lỗi xảy ra. Vui lòng kiểm tra lại");
                }
            }

            return(View(profile));
        }