예제 #1
0
        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();
        }
예제 #2
0
        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;
        }
예제 #3
0
 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";
     }
 }
예제 #4
0
 void Session_End(object sender, EventArgs e)
 {
     SQLCheckoutClass.getShoppingCartData();
     SQLCheckoutClass.DeleteShoppingCart();
 }
예제 #5
0
 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);
 }
예제 #6
0
 protected void btnCheckout_Click(object sender, EventArgs e)
 {
     SQLCheckoutClass.DeleteShoppingCart();
     Response.Redirect("Login.aspx");
     Application["Prog5_CurrentUser"] = "";
 }