Exemple #1
0
        public ActionResult Create(EmergencyContact emergencyContact)
        {
            if (ModelState.IsValid)
            {
                emergencyContact = HRBusinessService.CreateEmergencyContact(UserOrganisationId, emergencyContact);
                return(RedirectToAction("Profile", "personnel", new { id = emergencyContact.PersonnelId }));
            }
            var viewModel = new EmergencyContactViewModel
            {
                Countries        = new SelectList(HRBusinessService.RetrieveCountries(UserOrganisationId, null, null).Items, "CountryId", "Name"),
                EmergencyContact = emergencyContact
            };

            return(View(viewModel));
        }