Advertisement
Guest User

shutdown mdr

a guest
Jun 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. protected void Shutdown_Click(object sender, EventArgs e)
  2. {
  3. //retrieving bank from the session
  4. Bank BankSys1 = (Bank)Session["Bank"];
  5. string pin = (string)Session["pin"];
  6.  
  7. //for each loop to insert all Customers accounts in the customers accounts dictionary into the database
  8.  
  9. DAL = new DAL2();
  10.  
  11. //loop through each each customer
  12. foreach (KeyValuePair<string, Customer> kvp in BankSys1.getcustomerData())
  13. {
  14. c = kvp.Value;
  15. //loop through cust account
  16. foreach (KeyValuePair<string, Account> kvp1 in c.getAccounts())
  17. {
  18. //run update acc from the DAL
  19. DAL.updateAccountData(kvp1.Value);
  20.  
  21. }
  22. }
  23. //setting the session variables to null due to system shutdown
  24. Session["Bank"] = null;
  25. Session["pin"] = null;
  26. Session["login"] = null;
  27.  
  28. //Abandoning session and redirecting user the index
  29. Session.Abandon();
  30. Response.Redirect("..\\Index.aspx");
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement