Exemplo n.º 1
0
        public async Task <IActionResult> ControlPanel()
        {
            var model = new SelectQueryDetailsViewModel();

            model.Title = Context_.GetTitle();

            var countries = new List <string>();

            var cities = new List <string>();

            //Load all countries

            var result = await Context_.GetAllCountriesAsync();

            countries = Context_.Countries.Select(x => x.Value).ToList();

            model.Countries = GetSelectListItems(countries);

            ViewData["Countries"] = model.Countries;

            //Get cities, intially will be empty as no country selected.

            model.Cities = GetSelectListItems(cities);

            ViewData["Cities"] = model.Cities;

            //Select Parameters

            var parameters = await SelectParameters();

            model.Parameters = GetSelectListItems(parameters);

            //Initialize query results from view model

            var queryresult = new List <QueryResult>();

            model.QueryResults = queryresult.ToList();

            return(View(model));
        }