private void cboMonth_SelectedIndexChanged(object sender, EventArgs e) { //reset the grdView grdRevnAnalys.Rows.Clear(); //reset the comboBox cboWeek.Items.Clear(); monthSelected = cboMonth.Text.Trim(); //display on the gridbox DataSet ds = new DataSet(); ds = Revenue.displayWeeklyRecord(ds, yearSelected, monthSelected); for (int i = 0; i < ds.Tables["weekly"].Rows.Count; i++) { DataGridViewRow row = (DataGridViewRow)grdRevnAnalys.Rows[0].Clone(); row.Cells[0].Value = yearSelected; row.Cells[1].Value = monthSelected; row.Cells[2].Value = ds.Tables["weekly"].Rows[i][0].ToString(); row.Cells[3].Value = ""; row.Cells[4].Value = ds.Tables["weekly"].Rows[i][1].ToString(); grdRevnAnalys.Rows.Add(row); } //display or reload the week combo box ds = new DataSet(); ds = Revenue.loadWeek(ds, yearSelected, monthSelected); //load month combo box for (int i = 0; i < ds.Tables["week"].Rows.Count; i++) { cboWeek.Items.Add(ds.Tables[0].Rows[i][0].ToString()); } }
private void frmRevenueAnalysis_Load(object sender, EventArgs e) { //load the year combo box with the year DataSet ds = new DataSet(); ds = Revenue.loadYear(ds); //load year for (int i = 0; i < ds.Tables["year"].Rows.Count; i++) { cboYear.Items.Add(ds.Tables[0].Rows[i][0].ToString()); } //display on the gridbox ds = Revenue.displayAnnualRecord(ds); for (int i = 0; i < ds.Tables["annual"].Rows.Count; i++) { DataGridViewRow row = (DataGridViewRow)grdRevnAnalys.Rows[0].Clone(); row.Cells[0].Value = ds.Tables["annual"].Rows[i][0].ToString(); row.Cells[1].Value = ""; row.Cells[2].Value = ""; row.Cells[3].Value = ""; row.Cells[4].Value = ds.Tables["annual"].Rows[i][1].ToString(); grdRevnAnalys.Rows.Add(row); } }
private void cboYear_SelectedIndexChanged(object sender, EventArgs e) { //if resetting combo, ignore... if (cboYear.SelectedIndex == -1) { return; } else { //reset the month combo box cboMonth.Items.Clear(); monthSelected = null; yearSelected = cboYear.Text.Trim(); //display or reload the month combo box DataSet ds = new DataSet(); ds = Revenue.loadMonth(ds, yearSelected); //load month combo box for (int i = 0; i < ds.Tables["month"].Rows.Count; i++) { cboMonth.Items.Add(ds.Tables[0].Rows[i][0].ToString()); } //display on the gridbox displayAnalysis(grdFdAnlys); } }
private void cboYear_SelectedIndexChanged(object sender, EventArgs e) { //if resetting combo, ignore... if (cboYear.SelectedIndex == -1) { return; } else { //reset the grdview grdRevnAnalys.Rows.Clear(); //reset other combo cboMonth.Items.Clear(); cboWeek.Items.Clear(); yearSelected = cboYear.Text.Trim(); //display or reload the month combo box DataSet ds = new DataSet(); ds = Revenue.loadMonth(ds, yearSelected); //load month combo box for (int i = 0; i < ds.Tables["month"].Rows.Count; i++) { cboMonth.Items.Add(ds.Tables[0].Rows[i][0].ToString()); } //display on the gridbox ds = Revenue.displayMonthlyRecord(ds, yearSelected); for (int i = 0; i < ds.Tables["monthly"].Rows.Count; i++) { DataGridViewRow row = (DataGridViewRow)grdRevnAnalys.Rows[0].Clone(); row.Cells[0].Value = yearSelected; row.Cells[1].Value = ds.Tables["monthly"].Rows[i][0].ToString(); row.Cells[2].Value = ""; row.Cells[3].Value = ""; row.Cells[4].Value = ds.Tables["monthly"].Rows[i][1].ToString(); grdRevnAnalys.Rows.Add(row); } } }
private void frmFoodAnalysis_Load(object sender, EventArgs e) { //load the year combo box with the year DataSet ds = new DataSet(); ds = Revenue.loadYear(ds); //load year for (int i = 0; i < ds.Tables["year"].Rows.Count; i++) { cboYear.Items.Add(ds.Tables[0].Rows[i][0].ToString()); } //load month ds = Revenue.loadMonth(ds, yearSelected); for (int i = 0; i < ds.Tables["month"].Rows.Count; i++) { cboMonth.Items.Add(ds.Tables["month"].Rows[i][0].ToString()); } //display analysis displayAnalysis(grdFdAnlys); }
private void btnReset_Click(object sender, EventArgs e) { yearSelected = null; monthSelected = null; weekSelected = null; //reset other combo cboMonth.Items.Clear(); cboWeek.Items.Clear(); cboYear.Items.Clear(); //load the year combo box with the year DataSet ds = new DataSet(); ds = Revenue.loadYear(ds); //load year for (int i = 0; i < ds.Tables["year"].Rows.Count; i++) { cboYear.Items.Add(ds.Tables[0].Rows[i][0].ToString()); } grdRevnAnalys.Rows.Clear(); //display on the gridbox ds = Revenue.displayAnnualRecord(ds); for (int i = 0; i < ds.Tables["annual"].Rows.Count; i++) { DataGridViewRow row = (DataGridViewRow)grdRevnAnalys.Rows[0].Clone(); row.Cells[0].Value = ds.Tables["annual"].Rows[i][0].ToString(); row.Cells[1].Value = ""; row.Cells[2].Value = ""; row.Cells[3].Value = ""; row.Cells[4].Value = ds.Tables["annual"].Rows[i][1].ToString(); grdRevnAnalys.Rows.Add(row); } }
private void cboWeek_SelectedIndexChanged(object sender, EventArgs e) { //reset the grdView grdRevnAnalys.Rows.Clear(); //reset the comboBox weekSelected = cboWeek.Text.Trim(); //display on the gridbox DataSet ds = new DataSet(); ds = Revenue.displayDailyRecord(ds, yearSelected, monthSelected, weekSelected); for (int i = 0; i < ds.Tables["daily"].Rows.Count; i++) { DataGridViewRow row = (DataGridViewRow)grdRevnAnalys.Rows[0].Clone(); row.Cells[0].Value = yearSelected; row.Cells[1].Value = monthSelected; row.Cells[2].Value = weekSelected; row.Cells[3].Value = ds.Tables["daily"].Rows[i][0].ToString(); row.Cells[4].Value = ds.Tables["daily"].Rows[i][1].ToString(); grdRevnAnalys.Rows.Add(row); } }