Beispiel #1
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            int tagFlag = (int)Session["TagFlag"];

            String fiscalYear = (String)Session["FiscalYear"];

            StoredProcedures sp = new StoredProcedures();

            TextBox tb = new TextBox();
            ArrayList CHG = new ArrayList();

            for (int row = 0; row < GrossCHGGridView.Rows.Count; row++)
            {

                String term = GrossCHGGridView.Rows[row].Cells[0].Text;

                tb = (TextBox)GrossCHGGridView.Rows[row].FindControl("UndergradCHGTextBox");

                String undergradCHG = tb.Text;

                tb = (TextBox)GrossCHGGridView.Rows[row].FindControl("UndergradRateTextBox");

                String undergradRate = tb.Text;

                tb = (TextBox)GrossCHGGridView.Rows[row].FindControl("GradCHGTextBox");
                String gradCHG = tb.Text;

                tb = (TextBox)GrossCHGGridView.Rows[row].FindControl("GradRateTextBox");

                String gradRate = tb.Text;

                sp.UpdateCHG(fiscalYear, term, "Undergraduate", "Gross", double.Parse(undergradCHG),double.Parse(undergradRate));
                sp.UpdateCHG(fiscalYear, term, "Graduate", "Gross", double.Parse(gradCHG), double.Parse(gradRate));

            }

            for (int row = 0; row < NetCHGGridView.Rows.Count; row++)
            {

                String term = NetCHGGridView.Rows[row].Cells[0].Text;

                tb = (TextBox)NetCHGGridView.Rows[row].FindControl("UndergradCHGTextBox");
                String undergradCHG = tb.Text;

                tb = (TextBox)NetCHGGridView.Rows[row].FindControl("UndergradRateTextBox");

                String undergradRate = tb.Text;

                tb = (TextBox)NetCHGGridView.Rows[row].FindControl("GradCHGTextBox");
                String gradCHG = tb.Text;

                tb = (TextBox)NetCHGGridView.Rows[row].FindControl("GradRateTextBox");

                String gradRate = tb.Text;

                sp.UpdateCHG(fiscalYear, term, "Undergraduate", "Net", double.Parse(undergradCHG), double.Parse(undergradRate));
                sp.UpdateCHG(fiscalYear, term, "Graduate", "Net", double.Parse(gradCHG), double.Parse(gradRate));

            }

            for (int row = 0; row < ExportedCHGGridView.Rows.Count; row++)
            {

                String term = ExportedCHGGridView.Rows[row].Cells[0].Text;

                tb = (TextBox)ExportedCHGGridView.Rows[row].FindControl("UndergradCHGTextBox");
                String undergradCHG = tb.Text;

                tb = (TextBox)ExportedCHGGridView.Rows[row].FindControl("UndergradRateTextBox");
                String undergradRate = tb.Text;

                tb = (TextBox)ExportedCHGGridView.Rows[row].FindControl("GradCHGTextBox");
                String gradCHG = tb.Text;

                tb = (TextBox)ExportedCHGGridView.Rows[row].FindControl("GradRateTextBox");
                String gradRate = tb.Text;

                sp.UpdateCHG(fiscalYear, term, "Undergraduate", "Exported", double.Parse(undergradCHG), double.Parse(undergradRate));
                sp.UpdateCHG(fiscalYear, term, "Graduate", "Exported", double.Parse(gradCHG), double.Parse(gradRate));

            }

            tb = (TextBox)DifferentialRevenueGridView.Rows[0].FindControl("UndergradCHGTextBox");
            String differentialUndergradCHG = tb.Text;

            tb = (TextBox)DifferentialRevenueGridView.Rows[0].FindControl("UndergradRateTextBox");
            String differentialUndergradRate = tb.Text;

            tb = (TextBox)DifferentialRevenueGridView.Rows[0].FindControl("NumberGradStudentsTextBox");
            String gradStudentsCHG = tb.Text;

            tb = (TextBox)DifferentialRevenueGridView.Rows[0].FindControl("GradRateTextBox");
            String gradStudentsRate = tb.Text;

            sp.UpdateDifferentialRevenue(fiscalYear, "Undergraduate", double.Parse(differentialUndergradCHG), double.Parse(differentialUndergradRate));
            sp.UpdateDifferentialRevenue(fiscalYear, "Graduate", double.Parse(gradStudentsCHG), double.Parse(gradStudentsRate));

            sp.UpdateRevenueExpenseSummary(fiscalYear);

            if (tagFlag == 1)
            {
                PopulateCHGTotals("Gross");
            }
            if (tagFlag == 2)
            {
                PopulateCHGTotals("Net");
            }
            if (tagFlag == 3)
            {
                PopulateCHGTotals("Exported");
            }
            if (tagFlag == 4)
            {
                PopulateDifferentialRevTotal();
            }
        }