/// <summary> /// Action that prints out all available locations /// </summary> /// <returns></returns> public ActionResult Index() { var viewModel = new List <LocationViewModel>(); foreach (Location l in _repository.GetLocations()) { viewModel.Add(_mapper.ParseLocation(l)); } return(View(viewModel)); }
/// <summary> /// Action that lets user set location of where an order will be placed /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult SetLocation(int id) { var viewModel = new List <LocationViewModel>(); foreach (Location l in _repository.GetLocations()) { viewModel.Add(_mapper.ParseLocation(l)); } ViewData["Locations"] = viewModel; ViewData["CustID"] = id; return(View()); }