Ejemplo n.º 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();
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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";
     }
 }
Ejemplo n.º 4
0
 void Session_End(object sender, EventArgs e)
 {
     SQLCheckoutClass.getShoppingCartData();
     SQLCheckoutClass.DeleteShoppingCart();
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 6
0
 protected void btnCheckout_Click(object sender, EventArgs e)
 {
     SQLCheckoutClass.DeleteShoppingCart();
     Response.Redirect("Login.aspx");
     Application["Prog5_CurrentUser"] = "";
 }