Exemplo n.º 1
0
        protected void btnRemove_Click(object sender, EventArgs e)
        {
            var button = (HtmlButton)sender;
            var index  = int.Parse(button.Attributes["index"]);
            var item   = helper.GetAllProducts(basket)[index];

            helper.RemoveProduct(basket, item);
            var url = WebUtil.GetRawUrl();

            Response.Redirect(url);
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var helper = new BasketHelper();

            rptOrderHistory.DataSource = helper.GetAllPurchasedProducts();
            rptOrderHistory.DataBind();

            rptCurrentOrders.DataSource = helper.GetAllProducts();
            rptCurrentOrders.DataBind();
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            helper = new BasketHelper();
            // Get basket based on tracker id
            basket = helper.GetBasket();

            if (basket != null)
            {
                rptProducts.DataSource = helper.GetAllProducts(basket);
                rptProducts.DataBind();
            }
        }
Exemplo n.º 4
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            foreach (var product in helper.GetAllProducts())
            {
                using (new SecurityDisabler())
                {
                    product.Editing.BeginEdit();

                    product["Purchased"] = "1";

                    product.Editing.EndEdit();
                }
            }

            var url = Sitecore.Web.WebUtil.GetRawUrl();

            Response.Redirect(url + "?ordered=1&sc_trk={56D2D745-FEF2-4918-B23E-8C3EDF739916}");
        }