Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e) //Button to enter the Order ID for Record Display
        {
            int    ID  = Convert.ToInt32(txtEnterID.Text);     //Converts the string in the text box into integer datatype
            Orders who = new Orders();                         //Object declaration


            who = DataLayer.OrdersDB.GetOrdersDB(Convert.ToString(ID));      //Object path
            // Data elements to be displayed in labels
            lblOrderID.Text      = who.OrderID.ToString();
            lblCustomerID.Text   = who.CustomerID.ToString();
            lblOrderDate.Text    = Convert.ToDateTime(who.OrderDate).ToString();
            lblRequiredDate.Text = Convert.ToDateTime(who.RequiredDate).ToString();
            lblShippedDate.Text  = Convert.ToDateTime(who.ShippedDate).ToString();

            // Trial 1:  Calculating the Order Total from the data in the Order Details Table
            OrderDetails Total = new OrderDetails();

            Total = DataLayer.OrderDetailsDB.GetOrderDetailsDB(Convert.ToString(ID));
            Double D = Convert.ToDouble(Total.Discount);
            Double Q = Convert.ToDouble(Total.Quantity);
            Double P = Convert.ToDouble(Total.UnitPrice);
            Double OrderTotal;

            OrderTotal = P * (1 - D) * Q;
            // Displaying the Order Total
            lblOrderTotal.Text = OrderTotal.ToString();
        }
Ejemplo n.º 2
0
 public string TotalAmountPaid()
 {
     if (IsPaid)
     {
         return(OrderTotal.ToString());
     }
     else
     {
         return("0");
     }
 }
Ejemplo n.º 3
0
        public override string ToString()
        {
            StringBuilder result = new StringBuilder();

            if (IsSetAmazonOrderId())
            {
                result.Append("Order ID: ");
                result.AppendLine(AmazonOrderId);
            }
            if (IsSetFulfillmentChannel())
            {
                result.Append("FulfillmentChannel:");
                result.AppendLine(FulfillmentChannel.ToString());
            }
            if (IsSetNumberOfItemsShipped())
            {
                result.Append("Number of Items Shipped: ");
                result.AppendLine(NumberOfItemsShipped.ToString());
            }
            if (IsSetNumberOfItemsUnshipped())
            {
                result.Append("Number of Items Not Shipped: ");
                result.AppendLine(NumberOfItemsShipped.ToString());
            }
            if (IsSetLastUpdateDate())
            {
                result.Append("Last Update Date: ");
                result.AppendLine(LastUpdateDate.ToString());
            }
            if (IsSetOrderChannel())
            {
                result.Append("Order Channel: ");
                result.AppendLine(OrderChannel);
            }
            if (IsSetOrderStatus())
            {
                result.Append("Order Status: ");
                result.AppendLine(OrderStatus.ToString());
            }
            if (IsSetOrderTotal())
            {
                result.Append("Order Total: ");
                result.AppendLine(OrderTotal.ToString());
            }
            if (IsSetPurchaseDate())
            {
                result.Append("Purchase Date: ");
                result.AppendLine(PurchaseDate.ToString());
            }
            if (IsSetSalesChannel())
            {
                result.Append("Sales Channel: ");
                result.AppendLine(SalesChannel);
            }
            if (IsSetSellerOrderId())
            {
                result.Append("Seller Order Id: ");
                result.AppendLine(SellerOrderId);
            }
            if (IsSetShipServiceLevel())
            {
                result.Append("Ship Service Level: ");
                result.AppendLine(ShipServiceLevel);
            }
            if (IsSetPaymentExecutionDetail())
            {
                result.Append("Payment Execution Detail: ");
                result.Append(PaymentExecutionDetail);
            }
            if (IsSetPaymentMethod())
            {
                result.Append("Payment Method: ");
                result.Append(PaymentMethod);
            }
            if (IsSetMarketplaceId())
            {
                result.Append("Marketplace Id: ");
                result.AppendLine(MarketplaceId);
            }
            if (IsSetBuyerEmail())
            {
                result.Append("Buyer Email: ");
                result.AppendLine(BuyerEmail);
            }
            if (IsSetShipServiceLevel())
            {
                result.Append("Buyer Name: ");
                result.AppendLine(BuyerName);
            }
            if (IsSetShipmentServiceLevelCategory())
            {
                result.Append("Shipment Service Level Category: ");
                result.AppendLine(ShipmentServiceLevelCategory);
            }
            if (IsSetCbaDisplayableShippingLabel())
            {
                result.Append("CbaDisplayableShippingLabel: ");
                result.AppendLine(this.CbaDisplayableShippingLabel);
            }
            if (IsSetOrderType())
            {
                result.Append("OrderType: ");
                result.AppendLine(this.OrderType);
            }
            if (IsSetEarliestShipDate())
            {
                result.Append("EarliestShipDate: ");
                result.AppendLine(this.EarliestShipDate.ToString());
            }
            if (IsSetLatestShipDate())
            {
                result.Append("LatestShipDate: ");
                result.AppendLine(this.LatestShipDate.ToString());
            }
            return(result.ToString());
        }