Exemplo n.º 1
0
 // continue order processing
 protected void processOrderButton_Click(object sender, EventArgs e)
 {
     string orderId = Request.QueryString["OrderID"];
     OrderProcessor processor = new OrderProcessor(orderId);
     processor.Process();
     PopulateControls(orderId);
 }
 // continue order processing
 protected void processOrderButton_Click(object sender, EventArgs e)
 {
     string orderId = Session["AdminOrderID"].ToString();
     OrderProcessor processor = new OrderProcessor(orderId);
     processor.Process();
     PopulateControls();
 }
Exemplo n.º 3
0
    protected void placeOrderButton_Click(object sender, EventArgs e)
    {
        // Store the total amount
        decimal amount = ShoppingCartAccess.GetTotalAmount();
        // Get shipping ID or default to 0
        int shippingId = 0;
        int.TryParse(shippingSelection.SelectedValue, out shippingId);

        // Get tax ID or default to "No tax"
        string shippingRegion =
          (HttpContext.Current.Profile as ProfileCommon).ShippingRegion;
        int taxId;
        switch (shippingRegion)
        {
          case "2":
        taxId = 1;
        break;
          default:
        taxId = 2;
        break;
        }

        // Create the order and store the order ID
        string orderId = ShoppingCartAccess.CreateCommerceLibOrder(shippingId, taxId);
        // Process order
        OrderProcessor processor = new OrderProcessor(orderId);
        processor.Process();
        // Redirect to the conformation page
        Response.Redirect("OrderPlaced.aspx");
    }
Exemplo n.º 4
0
    protected void processButton_Click(object sender, EventArgs e)
    {
        try
        {
          OrderProcessor processor = new OrderProcessor(orderIDBox.Text);
          processor.Process();
          CommerceLibOrderInfo orderInfo =
        CommerceLibAccess.GetOrder(orderIDBox.Text);
          processResultLabel.Text = "Order processed, status now: "
        + orderInfo.Status.ToString();
        }

        catch
        {
          CommerceLibOrderInfo orderInfo =
        CommerceLibAccess.GetOrder(orderIDBox.Text);
          processResultLabel.Text =
        "Order processing error, status now: "
        + orderInfo.Status.ToString();
        }
    }