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(); } }
protected void InstractionalCompenstationGridView_RowUpdating(Object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) { TextBox TBox; Double budget; Double rate; String expenseType = InstractionalCompenstationGridView.Rows[e.RowIndex].Cells[0].Text; TBox = (TextBox)InstractionalCompenstationGridView.Rows[e.RowIndex].Cells[1].Controls[0]; budget = Double.Parse(TBox.Text); TBox = (TextBox)InstractionalCompenstationGridView.Rows[e.RowIndex].Cells[2].Controls[0]; rate = Double.Parse(TBox.Text)/100; StoredProcedures sp = new StoredProcedures(); sp.UpdateCompensationExpenduters("Instractional", FinancialYearDropDownList.SelectedValue, expenseType, budget, rate); sp.UpdateRevenueExpenseSummary(FinancialYearDropDownList.SelectedValue); DisplayRevenueExpenseSummaryReport(); DisplayDirectExpenses(); InstractionalCompenstationGridView.EditIndex = -1; DisplayInstructionalCompensation(); FocusAnchor.Focus(); }
//protected void CreateFiscalYearButton_Click(object sender, EventArgs e) //{ // ArrayList fiscalYearData = (ArrayList)Session["FiscalYearData"]; // String fiscalYear = fiscalYearData[0].ToString(); // ArrayList chg = (ArrayList)fiscalYearData[1]; // StoredProcedures sp = new StoredProcedures(); // DataTable tbl = (DataTable)Session["CostDriversTbl"]; // foreach (DataRow row in tbl.Rows) // { // sp.InsertAllocatedCosts(fiscalYear, row[0].ToString(), row[1].ToString(), row[2].ToString(), row[3].ToString(), row[4].ToString(), row[5].ToString()); // } // if (Session["FiscalYear"] == null) // { // sp.RevenueSummaryInsert(fiscalYear); // } // else // { // sp.UpdateRevenueExpenseSummary(fiscalYear); // } //} protected void SaveCostDriverButton_Click(object sender, EventArgs e) { Alert.Visible = false; Error.Visible = false; DataTable costDriversTbl = (DataTable)Session["CostDriversTbl"]; TextBox tbox = new TextBox(); String fiscalYear = (String)Session["FiscalYear"]; for (int row = 0; row < SubmitCostDriverGridView.Rows.Count; row++) { StoredProcedures sp = new StoredProcedures(); String costDriver = SelectCostDriverDropDownList.SelectedValue; String metricType = SubmitCostDriverGridView.Rows[row].Cells[0].Text; tbox = (TextBox)SubmitCostDriverGridView.Rows[row].Cells[1].FindControl("PercentageTextBox"); String rate = String.Empty; if (tbox.Text != "") { rate = (Double.Parse(tbox.Text) / 100).ToString(); } else { rate = tbox.Text; } tbox = (TextBox)SubmitCostDriverGridView.Rows[row].Cells[2].FindControl("TotalMetricTextBox"); String totalMetric = tbox.Text; tbox = (TextBox)SubmitCostDriverGridView.Rows[row].Cells[3].FindControl("MetricsTextBox"); String metrics = tbox.Text; String costToAllocate = CostToAllocateTextBox.Text; sp.InsertAllocatedCosts(fiscalYear, costDriver, metricType, rate, totalMetric, metrics, costToAllocate); } StoredProcedures sp2 = new StoredProcedures(); sp2.UpdateRevenueExpenseSummary(fiscalYear); AddedCostDrivers(); }
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(); }
protected void TuitionRevenueGridView_RowUpdating(Object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) { String grossExported = (String)Session["RevenueCategory"]; String category = (String)Session["category"]; String gradUndergrad = (String)Session["gradUndergrad"]; TextBox TBox; String term; String rate; String CHG; term = TuitionRevenueGridView.Rows[e.RowIndex].Cells[0].Text; TBox = (TextBox)TuitionRevenueGridView.Rows[e.RowIndex].Cells[1].Controls[0]; CHG = TBox.Text; TBox = (TextBox)TuitionRevenueGridView.Rows[e.RowIndex].Cells[2].Controls[0]; rate = TBox.Text; StoredProcedures sp = new StoredProcedures(); sp.UpdateRevenue(FinancialYearDropDownList.SelectedValue, term, gradUndergrad, grossExported, rate, CHG); sp.UpdateRevenueExpenseSummary(FinancialYearDropDownList.SelectedValue); DisplayRevenueExpenseSummaryReport(); DisplayTuitionRevenueBreakdown(grossExported); TuitionRevenueGridView.EditIndex = -1; DisplayTuition(category); FocusAnchor.Focus(); }
protected void SupportUnitMetricsGridView_RowUpdating(Object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) { String metricType = (String)Session["metricType"]; String supportUnit = (String)Session["supportUnit"]; TextBox TBox; Double rate; Double totalMetrics; Double costToAllocate; metricType = SupportUnitMetricsGridView.Rows[e.RowIndex].Cells[0].Text; TBox = (TextBox)SupportUnitMetricsGridView.Rows[e.RowIndex].Cells[1].Controls[0]; rate = Double.Parse(TBox.Text)/100; TBox = (TextBox)SupportUnitMetricsGridView.Rows[e.RowIndex].Cells[2].Controls[0]; totalMetrics = Double.Parse(TBox.Text); TBox = (TextBox)SupportUnitMetricsGridView.Rows[e.RowIndex].Cells[3].Controls[0]; costToAllocate = Double.Parse(TBox.Text); //TBox = (TextBox)SupportUnitMetricsGridView.Rows[e.RowIndex].Cells[5].Controls[0]; //metrics = Double.Parse(TBox.Text); StoredProcedures sp = new StoredProcedures(); sp.UpdateCostDrivers(FinancialYearDropDownList.SelectedValue, supportUnit, metricType, rate, totalMetrics, costToAllocate); sp.UpdateRevenueExpenseSummary(FinancialYearDropDownList.SelectedValue); DisplayRevenueExpenseSummaryReport(); DisplaySupportUnit(supportUnit); DisplayAllocatedCostsSummaryReport(); SupportUnitMetricsGridView.EditIndex = -1; DisplaySupportUnitMetrics(supportUnit, metricType); FocusAnchor.Focus(); }
protected void SupportUnitBreakDownGridView_RowUpdating(Object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) { String supportUnit = (String)Session["supportUnit"]; TextBox TBox; String metricType; Double metrics; LinkButton lb; lb = (LinkButton) SupportUnitBreakDownGridView.Rows[e.RowIndex].Cells[0].Controls[0]; metricType = lb.Text; TBox = (TextBox)SupportUnitBreakDownGridView.Rows[e.RowIndex].Cells[1].Controls[0]; metrics = Double.Parse(TBox.Text); StoredProcedures sp = new StoredProcedures(); sp.UpdateCostDriversMetrics(FinancialYearDropDownList.SelectedValue, supportUnit, metricType, metrics); sp.UpdateRevenueExpenseSummary(FinancialYearDropDownList.SelectedValue); DisplayRevenueExpenseSummaryReport(); DisplayAllocatedCostsSummaryReport(); SupportUnitBreakDownGridView.EditIndex = -1; DisplaySupportUnit(supportUnit); FocusAnchor.Focus(); }
protected void AssessmentsGridView_RowUpdating(Object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) { TextBox TBox; String assessment; double undergradRate; double gradRate; assessment = AssessmentsGridView.Rows[e.RowIndex + 1].Cells[0].Text; TBox = (TextBox)AssessmentsGridView.Rows[e.RowIndex].Cells[1].Controls[0]; undergradRate = double.Parse(TBox.Text)/100; TBox = (TextBox)AssessmentsGridView.Rows[e.RowIndex].Cells[3].Controls[0]; gradRate = double.Parse(TBox.Text)/100; StoredProcedures sp = new StoredProcedures(); sp.UpdateAssessments(FinancialYearDropDownList.SelectedValue, "Undergraduate", assessment, undergradRate); sp.UpdateAssessments(FinancialYearDropDownList.SelectedValue, "Graduate", assessment, gradRate); sp.UpdateRevenueExpenseSummary(FinancialYearDropDownList.SelectedValue); DisplayRevenueExpenseSummaryReport(); AssessmentsGridView.EditIndex = -1; DisplayAssesments(); FocusAnchor.Focus(); }
protected void NonCompensationExpensesGridView_RowUpdating(Object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) { TextBox TBox; Double budget; String expenseType = NonCompensationExpensesGridView.Rows[e.RowIndex].Cells[0].Text; TBox = (TextBox)NonCompensationExpensesGridView.Rows[e.RowIndex].Cells[1].Controls[0]; budget = Double.Parse(TBox.Text); StoredProcedures sp = new StoredProcedures(); sp.UpdateNonCompensationExpenduters("NonCompensation", FinancialYearDropDownList.SelectedValue, expenseType, budget); sp.UpdateRevenueExpenseSummary(FinancialYearDropDownList.SelectedValue); DisplayRevenueExpenseSummaryReport(); DisplayDirectExpenses(); NonCompensationExpensesGridView.EditIndex = -1; DisplayNonCompensationExpenses(); //FocusAnchor.Focus(); }
protected void SaveButton_Click(object sender, EventArgs e) { String fiscalYear = (String)Session["FiscalYear"]; TextBox tb = new TextBox(); StoredProcedures sp = new StoredProcedures(); for (int row = 0; row < InstractionalCompensationGridView.Rows.Count; row++) { String expenseType = InstractionalCompensationGridView.Rows[row].Cells[0].Text; tb = (TextBox)InstractionalCompensationGridView.Rows[row].FindControl("BudgetTextBox"); double budget = double.Parse(tb.Text); tb = (TextBox)InstractionalCompensationGridView.Rows[row].FindControl("FringeBenefitRateTextBox"); double fringeBenefitRate = double.Parse(tb.Text) / 100; sp.UpdateCompensationExpenduters("Instractional", fiscalYear, expenseType, budget, fringeBenefitRate); RatesApplyButton.Visible = false; } for (int row = 0; row < NonInstractionalCompensationGridView.Rows.Count; row++) { String expenseType = NonInstractionalCompensationGridView.Rows[row].Cells[0].Text; tb = (TextBox)NonInstractionalCompensationGridView.Rows[row].FindControl("BudgetTextBox"); double budget = double.Parse(tb.Text); tb = (TextBox)NonInstractionalCompensationGridView.Rows[row].FindControl("FringeBenefitRateTextBox"); double fringeBenefitRate = double.Parse(tb.Text) / 100; sp.UpdateCompensationExpenduters("NonInstractional", fiscalYear, expenseType, budget, fringeBenefitRate); } for (int row = 0; row < NonCompensationGridView.Rows.Count; row++) { String expenseType = NonCompensationGridView.Rows[row].Cells[0].Text; tb = (TextBox)NonCompensationGridView.Rows[row].FindControl("BudgetTextBox"); double budget = double.Parse(tb.Text); sp.UpdateNonCompensationExpenduters("NonCompensation", fiscalYear, expenseType, budget); } for (int row = 0; row < MiscellaneousExpensesGridView.Rows.Count; row++) { String expenseType = MiscellaneousExpensesGridView.Rows[row].Cells[0].Text; tb = (TextBox)MiscellaneousExpensesGridView.Rows[row].FindControl("BudgetTextBox"); double budget = double.Parse(tb.Text); sp.UpdateNonCompensationExpenduters("Miscellaneous", fiscalYear, expenseType, budget); } DisplayTotals(fiscalYear); sp.UpdateRevenueExpenseSummary(fiscalYear); }