private void RefreshGrid() { List <OverviewGridItemHolder> data; Dictionary <string, string> distinctLocations; //List<CountryHolder> owningCountries; var mergedParameters = ucParameters.GetParameterDictionary(); using (var dataAccess = new VehicleOverviewDataAccess(mergedParameters)) { lblLastUpdate.Text = LastUpdatedFromFleetNow.GetLastUpdatedDateTime(dataAccess); data = dataAccess.GetForeignVehicleOverviewGrid(); distinctLocations = dataAccess.GetDistinctOwningLocationIds(); //owningCountries = dataAccess.GetActiveOwningCountryHolders(); } ucVehicleOverview.DistinctLocations = distinctLocations; ucVehicleOverview.OverviewData = data; var countriesThatOwn = data.Select(d => new CountryHolder { CountryDescription = d.CountryName, CountryId = d.CountryId }).Distinct().ToList(); ucVehicleOverview.OwningCountries = countriesThatOwn; pnlOverviewGrid.Visible = true; //ucVehicleOverview.AddColumns(); }
public void TestMethod1() { using (var dataAccess = new VehicleOverviewDataAccess(null)) { var data = dataAccess.GetForeignVehicleOverviewGrid(); var dict = dataAccess.GetCountryDescriptionDictionary(); } }