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);
            }
        }
Beispiel #2
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);
        }
        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);
            }
        }