public ActionResult BookingTypePartial(string id) { if (!String.IsNullOrWhiteSpace(id)) { bool isGuid = Guid.TryParse(id, out Guid jobId); if (isGuid && jobId != Guid.Empty) { var repo = new MetadataRepository(); var model = new Models.DTO.BookingType() { JobId = id, //BookingTypes = repo.GetBookingTypes() }; return(PartialView("BookingTypePartial", model)); } } return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); }
public ActionResult BookingTypePartial(Models.DTO.BookingType model) { if (ModelState.IsValid && !String.IsNullOrWhiteSpace(model.JobId)) { switch (model.SelectedBookingType) { case "Schedule": var scheduleModel = new Models.DTO.Schedule() { JobId = model.JobId }; return(PartialView("CreateSchedulePartial", scheduleModel)); case "Crew": var crewModel = new Models.DTO.Crew() { JobId = model.JobId }; return(PartialView("CreateCrewPartial", crewModel)); case "BookinFleet": var fleetModel = new Models.DTO.BookingFleet() { JobId = model.JobId }; //var fleetTypeRepo = new FleetTypeRepository(); //fleetModel. = fleetTypeRepo.GetFleetTypes(); //var regionsRepo = new RegionsRepository(); //postalAddressModel.Regions = regionsRepo.GetRegions(); return(PartialView("CreateBookingFleetPartial", fleetModel)); case "BookingHotel": var hotelModel = new Models.DTO.BookingHotel() { JobId = model.JobId }; //var countriesRepo = new CountriesRepository(); //postalAddressModel.Countries = countriesRepo.GetCountries(); //var regionsRepo = new RegionsRepository(); //postalAddressModel.Regions = regionsRepo.GetRegions(); return(PartialView("CreateBookingHotelPartial", hotelModel)); case "BookingKit": var kitModel = new Models.DTO.BookingKit() { JobId = model.JobId }; //var countriesRepo = new CountriesRepository(); //postalAddressModel.Countries = countriesRepo.GetCountries(); //var regionsRepo = new RegionsRepository(); //postalAddressModel.Regions = regionsRepo.GetRegions(); return(PartialView("CreateBookingKitPartial", kitModel)); case "BookingEquipment": var equipmentModel = new Models.DTO.BookingEquipment() { JobId = model.JobId }; //var countriesRepo = new CountriesRepository(); //postalAddressModel.Countries = countriesRepo.GetCountries(); //var regionsRepo = new RegionsRepository(); //postalAddressModel.Regions = regionsRepo.GetRegions(); return(PartialView("CreateBookingPartial", equipmentModel)); default: return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } } return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); }