Beispiel #1
0
        protected void AddtoCart_Click(object sender, EventArgs e)
        {
            string updID = Request.QueryString["id"];

            newID = int.Parse(updID);
            User   us       = (User)Session["user"];
            string errorMsg = "";

            lblNotif.Visible = true;
            try
            {
                int  quantity = Int32.Parse(Quantity.Text.ToString());
                bool success  = AddtoCartController.validateInput(us.UserID, newID, quantity, out errorMsg);
                if (!success)
                {
                    lblNotif.Text = errorMsg;
                }
                else
                {
                    Response.Redirect("ViewCart.aspx");
                }
            }
            catch
            {
                lblNotif.Text = "Must be numeric";
            }
        }