Beispiel #1
0
        public ActionResult Create(JobTitleViewModel JobTitleViewModel)
        {
            if (ModelState.IsValid)
            {
                var result = HRBusinessService.CreateJobTitle(UserOrganisationId, JobTitleViewModel.JobTitle);
                if (result.Succeeded)
                {
                    return(RedirectToAction("Edit", new { id = result.Entity.JobTitleId }));
                }
                foreach (var error in result.Errors)
                {
                    ModelState.AddModelError("", error);
                }
            }
            var viewModel = new JobTitleViewModel
            {
                JobTitle = JobTitleViewModel.JobTitle
            };

            return(View(viewModel));
        }