protected void CreateFiscalYearButton_Click(object sender, EventArgs e) { ArrayList fiscalYearData = (ArrayList)Session["FiscalYearData"]; String fiscalYear = fiscalYearData[0].ToString(); ArrayList chg =(ArrayList)fiscalYearData[1]; UpdateDatabase updtDB = new UpdateDatabase(); DataTable tbl = (DataTable)Session["CostDriversTbl"]; foreach (DataRow row in tbl.Rows) { updtDB.InsertAllocatedCosts(fiscalYear, row[0].ToString(), row[1].ToString(), row[2].ToString(), row[3].ToString(), row[4].ToString(), row[5].ToString()); } if (Session["FiscalYear"] == null) { updtDB.RevenueSummaryInsert(fiscalYear); } else { updtDB.RevenueSummaryUpdate(fiscalYear); } }
protected void CreateFYButton_Click(object sender, EventArgs e) { UpdateDatabase updbs = new UpdateDatabase(); String fiscalYear = String.Concat("FY", YearDropDownList.SelectedValue); Session["FiscalYear"] = fiscalYear; updbs.CreateFiscalYear(fiscalYear); Response.Redirect("AddCHG.aspx"); }
protected void SubmitButton_Click(object sender, EventArgs e) { Alert.Visible = false; Error.Visible = false; String fiscalYear = (String)Session["FiscalYear"]; Utils utils = new Utils(); UpdateDatabase updtDB = new UpdateDatabase(); AssessmentRatesObject assessmentsRates = new AssessmentRatesObject(); TextBox tb = new TextBox(); tb = (TextBox)AssessmentRatesGridView.Rows[0].FindControl("UndergradRateTextBox"); String financialAidUndergradRate = String.Empty; if (tb.Text != "") { financialAidUndergradRate = (Double.Parse(tb.Text)/100).ToString(); } else { financialAidUndergradRate = tb.Text; } tb = (TextBox)AssessmentRatesGridView.Rows[0].FindControl("GradRateTextBox"); String financialAidGradRate = String.Empty; if (tb.Text != "") { financialAidGradRate = (Double.Parse(tb.Text) / 100).ToString(); } else { financialAidGradRate = tb.Text; } tb = (TextBox)AssessmentRatesGridView.Rows[1].FindControl("UndergradRateTextBox"); String plandFeeUndergradRate = String.Empty; if (tb.Text != "") { plandFeeUndergradRate = (Double.Parse(tb.Text) / 100).ToString(); } else { plandFeeUndergradRate = tb.Text; } tb = (TextBox)AssessmentRatesGridView.Rows[1].FindControl("GradRateTextBox"); String plandFeeGradRate = String.Empty; if (tb.Text != "") { plandFeeGradRate = (Double.Parse(tb.Text) / 100).ToString(); } else { plandFeeGradRate = tb.Text; } updtDB.UpdateAssessment(fiscalYear, "Undergraduate", "Financial Aid", financialAidUndergradRate); updtDB.UpdateAssessment(fiscalYear, "Graduate", "Financial Aid", financialAidGradRate); updtDB.UpdateAssessment(fiscalYear, "Undergraduate", "Pland Fund Fee", plandFeeUndergradRate); updtDB.UpdateAssessment(fiscalYear, "Graduate", "Pland Fund Fee", plandFeeGradRate); }
public void OpenFiscalYear1(String fiscalYear) { UpdateDatabase updbs = new UpdateDatabase(); updbs.CreateFiscalYear(fiscalYear); }
protected void SubmitCostDriverButton_Click(object sender, EventArgs e) { Alert.Visible = false; Error.Visible = false; DataTable costDriversTbl = (DataTable)Session["CostDriversTbl"]; TextBox tbox = new TextBox(); for (int row = 0; row < SubmitCostDriverGridView.Rows.Count; row++) { String fiscalYear = (String)Session["FiscalYear"]; UpdateDatabase updtDB = new UpdateDatabase(); 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; updtDB.InsertAllocatedCosts(fiscalYear, costDriver, metricType, rate, totalMetric, metrics, costToAllocate); } AddedCostDrivers(); }
protected void SaveButton_Click(object sender, EventArgs e) { Alert.Visible = false; Error.Visible = false; String fiscalYear = (String)Session["FiscalYear"]; Utils utils = new Utils(); UpdateDatabase updtDB = new UpdateDatabase(); RetrieveFromDB rtrv = new RetrieveFromDB(); Boolean val = utils.CheckFiscalYear("Expendutures", fiscalYear); TextBox tb = new TextBox(); ArrayList instractCompExpendures = new ArrayList(); ArrayList nonInstractCompExpendures = new ArrayList(); ArrayList nonCompExpendures = new ArrayList(); for (int row = 0; row < InstractionalCompensationGridView.Rows.Count; row++) { ExpendutersObject instractComp = new ExpendutersObject(); String expenseType = InstractionalCompensationGridView.Rows[row].Cells[0].Text; String accountNumber = InstractionalCompensationGridView.Rows[row].Cells[1].Text; tb = (TextBox)InstractionalCompensationGridView.Rows[row].FindControl("BudgetTextBox"); String budget = tb.Text; tb = (TextBox)InstractionalCompensationGridView.Rows[row].FindControl("FringeBenefitRateTextBox"); String fringeBenefitRate = String.Empty; if (tb.Text != "") { fringeBenefitRate = (double.Parse(tb.Text) / 100).ToString(); } else { fringeBenefitRate = tb.Text; } if (val != true) { updtDB.InsertCompensationExpenduters("Instractional", fiscalYear, expenseType, accountNumber, budget, fringeBenefitRate); } else { updtDB.UpdateCompensationExpenduters("Instractional", fiscalYear, expenseType, accountNumber, budget, fringeBenefitRate); } } for (int row = 0; row < NonInstractionalCompensationGridView.Rows.Count; row++) { String expenseType = NonInstractionalCompensationGridView.Rows[row].Cells[0].Text; String accountNumber = NonInstractionalCompensationGridView.Rows[row].Cells[1].Text; tb = (TextBox)NonInstractionalCompensationGridView.Rows[row].FindControl("BudgetTextBox"); String budget = tb.Text; tb = (TextBox)NonInstractionalCompensationGridView.Rows[row].FindControl("FringeBenefitRateTextBox"); String fringeBenefitRate = ""; if (tb.Text != "") { fringeBenefitRate = (double.Parse(tb.Text) / 100).ToString(); } else { fringeBenefitRate = tb.Text; } if (val != true) { updtDB.InsertCompensationExpenduters("NonInstractional", fiscalYear, expenseType, accountNumber, budget, fringeBenefitRate); } else { updtDB.UpdateCompensationExpenduters("NonInstractional", fiscalYear, expenseType, accountNumber, budget, fringeBenefitRate); } } for (int row = 0; row < NonCompensationGridView.Rows.Count; row++) { String expenseType = NonCompensationGridView.Rows[row].Cells[0].Text; String accountNumber = NonCompensationGridView.Rows[row].Cells[1].Text; tb = (TextBox)NonCompensationGridView.Rows[row].FindControl("BudgetTextBox"); String budget = tb.Text; if (val != true) { updtDB.InsertNonCompensationExpenduters(fiscalYear, expenseType, accountNumber, budget); } else { updtDB.UpdateNonCompensationExpenduters(fiscalYear, expenseType, accountNumber, budget); } } DisplayTotals(fiscalYear); }
protected void ReportApply_Click(object sender, EventArgs e) { UpdateDatabase updateDB1 = new UpdateDatabase(); updateDB1.DeleteExpendetures(); String fiscalYear = (String)Session["FiscalYear"]; DataSet result = Utils.getDataSetFromExcel(ReportFileUpload, Server); if (result != null) { foreach (DataRow row in result.Tables[0].Rows) { int account = 0; if (row[0].ToString() != String.Empty) { account = int.Parse(row[0].ToString().Substring(0, 4)); } if (account >= 6500 && account <= 6701) { UpdateDatabase updtDB = new UpdateDatabase(); String expenseType = row[0].ToString(); String budget = row[3].ToString(); updtDB.InsertCompensationExpenduters("NonInstractional", fiscalYear, expenseType, account.ToString(), budget, "0"); } } foreach (DataRow row in result.Tables[0].Rows) { int account = 0; if (row[0].ToString() != String.Empty) { account = int.Parse(row[0].ToString().Substring(0, 4)); } if (account >= 6001 && account < 6500) { UpdateDatabase updtDB = new UpdateDatabase(); String expenseType = row[0].ToString(); String budget = row[3].ToString(); updtDB.InsertCompensationExpenduters("Instractional", fiscalYear, expenseType, account.ToString(), budget, "0"); } } foreach (DataRow row in result.Tables[0].Rows) { int account = 0; if (row[0].ToString() != String.Empty) { account = int.Parse(row[0].ToString().Substring(0, 4)); } if (account >= 7001 && account != 7902) { UpdateDatabase updtDB = new UpdateDatabase(); String expenseType = row[0].ToString(); String budget = row[3].ToString(); updtDB.InsertNonCompensationExpenduters(fiscalYear, expenseType, account.ToString(), budget); } } } PopulateGridView(); }
public String CreateNewFiscalYear(String fiscalYear) { String message = String.Empty; RetrieveFromDB rtrv = new RetrieveFromDB(); UpdateDatabase updDB = new UpdateDatabase(); DataSet ds = rtrv.CheckCategoriesBeforeNewFiscalYear(fiscalYear); if (int.Parse(ds.Tables[0].Rows[4][1].ToString()) != 0) { message = "Fiscal year " + fiscalYear + " already exists."; } else if (int.Parse(ds.Tables[0].Rows[3][1].ToString()) != 0 & int.Parse(ds.Tables[0].Rows[2][1].ToString()) != 0 && int.Parse(ds.Tables[0].Rows[1][1].ToString()) != 0 && int.Parse(ds.Tables[0].Rows[0][1].ToString())!= 0 ) { message = "1"; updDB.UpdateNulls(fiscalYear); updDB.RevenueSummaryInsert(fiscalYear); } else { if (int.Parse(ds.Tables[0].Rows[3][1].ToString()) == 0) { message = "CHG"; } if (int.Parse(ds.Tables[0].Rows[1][1].ToString()) == 0) { if (message == String.Empty) { message = "Assessments"; } else { message = message + ", Assessments"; } } if (int.Parse(ds.Tables[0].Rows[2][1].ToString()) == 0) { if (message == String.Empty) { message = "Expendutries"; } else { message = message + ", Expendutries"; } } if (int.Parse(ds.Tables[0].Rows[0][1].ToString()) == 0) { if (message == String.Empty) { message = "Allocated Costs"; } else { message = message + ", Allocated Costs"; } } message = "Fiscal year " + fiscalYear + " has not been created. In order to create the fiscal year please submit " + message + "."; } return message; }
protected void SubmitButton_Click(object sender, EventArgs e) { int tagFlag = (int)Session["TagFlag"]; Alert.Visible = false; Error.Visible = false; String fiscalYear = (String)Session["FiscalYear"]; UpdateDatabase updtdbs = new UpdateDatabase(); TextBox tb = new TextBox(); ArrayList CHG = new ArrayList(); for (int row = 0; row < GrossCHGGridView.Rows.Count; row++) { CHGObject grossCHG = new CHGObject(); 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; CHG.Add(grossCHG); updtdbs.UpdateRevenue(fiscalYear, term, "Undergraduate", "Gross", undergradRate, undergradCHG); updtdbs.UpdateRevenue(fiscalYear, term, "Graduate", "Gross", gradRate, gradCHG); } for (int row = 0; row < NetCHGGridView.Rows.Count; row++) { CHGObject netCHG = new CHGObject(); 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; CHG.Add(netCHG); updtdbs.UpdateRevenue(fiscalYear, term, "Undergraduate", "Net", undergradRate, undergradCHG); updtdbs.UpdateRevenue(fiscalYear, term, "Graduate", "Net", gradRate, gradCHG); } for (int row = 0; row < ExportedCHGGridView.Rows.Count; row++) { CHGObject exportedCHG = new CHGObject(); 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; CHG.Add(exportedCHG); updtdbs.UpdateRevenue(fiscalYear, term, "Undergraduate", "Exported", undergradRate, undergradCHG); updtdbs.UpdateRevenue(fiscalYear, term, "Graduate", "Exported", gradRate, gradCHG); } DifferentialRevenueObject differentialRevenue = new DifferentialRevenueObject(); 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; CHG.Add(differentialRevenue); ArrayList fiscalYearData = (ArrayList)Session["FiscalYearData"]; updtdbs.InsertDifferentialRevenue(fiscalYear, "Undergraduate", differentialUndergradCHG, differentialUndergradRate); updtdbs.InsertDifferentialRevenue(fiscalYear, "Graduate", gradStudentsCHG, gradStudentsRate); if (tagFlag == 1) { PopulateCHGTotals("Gross"); } if (tagFlag == 2) { PopulateCHGTotals("Net"); } if (tagFlag == 3) { PopulateCHGTotals("Exported"); } if (tagFlag == 4) { PopulateDifferentialRevTotal(); } }