Beispiel #1
0
        override protected void OnLoad(EventArgs e)
        {
            // Create an instance of the cart controller
            ProcessFlow.CartController cartController = new ProcessFlow.CartController();

            myCart = cartController.GetCart(true);

            if (!Page.IsPostBack)
            {
                // Get the itemdId from the query string
                string itemId = Request["itemId"];

                if (itemId != null)
                {
                    // Clean the input string
                    itemId = WebComponents.CleanString.InputText(itemId, 50);
                    myCart.Add(itemId);
                    cartController.StoreCart(myCart);
                }
            }

            //Get an account controller
            ProcessFlow.AccountController accountController = new ProcessFlow.AccountController();

            //Get the user's favourite category
            string favCategory = accountController.GetFavouriteCategory();

            //If we have a favourite category, render the favourites list
            if (favCategory != null)
            {
                favorites.Visible       = true;
                ViewState[KEY_CATEGORY] = favCategory;
            }

            Refresh();
        }
        protected override void OnLoad(EventArgs e)
        {
            // Create an instance of the cart controller
            ProcessFlow.CartController cartController = new ProcessFlow.CartController();

            myCart = cartController.GetCart(true);

            if (!Page.IsPostBack){

                // Get the itemdId from the query string
                string itemId = Request["itemId"];

                if (itemId != null){
                    // Clean the input string
                    itemId = WebComponents.CleanString.InputText(itemId, 50);
                    myCart.Add(itemId);
                    cartController.StoreCart(myCart);

                }
            }

            //Get an account controller
            ProcessFlow.AccountController accountController = new ProcessFlow.AccountController();

            //Get the user's favourite category
            string favCategory = accountController.GetFavouriteCategory();

            //If we have a favourite category, render the favourites list
            if (favCategory != null){
                favorites.Visible = true;
                ViewState[KEY_CATEGORY] = favCategory;
            }

            Refresh();
        }