protected void btn_checkout_Click(object sender, EventArgs e) { if (Session["currUser"] != null) { // Make the application give the user a new cart DBOps.ReassignUserCart(user, 0); } if (Request.Cookies["cartID"] != null) { HttpCookie myCookie = new HttpCookie("cartID"); myCookie.Expires = DateTime.Now.AddYears(-1); Response.Cookies.Add(myCookie); } // reset the session variables // Session.Abandon will erase everything. // Not everything has to be erased. // Too lazy to do conditionals. Session.Remove("prevID"); Session.Remove("refNum"); // empty the cart UserCart cart = UserCart.Instance; cart.Reset(); Response.Redirect("~/Confirm.aspx"); }
protected void Btn_SignUp_Click(object sender, EventArgs e) { if (Session["currUser"] != null) { #region Variable Reset Session.Abandon(); Session.RemoveAll(); UserCart cart = UserCart.Instance; cart.Reset(); #endregion Response.Redirect(@"~/Home.aspx"); } }
protected void CartDataSource_Updated(object sender, SqlDataSourceStatusEventArgs e) { // reset the session variables // Session.Abandon will erase everything. // Not everything has to be erased. // Too lazy to do conditionals. Session.Remove("prevID"); Session.Remove("refNum"); // empty the cart UserCart cart = UserCart.Instance; cart.Reset(); Response.Redirect("~/Confirm.aspx"); }