コード例 #1
0
ファイル: AddCHG.aspx.cs プロジェクト: redtchits/RCM_NEW
        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();
            }
        }
コード例 #2
0
        protected void TuitionDifferentialRevenueGridView_RowUpdating(Object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e)
        {
            TextBox TBox;
            String gradUndergrad;
            Double rate;
            Double numberStudentsCHG;

            if (e.RowIndex == 0)
            {
                gradUndergrad = "Undergraduate";

            }
            else
            {
                gradUndergrad = "Graduate";

            }

            TBox = (TextBox)TuitionDifferentialRevenueGridView.Rows[e.RowIndex].Cells[1].Controls[0];
            numberStudentsCHG = Double.Parse(TBox.Text);
            TBox = (TextBox)TuitionDifferentialRevenueGridView.Rows[e.RowIndex].Cells[2].Controls[0];
            rate = Double.Parse(TBox.Text);

            StoredProcedures sp = new StoredProcedures();

            sp.UpdateDifferentialRevenue(FinancialYearDropDownList.SelectedValue, gradUndergrad, numberStudentsCHG, rate);

            sp.UpdateRevenueExpenseSummary(FinancialYearDropDownList.SelectedValue);
            DisplayRevenueExpenseSummaryReport();

            TuitionDifferentialRevenueGridView.EditIndex = -1;
            DisplayTuitionDifferentialRevenue();
            FocusAnchor.Focus();
        }