private SelectList PopulateLocationsDDL()
        {
            List <ILocationInfoDO> databaseLocations = _LocationAccess.ViewAllLocations();
            List <LocationPO>      mappedLocations   = LocationMap.MapDOtoPO(databaseLocations);
            List <LocationPO>      locationList      = new List <LocationPO>();

            //add dummy location for "default" on dropdown, otherwise it sets to ACTUAL location
            locationList.Add(new LocationPO()
            {
                LocationID = 0, LocationName = " -- Please choose a Location --"
            });
            locationList.AddRange(mappedLocations);
            return(new SelectList(locationList, "LocationID", "LocationName"));
        }
Beispiel #2
0
        public ActionResult ViewLocations()
        {
            LocationVM newVM = new LocationVM();


            try
            {
                List <ILocationInfoDO> locationData = _LocationAccess.ViewAllLocations();
                newVM.LocationList = LocationMap.MapDOtoPO(locationData);
            }
            catch (Exception)
            {
                newVM.ErrorMessage = "There was an issue obtaining the list";
            }
            finally
            {
                ///nothing else needs to happen
            }

            return(View(newVM));
        }