protected void Page_Load(object sender, EventArgs e) { try { //Gets Tenant and displays to lblTenant TenantID = int.Parse(Request.QueryString["ID"].ToString()); EmployeeID = int.Parse(Session["EmployeeID"].ToString()); string strGetTenant = "SELECT LName + ', ' + FName + ' ' + MName + ' (' + CONVERT(nvarchar(7), TenantID) + ')' AS 'FullName' FROM Tenants WHERE TenantID=@TID"; SqlParameter[] TID = { new SqlParameter("@TID", TenantID) }; lblTenant.Text = DataAccess.ReturnData(strGetTenant, TID, ConnString, "FullName"); if (!IsPostBack) { SqlParameter[] TIDParam = { new SqlParameter("@TenantID", TenantID) }; string strSelect = "SELECT TOP 1 BillID FROM Bills WHERE ((TenantID = @TenantID) AND (IsFinalized = 1)) ORDER BY DateGenerated DESC"; ChosenBillID = DataAccess.ReturnData(strSelect, TIDParam, ConnString, "BillID"); lblPayAmt.Text = "Php " + AcctFunctions.GetBalance(TenantID).ToString(); rebindReportViewer(ChosenBillID); } //else //{ // rebindReportViewer(ChosenBillID); //} } catch (Exception ex) { Response.Write(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { TenantID = int.Parse(Request.QueryString["TID"].ToString()); BillID = int.Parse(Request.QueryString["BID"].ToString()); UnpaidBal = AcctFunctions.GetBalance(TenantID); SetDefaultItems(); }
protected void btnRecPayment_Click(object sender, EventArgs e) { int NewBillID = AcctFunctions.MarkBillAsPaid(int.Parse(DDLBillPeriod.SelectedValue), AntiXSSMethods.CleanString(txtPayRemarks.Text)); AcctFunctions.ClearPreviousBills(TenantID); Response.Redirect("Receipt.aspx?ID=" + NewBillID.ToString()); }
//Gets the total of the total amout per unpaid bill public string GetBalance(int _TenantID) { return("Php " + AcctFunctions.GetBalance(_TenantID).ToString()); }