public void ClearAllData() { YearsGrid.DataSource = null; YearsGrid.DataBind(); YearsGrid_Values.DataSource = null; YearsGrid_Values.DataBind(); MonthGrid.DataSource = null; MonthGrid.DataBind(); MonthGrid_Values.DataSource = null; MonthGrid_Values.DataBind(); DaysGrid.DataSource = null; DaysGrid.DataBind(); DateUpdate.Update(); }
protected void ReloadStats_Click(object s, EventArgs e) { string connectionString = ConfigurationSettings.AppSettings["fleetnetbaseConnectionString"]; DataBlock dataBlock = new DataBlock(connectionString, ConfigurationManager.AppSettings["language"]); try { bool isDDD = IsDDDFile(); List <int> selectedIds = new List <int>(); selectedIds = (List <int>)Session["StatisticsDataBlockIds"]; int yearVal = Convert.ToInt32(YearsGrid.SelectedRow.Cells[0].Text); int monthNumber = MonthGrid.SelectedIndex + 1; dataBlock.OpenConnection(); if (isDDD) { if (dataBlock.GetDataBlock_CardType(selectedIds[0]) == 0)//dddDriverCard { MonthGrid_Values.DataSource = GetDDDMonthValuesDataTable(dataBlock, selectedIds, yearVal); DaysGrid.DataSource = GetDDDDayValuesDataTable(dataBlock, selectedIds, yearVal, monthNumber); } else//DDDVehicleCard { MonthGrid_Values.DataSource = GetVehicleMonthValuesDataTable(dataBlock, selectedIds, yearVal); DaysGrid.DataSource = GetVehicleDayValuesDataTable(dataBlock, selectedIds, yearVal, monthNumber); } } else { MonthGrid_Values.DataSource = GetPLFMonthValuesDataTable(dataBlock, selectedIds, yearVal); DaysGrid.DataSource = GetPLFDayValuesDataTable(dataBlock, selectedIds, yearVal, monthNumber); } MonthGrid_Values.DataBind(); DaysGrid.DataBind(); dataBlock.CloseConnection(); DateUpdate.Update(); } catch (Exception ex) { Status.Text = ex.Message; DateUpdate.Update(); } finally { dataBlock.CloseConnection(); } }
private void LoadAllForVehicleFile(DataBlock dataBlock, List <int> selectedIds, List <int> yearsList) { YearsGrid.DataSource = GetYearsDataTable(yearsList); YearsGrid.DataBind(); YearsGrid_Values.DataSource = GetVehicleYearsValuesDataTable(dataBlock, selectedIds, yearsList); YearsGrid_Values.DataBind(); MonthGrid.DataSource = GetMonthDataTable(); MonthGrid.DataBind(); if (yearsList.Count > 0) { MonthGrid_Values.DataSource = GetVehicleMonthValuesDataTable(dataBlock, selectedIds, yearsList[0]); MonthGrid_Values.DataBind(); } if (yearsList.Count > 0) { DaysGrid.DataSource = GetVehicleDayValuesDataTable(dataBlock, selectedIds, yearsList[0], 1); DaysGrid.DataBind(); } }