private void ShowAccountBalance() { string PegasusAccount = Session["CustomerPegasusAccount"].ToString(); Label msg = (Label)Master.FindControl("lblPegasusAccountBal"); msg.Visible = true; Datapay pay = new Datapay(); DataTable dtable = pay.GetVendorPegPayBalance(PegasusAccount); if (dtable.Rows.Count > 0) { double AccBal = Convert.ToDouble(dtable.Rows[0]["AccountBalance"].ToString()); msg.Text = AccBal.ToString("#,##0"); } }
protected void Page_Load(object sender, EventArgs e) { try { if ((Session["FullName"] == null)) { Response.Redirect("Default.aspx"); } lblUserId.Text = Session["FullName"].ToString(); string AreaDesc = ""; string Area = Session["AreaName"].ToString(); string Branch = Session["DistrictName"].ToString(); if (Branch.Equals("NONE")) { AreaDesc = Area; } else { AreaDesc = Area + " - " + Branch; } lblArea.Text = AreaDesc; lblRole.Text = Session["RoleName"].ToString(); //lblPegasusAccountBal.Text= //ShowAccountBalance(); string PegasusAccount = Session["CustomerPegasusAccount"].ToString(); Datapay pay = new Datapay(); DataTable dtable = pay.GetVendorPegPayBalance(PegasusAccount); if (dtable.Rows.Count > 0) { double AccBal = Convert.ToDouble(dtable.Rows[0]["AccountBalance"].ToString()); lblPegasusAccountBal.Text = AccBal.ToString("#,##0"); } else { lblPegasusAccountBal.Text = "."; } } catch (NullReferenceException exe) { Response.Redirect("Default.aspx?login=1", false); } catch (Exception ex) { lblmsg.Text = ex.Message; } }