protected void Page_Load(object sender, EventArgs e) { // initial account setup Account initial_acct = new Account(); initial_acct.FirstName = "Ian"; initial_acct.LastName = "Santiago"; initial_acct.ContactNo = "09063290109"; initial_acct.Password = "******"; initial_acct.EmailAddress = "*****@*****.**"; // if the session is null // Session["list"] will be initialized // at the same time, the admin acct will // be added to that session if (Session["list"] == null) { Session["list"] = new AccountList(); aList = (AccountList)Session["list"]; aList.AddToAccounts(initial_acct); System.Diagnostics.Debug.WriteLine("session is null [login]"); } else { aList = (AccountList)Session["list"]; System.Diagnostics.Debug.WriteLine(aList.ToString()); } }
protected void Unnamed1_Click(object sender, EventArgs e) { if (Page.IsValid) { Account account = new Account(); account.FirstName = TbFirstName.Text; account.LastName = TbLastName.Text; account.Birthday = TbBirthday.Text.ToString(); account.ContactNo = TbContact.Text; account.EmailAddress = TbEmail.Text; account.Password = TbPassword.Text; account.Address = TbAddress.Text; acct_list.AddToAccounts(account); Session["list"] = acct_list; Response.Redirect("LoginForm.aspx"); } }