예제 #1
0
        // GET: Sites
        public async Task <ActionResult> Index()
        {
            IList <Site> Sites = await _sitesRepository.GetAllSites();

            List <SelectListItem> customers = await _customersRepository.GetAllCustomersAsSelectListItem();

            List <SelectListItem> countries = await _geoRepository.GetAllCountriesAsSelectListItem();

            List <SelectListItem> states = await _geoRepository.GetAllStatesAsSelectListItem();


            var model = new IndexSiteViewModel
            {
                Sites     = Sites,
                Customers = customers,
                Countries = countries,
                States    = states,
            };

            return(View(model));
        }