Exemple #1
0
        public AjaxResult CreateProfile([Bind(Include = "Name")] ProfileModel profile)
        {
            if (ModelState.IsValid)
            {
                _profileManagementService.CreateProfile(profile);
                return(new AjaxResult(AjaxResultState.OK));
            }

            return(new AjaxResult(AjaxResultState.Error));
        }
Exemple #2
0
        public IActionResult CreateProfile(ProfileManagementModel profile)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    _profileManagementService.CreateProfile(profile);
                }

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