Esempio n. 1
0
        public IActionResult AllLocations()
        {
            AllLocationsViewModel model = new AllLocationsViewModel();

            model.Locations = locationRepository.GetAll().Include(l => l.Admin)
                              .Include(l => l.LocationCategory);
            GetAllCategories(model);
            return(View(model));
        }
        private AddEventViewModel GetAllLocations(AddEventViewModel model)
        {
            var locations = locationRepository.GetAll();

            foreach (var location in locations)
            {
                model.Locations.Add(new SelectListItem {
                    Text = location.Title, Value = location.Id.ToString()
                });
            }
            return(model);
        }
Esempio n. 3
0
        public CreateNewTaskViewModel GetLocations(CreateNewTaskViewModel model)
        {
            var locations = locationRepository.GetAll();

            foreach (var location in locations)
            {
                model.Locations.Add(new SelectListItem {
                    Text = location.Title, Value = location.Id.ToString()
                });
            }
            return(model);
        }
Esempio n. 4
0
        public IActionResult Index(int id)
        {
            var location = _locationService.GetAll();

            var listingResult = location
                                .Select(l => new LocationListingModel
            {
                Id              = l.Id,
                LocationName    = l.LocationName,
                LocationAddress = l.LocationAddress,
                LocationMap     = l.LocationMapUrl
            });
            var model = new LocationIndexModel()
            {
                LocationListing = listingResult
            };

            return(View(model));
        }