private void CheckLocationCode() { upnlLocationSummary.Update(); pnlResults.Visible = false; pnlNoData.Visible = true; var locationCode = tbQuickLocation.Text; if (locationCode.Length < 7) { return; } using (var dataAccess = new LocationSummaryDataAccess()) { var locationId = dataAccess.GetLocationIdFromCode(locationCode); if (locationId == 0) { GridData = null; return; } pnlResults.Visible = true; pnlNoData.Visible = false; lblLocationName.Text = dataAccess.GetLocationName(locationId); GetLocationGrid(dataAccess, locationId); AddCarSegments(); } }
protected void btnRefresh_Click(object sender, EventArgs e) { var locationId = int.Parse(hfLocationId.Value); using (var dataAccess = new LocationSummaryDataAccess()) { GetLocationGrid(dataAccess, locationId); } }
private void GetLocationGrid(LocationSummaryDataAccess dataAccess, int locationId) { var nowDate = DateTime.Now.ToShortDateString(); lblDate.Text = nowDate; var parameters = new Dictionary <DictionaryParameter, string>(); parameters[DictionaryParameter.StartDate] = nowDate; parameters[DictionaryParameter.PercentageCalculation] = PercentageDivisorType.OperationalFleet.ToString(); parameters[DictionaryParameter.Location] = locationId.ToString(CultureInfo.InvariantCulture); parameters[DictionaryParameter.FleetTypes] = AvailabilityParameters.GetSelectedKeys(lbFleet.Items); hfLocationId.Value = locationId.ToString(CultureInfo.InvariantCulture); BuildLocalVehiclesGrid(dataAccess, parameters); }
private void BuildLocalVehiclesGrid(LocationSummaryDataAccess dataAccess, Dictionary <DictionaryParameter, string> parameters) { GridData = dataAccess.GetFleetStatusData(parameters); ForiegnGridData = dataAccess.GetForeignFleetStatusData(parameters); }