protected void Page_Load(object sender, EventArgs e) { if (Application["Prog5_CurrentUser"].ToString() == "") { Response.Redirect("Login.aspx"); } else { lblLoginName.Text = Application["Prog5_CurrentUser"].ToString(); btnLoginStatus.Text = "Logout"; } SQLDataClass.getAllProducts(); SQLCheckoutClass.getShoppingCartData(); if (!IsPostBack && (bool)Application["Prog2_Computed"]) { txtID.Text = (string)Application["Prog2_ProductID"]; txtQuantity.Text = (string)Application["Prog2_ProductQuantity"]; txtPrice.Text = (string)Application["Prog2_ProductPrice"]; CalculateTotals(); } txtID.Focus(); }
protected void Page_Load(object sender, EventArgs e) { SQLCheckoutClass.getShoppingCartData(); SQLCheckoutClass.DeleteShoppingCart(); // int temp = Convert.ToInt32(com.ExecuteScalar().ToString()); // if(temp == 1) // { // Response.Write("User already exists!"); // } // conn.Close(); ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None; }
protected void Page_Load(object sender, EventArgs e) { SQLCheckoutClass.getShoppingCartData(); if (Application["Prog5_CurrentUser"].ToString() == "") { Response.Redirect("Login.aspx"); } else { lblLoginName.Text = Application["Prog5_CurrentUser"].ToString(); btnLoginStatus.Text = "Logout"; } }
void Session_End(object sender, EventArgs e) { SQLCheckoutClass.getShoppingCartData(); SQLCheckoutClass.DeleteShoppingCart(); }
protected void btnAddCart_Click(object sender, EventArgs e) { btnAddCart.Enabled = false; SQLCheckoutClass.InsertProduct(txtID.Text, txtName.Text, Double.Parse(txtQuantity.Text), txtPrice.Text, txtGrandTotal.Text); }
protected void btnCheckout_Click(object sender, EventArgs e) { SQLCheckoutClass.DeleteShoppingCart(); Response.Redirect("Login.aspx"); Application["Prog5_CurrentUser"] = ""; }