예제 #1
0
        public AjaxResult EditProfiles([Bind(Include = "Id,Name")] IEnumerable <ProfileModel> profiles)
        {
            foreach (var profile in profiles)
            {
                if (!ModelState.IsValid)
                {
                    return(new AjaxResult(AjaxResultState.Error));
                }

                _profileManagementService.UpdateProfile(profile);
            }
            return(new AjaxResult(AjaxResultState.OK));
        }
예제 #2
0
        public IActionResult EditProfile(ProfileManagementModel profile)
        {
            try
            {
                // TODO: Add update logic here
                if (ModelState.IsValid)
                {
                    _profileManagementService.UpdateProfile(profile);
                }

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(RedirectToAction("EditProfile"));
            }
        }