Beispiel #1
0
        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);
                }
            }
        }
Beispiel #3
0
        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);
        }