Exemplo n.º 1
0
 public override string ToString()
 {
     return("PageNumber: " + PageNumber.ToString() + "\n" +
            "PageSize: " + PageSize.ToString() + "\n" +
            "TotalPages: " + TotalPages.ToString() + "\n" +
            "TotalRecords: " + TotalRecords.ToString() + "\n" +
            "NextPage: " + NextPage.ToString() + "\n" +
            "PreviousPage: " + PreviousPage.ToString() + "\n" +
            "Data: " + Data + "\n" +
            "Succeeded: " + Succeeded.ToString() + "\n" +
            "Errors: " + Errors.ToString() + "\n");
 }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (PreviousPage != null)
         {
             Session["PreviousPage"] = PreviousPage;
             if (PreviousPage.ToString().Equals("ASP.Orders_aspx"))
             {
                 ChangeVisible();
             }
         }
     }
     gvShowOwners.DataSourceID = "SqlDataSource1";
 }
Exemplo n.º 3
0
        private static double accountBalance; //holds value for current account balance

        protected void Page_Load(object sender, EventArgs e)
        {
            Session["accountBalance"] = accountBalance;
            List <Account> allAccounts = (List <Account>)Session["AllAccounts"];
            Customer       cust        = (Customer)Session["customer"];

            if (PreviousPage != null)
            {
                string url = PreviousPage.ToString();

                if (url.Contains("summary"))
                {
                    updateBalance(); //update balance when details are listed

                    int selectedIndex = ((ListBox)PreviousPage.FindControl("AccountListBox")).SelectedIndex;
                    //Find the details of the account selected
                    Account selectedAccount = allAccounts[selectedIndex];

                    AccountNameLabel.Text = selectedAccount.Nickname;
                    Session["name"]       = selectedAccount.Nickname;

                    AcctTypeLabel.Text = selectedAccount.Type;
                    Session["type"]    = selectedAccount.Type;

                    BalanceLabel.Text = selectedAccount.Balance.ToString();

                    LoanLabel.Text = selectedAccount.hasLoanOffer().ToString();

                    AddressLabel.Text = cust.FullAddress;
                    Session["addr"]   = cust.FullAddress;

                    accountBalance = selectedAccount.Balance;

                    if (accountBalance > 15000)
                    {
                        LoanLabel.Text  = "True";
                        Session["loan"] = "True";
                    }
                    else
                    {
                        LoanLabel.Text  = "False";
                        Session["loan"] = "False";
                    }
                }
                else if (url.Contains("loan")) //came from loan page
                {
                    LoanLabel.Text = "Came from loan";

                    double accountBalance = (double)(Session["accountBalance"]);
                    BalanceLabel.Text = accountBalance.ToString("C2");

                    string name = (String)(Session["name"]);
                    string type = (String)(Session["type"]);
                    string loan = (String)(Session["loan"]);
                    string addr = (String)(Session["addr"]);

                    AccountNameLabel.Text = name;
                    AcctTypeLabel.Text    = type;
                    LoanLabel.Text        = loan;
                    AddressLabel.Text     = addr;
                }
                // WithdrawMoneyBtn_Click(sender, e);
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["currentAccountBal"] = currentAccountBal;
            if (PreviousPage != null)
            {
                string url = PreviousPage.ToString();

                if (url.Contains("summary")) //came from account summary page
                {
                    updateBalance();
                    ListBox listbox = (ListBox)PreviousPage.FindControl("accountListBox");
                    int     index   = listbox.SelectedIndex;

                    List <Account> account  = (List <Account>)Session["account"];
                    Customer       customer = (Customer)Session["customer"];

                    AccountNameLabel.Text = account[index].NickName;
                    Session["name"]       = account[index].NickName;

                    AcctTypeLabel.Text = account[index].Type;
                    Session["type"]    = account[index].NickName;

                    currentAccountBal = account[index].Balance;


                    double newcurrentAccountBal = (double)(Session["currentAccountBal"]);
                    BalanceLabel.Text = newcurrentAccountBal.ToString("c");

                    if (currentAccountBal > 0)
                    {
                        LoanLabel.Text  = "True";
                        Session["loan"] = "True";
                    }
                    else
                    {
                        LoanLabel.Text  = "False";
                        Session["loan"] = "False";
                    }
                    AddressLabel.Text = customer.FullAddress;
                    Session["addr"]   = customer.FullAddress;
                }
                else if (url.Contains("loan")) //came from loan page
                {
                    LoanLabel.Text = "came from loan";

                    double newcurrentAccountBal = (double)(Session["currentAccountBal"]);
                    BalanceLabel.Text = newcurrentAccountBal.ToString("c");


                    string name    = (String)(Session["name"]);
                    string type    = (String)(Session["type"]);
                    string loan    = (String)(Session["loan"]);
                    string address = (String)(Session["address"]);

                    AccountNameLabel.Text = name;
                    AcctTypeLabel.Text    = type;
                    LoanLabel.Text        = loan;
                    AddressLabel.Text     = address;
                }
                withdrawButton_Click(sender, e);
            }
        }