public ActionResult Create(MobilizationViewModel mobilizationViewModel) { if (ModelState.IsValid) { mobilizationViewModel.Mobilization.OrganisationId = UserOrganisationId; mobilizationViewModel.Mobilization.CentreId = 1; mobilizationViewModel.Mobilization = NidanBusinessService.CreateMobilization(UserOrganisationId, mobilizationViewModel.Mobilization); return(RedirectToAction("Index")); } return(View(mobilizationViewModel)); }
public ActionResult Create(MobilizationViewModel mobilizationViewModel) { var organisationId = UserOrganisationId; var centreId = UserCentreId; var personnelId = UserPersonnelId; if (ModelState.IsValid) { mobilizationViewModel.Mobilization.OrganisationId = organisationId; mobilizationViewModel.Mobilization.CentreId = centreId; mobilizationViewModel.Mobilization.PersonnelId = personnelId; mobilizationViewModel.Mobilization.CreatedBy = personnelId; mobilizationViewModel.Mobilization.EventId = mobilizationViewModel.EventId; mobilizationViewModel.Mobilization.Close = "No"; mobilizationViewModel.Mobilization.CreatedBy = UserPersonnelId; mobilizationViewModel.Mobilization = NidanBusinessService.CreateMobilization(UserOrganisationId, mobilizationViewModel.Mobilization); return(RedirectToAction("Index")); } mobilizationViewModel.Courses = new SelectList(NidanBusinessService.RetrieveCourses(organisationId, e => true).ToList()); mobilizationViewModel.MobilizationTypes = new SelectList(NidanBusinessService.RetrieveMobilizationTypes(organisationId, e => true).ToList()); mobilizationViewModel.Events = new SelectList(NidanBusinessService.RetrieveEvents(organisationId, e => true).Items.ToList()); mobilizationViewModel.Qualifications = new SelectList(NidanBusinessService.RetrieveQualifications(organisationId, e => true).ToList()); return(View(mobilizationViewModel)); }