コード例 #1
0
        protected void ContinueClicked(object sender, ImageClickEventArgs e)
        {
            if (Page.IsValid)
            {
                // Create a new cartController object
                ProcessFlow.CartController cartController = new ProcessFlow.CartController();

                // Fetch the creditcard info and store it
                string cardType   = WebComponents.CleanString.InputText(listCardType.SelectedItem.Text, 10);
                string cardNumber = WebComponents.CleanString.InputText(txtCardNumber.Text, 20);;
                string cardYear   = WebComponents.CleanString.InputText(listYear.SelectedItem.Text, 4);;
                string cardMonth  = WebComponents.CleanString.InputText(listMonth.SelectedItem.Text, 2);;

                CreditCardInfo creditCard = new CreditCardInfo(cardType, cardNumber, string.Format(FORMAT_EXPIRATION, cardMonth, cardYear));

                cartController.StoreCreditCard(creditCard);

                AddressInfo billingAddress = billAddr.Address;

                // Now store the billing information
                cartController.StoreBillingAddress(billAddr.Address);

                // Continue with the order process
                cartController.ContinueOrder(chkShipBilling.Checked);

                enterAddress.Visible   = false;
                confirmAddress.Visible = true;

                staticAddressBilling.ShowAddress(billingAddress);
                staticAddressShipping.ShowAddress(billingAddress);
            }
        }
コード例 #2
0
        protected void ContinueClicked(object sender, ImageClickEventArgs e)
        {
            if (Page.IsValid) {

                // Create a new cartController object
                ProcessFlow.CartController cartController = new ProcessFlow.CartController();

                // Fetch the creditcard info and store it
                string cardType = WebComponents.CleanString.InputText(listCardType.SelectedItem.Text, 10);
                string cardNumber = WebComponents.CleanString.InputText(txtCardNumber.Text, 20);;
                string cardYear = WebComponents.CleanString.InputText(listYear.SelectedItem.Text, 4);;
                string cardMonth = WebComponents.CleanString.InputText(listMonth.SelectedItem.Text, 2);;

                CreditCardInfo creditCard = new CreditCardInfo(cardType, cardNumber, string.Format(FORMAT_EXPIRATION, cardMonth, cardYear));

                cartController.StoreCreditCard(creditCard);

                AddressInfo billingAddress = billAddr.Address;

                // Now store the billing information
                cartController.StoreBillingAddress(billAddr.Address);

                // Continue with the order process
                cartController.ContinueOrder(chkShipBilling.Checked);

                enterAddress.Visible = false;
                confirmAddress.Visible = true;

                staticAddressBilling.ShowAddress(billingAddress);
                staticAddressShipping.ShowAddress(billingAddress);
            }
        }
コード例 #3
0
ファイル: Checkout.aspx.cs プロジェクト: suchangbowen/PetShop
        override protected void OnLoad(EventArgs e)
        {
            // Create an instance of the cart controller
            ProcessFlow.CartController cartController = new ProcessFlow.CartController();
            // Fetch the cart state from the controller
            myCart = cartController.GetCart(false);

            // If there is something in the cart then show the continue button
            link.Visible = myCart.Count > 0;
        }
コード例 #4
0
ファイル: Checkout.aspx.cs プロジェクト: GreatQiuWei/PetShop
        protected override void OnLoad(EventArgs e)
        {
            // Create an instance of the cart controller
            ProcessFlow.CartController cartController = new ProcessFlow.CartController();
            // Fetch the cart state from the controller
            myCart = cartController.GetCart(false);

            // If there is something in the cart then show the continue button
            link.Visible = myCart.Count > 0;
        }
コード例 #5
0
        protected void ContinueClicked(object sender, ImageClickEventArgs e)
        {
            if (Page.IsValid){
                ProcessFlow.CartController cartController = new ProcessFlow.CartController();

                AddressInfo shippingAddress = shipAddr.Address;

                cartController.SetAlternateShippingAddress( shippingAddress );

                AddressInfo billingAddress = cartController.GetBillingAddress();

                enterShipAddress.Visible = false;
                confirmAddress.Visible = true;

                staticAddressBilling.ShowAddress(billingAddress);
                staticAddressShipping.ShowAddress(shippingAddress);
            }
        }
コード例 #6
0
        protected void ContinueClicked(object sender, ImageClickEventArgs e)
        {
            if (Page.IsValid)
            {
                ProcessFlow.CartController cartController = new ProcessFlow.CartController();

                AddressInfo shippingAddress = shipAddr.Address;

                cartController.SetAlternateShippingAddress(shippingAddress);

                AddressInfo billingAddress = cartController.GetBillingAddress();

                enterShipAddress.Visible = false;
                confirmAddress.Visible   = true;

                staticAddressBilling.ShowAddress(billingAddress);
                staticAddressShipping.ShowAddress(shippingAddress);
            }
        }
コード例 #7
0
        protected override void OnLoad(EventArgs e)
        {
            ProcessFlow.CartController cartController = new ProcessFlow.CartController();

            OrderInfo newOrder = cartController.PurchaseCart();

            //Display the order info to the user
            lblOrderId.Text = newOrder.OrderId.ToString();
            lblOrderDate.Text = newOrder.Date.ToLongDateString();;
            lblUserId.Text = newOrder.UserId;
            lblCardType.Text = newOrder.CreditCard.CardType;
            lblCardNumber.Text = newOrder.CreditCard.CardNumber;
            lblCardExpiration.Text = newOrder.CreditCard.CardExpiration;

            statAddrBill.address = newOrder.BillingAddress;
            statAddrShip.address = newOrder.ShippingAddress;

            cart.DataSource = newOrder.LineItems;
            cart.DataBind();

            lblOrderTotal.Text = newOrder.OrderTotal.ToString("c");
        }
コード例 #8
0
		override protected void OnLoad(EventArgs e) {

			ProcessFlow.CartController cartController = new ProcessFlow.CartController();

			OrderInfo newOrder = cartController.PurchaseCart();

			//Display the order info to the user
			lblOrderId.Text = newOrder.OrderId.ToString();
			lblOrderDate.Text = newOrder.Date.ToLongDateString();;
			lblUserId.Text = newOrder.UserId;
			lblCardType.Text = newOrder.CreditCard.CardType;
			lblCardNumber.Text = newOrder.CreditCard.CardNumber;
			lblCardExpiration.Text = newOrder.CreditCard.CardExpiration;
			
			statAddrBill.address = newOrder.BillingAddress;
			statAddrShip.address = newOrder.ShippingAddress;
			
			cart.DataSource = newOrder.LineItems;
			cart.DataBind();

			lblOrderTotal.Text = newOrder.OrderTotal.ToString("c");
		}
コード例 #9
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();
        }
コード例 #10
0
        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();
        }