Beispiel #1
0
        public ActionResult Create([Bind(Include = "CountryId, Name")] Country country)
        {
            if (ModelState.IsValid)
            {
                var result = HRBusinessService.CreateCountry(UserOrganisationId, country);
                if (result.Succeeded)
                {
                    return(RedirectToAction("Index"));
                }
                foreach (var error in result.Errors)
                {
                    ModelState.AddModelError("", error);
                }
            }
            var viewModel = new CountryViewModel
            {
                Country = country
            };

            return(View(viewModel));
        }