Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Get value of mode and product from when button is clicked to determine which button is clicked
            mode     = Request.QueryString["mode"];
            product  = Request.QueryString["product"];
            products = QueryClass.GetProductsIgnoreDelete();
            int productID = 0;

            try
            {
                productID = Convert.ToInt32(product);
            }
            catch { }
            if (mode != null && product != null)
            {
                if (mode.Equals("toggleDelete"))
                {
                    //Delete an item depending on product which acts as index pointer

                    //query for deleting
                    QueryClass.ToggleDeleteProduct(productID);
                    products = QueryClass.GetProductsIgnoreDelete();
                }

                //if (mode.Equals("UpdateItem"))
                //{
                //    //Open up update page sending the product value so the correct product can be determined
                //    Response.Redirect("Update?PassingValue=" + Server.UrlEncode(product));

                //}
            }
        }