public PartialViewResult DisplayMonth(int year, int month, Guid busId) { var bus = _busRepository.GetById(busId); var viewModel = DisplayMonthViewModelMapper.Map(year, month, bus); return(PartialView("_Calendar", viewModel)); }
public ActionResult Details(Guid id) { var bus = _busRepository.GetById(id); var viewModel = PropertyMapper.MapMatchingProperties <Bus, DetailsViewModel>(bus, true); viewModel.Calendar = DisplayMonthViewModelMapper.Map(bus); return(View(viewModel)); }
public static void Hydrate(MakeViewModel viewModel, Bus bus) { viewModel.Calendar = DisplayMonthViewModelMapper.Map(bus); viewModel.BusName = bus.Name; if (viewModel.IsMainDriver) { viewModel.AlternateDriverAdditionalClasses = "hide"; } viewModel.NumberOfAdultsOptions = new SelectList(new List <SelectListItem> { new SelectListItem { Selected = true, Text = "0", Value = "0" }, new SelectListItem { Text = "1", Value = "1" }, new SelectListItem { Text = "2", Value = "2" }, new SelectListItem { Text = "3", Value = "3" }, new SelectListItem { Text = "4", Value = "4" }, new SelectListItem { Text = "5", Value = "5" }, new SelectListItem { Text = "6", Value = "6" }, }, "Value", "Text"); viewModel.NumberOfChildrenOptions = new SelectList(new List <SelectListItem> { new SelectListItem { Selected = true, Text = "0", Value = "0" }, new SelectListItem { Text = "1", Value = "1" }, new SelectListItem { Text = "2", Value = "2" }, new SelectListItem { Text = "3", Value = "3" }, new SelectListItem { Text = "4", Value = "4" }, new SelectListItem { Text = "5", Value = "5" }, new SelectListItem { Text = "6", Value = "6" }, }, "Value", "Text"); }