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); }
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 ReportApply_Click(object sender, EventArgs e) { StoredProcedures sp = new StoredProcedures(); ExpendutersTotalsPanel.Visible = false; String fiscalYear = (String)Session["FiscalYear"]; DataSet result = Utils.getDataSetFromExcel(ReportFileUpload, Server); sp.DeleteExpendetures(fiscalYear); if (result != null) { foreach (DataRow row in result.Tables[0].Rows) { int account = 0; if (row[0].ToString() != String.Empty) { int.TryParse(row[0].ToString().Substring(0, 4), out account); } if (account >= 6500 && account <= 6701) { String expenseType = row[0].ToString(); double budget = double.Parse(row[3].ToString()); sp.UpdateCompensationExpenduters("NonInstractional", fiscalYear, expenseType, budget, 0); } } foreach (DataRow row in result.Tables[0].Rows) { int account = 0; if (row[0].ToString() != String.Empty) { int.TryParse(row[0].ToString().Substring(0, 4), out account); } if (account >= 6001 && account < 6500) { String expenseType = row[0].ToString(); double budget = double.Parse(row[3].ToString()); sp.UpdateCompensationExpenduters("Instractional", fiscalYear, expenseType, budget, 0); } } foreach (DataRow row in result.Tables[0].Rows) { int account = 0; if (row[0].ToString() != String.Empty) { int.TryParse(row[0].ToString().Substring(0, 4), out account); } if (account >= 7001 && account != 7902) { String expenseType = row[0].ToString(); double budget = double.Parse(row[3].ToString()); sp.UpdateNonCompensationExpenduters("NonCompensation", fiscalYear, expenseType, budget); } } } PopulateGridView(); }