Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void Shutdown_Click(object sender, EventArgs e)
- {
- //retrieving bank from the session
- Bank BankSys1 = (Bank)Session["Bank"];
- string pin = (string)Session["pin"];
- //for each loop to insert all Customers accounts in the customers accounts dictionary into the database
- DAL = new DAL2();
- //loop through each each customer
- foreach (KeyValuePair<string, Customer> kvp in BankSys1.getcustomerData())
- {
- c = kvp.Value;
- //loop through cust account
- foreach (KeyValuePair<string, Account> kvp1 in c.getAccounts())
- {
- //run update acc from the DAL
- DAL.updateAccountData(kvp1.Value);
- }
- }
- //setting the session variables to null due to system shutdown
- Session["Bank"] = null;
- Session["pin"] = null;
- Session["login"] = null;
- //Abandoning session and redirecting user the index
- Session.Abandon();
- Response.Redirect("..\\Index.aspx");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement