protected void btnClearItems_Click(object sender, EventArgs e)
 {
     bookItemList.Clear();
     order.TotalAmount  = 0;
     lblTotalPrice.Text = "0";
     displayList();
 }
 protected void btnEmpty_Click(object sender, EventArgs e)
 {
     if (cart.Count > 0)
     {
         cart.Clear();
         lstCart.Items.Clear();
     }
 }
Exemple #3
0
 protected void Empty_Click(object sender, EventArgs e)
 {
     if (cart.Count > 0)
     {
         cart.Clear();
         ListBox1.Items.Clear();
     }
 }
 protected void clearButton_Click(object sender, EventArgs e)
 {
     if (cart.Count > 0)
     {
         cart.Clear();
         cartList.Items.Clear();
     }
 }
 protected void EmptyList(object sender, EventArgs e)
 {
     if (cart.Count > 0)
     {
         cart.Clear();
         lstCart.Items.Clear();
     }
 }
Exemple #6
0
 protected void btnEmpty_Click1(object sender, EventArgs e)
 {
     // if cart has items, clear both cart and list control
     if (cart.Count > 0)
     {
         cart.Clear();
         lstDisplay.Items.Clear();
     }
 }
Exemple #7
0
 protected void btnEmpty_Click(object sender, EventArgs e)
 {
     //if cart has items, clear both cart and list control
     if (cart.Count > 0)
     {
         cart.Clear();
         lstCart.Items.Clear();
     }
     lblTotal.Text = "Your Cart Is Empty";
 }
Exemple #8
0
    protected void btnEmptyCart_Click(object sender, EventArgs e)
    {
        //clear cart and list
        if (cart.Count > 0)
        {
            cart.Clear();
            lstCart.Items.Clear();
        }

        DisplaySummary(cart);
    }
Exemple #9
0
 protected void btnEmpty_Click(object sender, EventArgs e)
 {
     cart = CartItemList.GetCart();
     if (cart.Count > 0)
     {
         cart.Clear();
         lstCart.Items.Clear();
     }
     Session["sessionCart"] = cart;
     this.DisplayCart();
     resetCartSize();
 }
Exemple #10
0
        protected void btnPayment_Click(object sender, EventArgs e)
        {
            IPaymentSystem paymentSystem = INFT3050PaymentFactory.Create();

            PaymentRequest payment = new PaymentRequest();

            payment.CardName    = txtCardName.Text;
            payment.CardNumber  = txtCardNumber.Text;
            payment.CVC         = Convert.ToInt32(txtCVC.Text);
            payment.Expiry      = DateTime.Parse(txtExpiryDate.Text);
            payment.Amount      = 200;
            payment.Description = "test";
            var task = paymentSystem.MakePayment(payment);

            if (task.IsCompleted)
            {
                //showTransactionResult(task.Result);
            }

            cart.Clear();
            Response.Redirect("Confirmation.aspx");
        }
    protected void btnPlaceOrder_Click(object sender, EventArgs e)
    {
        string signedInUser = HttpContext.Current.User.Identity.GetUserId();

        //if user is not null, do this
        if (signedInUser != null)
        {
            //get textbox details
            string shipTo     = txtShipTo.Text;
            string shiptoadd1 = txtShipAddr1.Text;
            string shiptoadd2 = txtShipAddr2.Text;
            string shipCity   = txtShipCity.Text;
            string shipSt     = txtShipState.Text;
            string shipZip    = txtShipZip.Text;
            string billAddr1  = txtBillAddr1.Text;
            string billAddr2  = txtBillAddr2.Text;
            string billcity   = txtBillCity.Text;
            string billstate  = txtBillState.Text;
            string billzip    = txtBillZip.Text;

            string card     = txtPymtNum.Text;
            string exp      = txtPymtExp.Text;
            string cvv      = txtPymtCVV.Text;
            string pymtName = txtPymtName.Text;

            //Save to Order object
            Order curOrder = new Order(cart, shipTo, shiptoadd1, shiptoadd2, shipCity, shipSt, shipZip, billAddr1, billAddr2, billcity,
                                       billstate, billzip, card, exp, cvv, pymtName, signedInUser);

            //calc rest of order details

            curOrder.Discount   = curOrder.CalculateDiscount();
            curOrder.Subtotal   = curOrder.CalculateSubtotal();
            curOrder.Tax        = curOrder.CalculateTax();
            curOrder.OrderTotal = curOrder.TotalOrder();


            try   //Place order
            {
                //save order to DB
                curOrder.SaveOrder(curOrder);

                // update stock on hand in DB -lg
                cart.UpdateStock(cart);


                Session["OrderIDReciept"] = curOrder.OrderID;

                //reset curOrder & clear listbox
                Order nextOrder = new Order();
                curOrder = nextOrder;
                cart.Clear();
                Response.Redirect("~/Cart/Confirmation.aspx", false);
            }
            catch (Exception ex)
            {
                Exception exc = Server.GetLastError();

                // Code that runs when an unhandled error occurs
                ErrorHandler handler = new ErrorHandler(exc);
                string       result  = handler.SendEmail();
                Response.Redirect("../ContactUs/ErrorPage.aspx?email=" + result);
            }
        }
        else
        {
            lblMessageCO.Text = "Please sign in first.";
        }
    }
 protected void btnClearItems_Click(object sender, EventArgs e)
 {
     bookItemList.Clear();
     displayList();
 }