Ejemplo n.º 1
0
        // My equivalent of a ToString method.  This will return a string list with each string in the list
        // containing one of the inventory item's attributes, to be used to display an inventory item into
        // a textbox, etc.
        public List <string> ToItemDescription()
        {
            List <string> itemDescription = new List <string>();

            itemDescription.Add("Name: " + CatalogItem.ItemName);
            itemDescription.Add("Vendor: " + CatalogItem.Manufacturer);
            itemDescription.Add("Price: " + CatalogItem.ItemRetailPrice.ToString("C"));
            itemDescription.Add("Inscription Type: " + CatalogItem.InscriptionType.ToString());
            itemDescription.Add("Quantity: " + QuantityOrdered.ToString());

            return(itemDescription);
        }
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OrderNumber?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (WrittenDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (NotBeforeDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (QuantityOrdered?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ReceiveDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (QuantityReceived?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Caller?.GetHashCode() ?? 0);
            return(hashCode);
        }
Ejemplo n.º 3
0
        public override string ToString()
        {
            StringBuilder result = new StringBuilder();

            if (IsSetTitle())
            {
                result.Append("Title: ");
                result.AppendLine(Title);
            }
            if (IsSetASIN())
            {
                result.Append("ASIN: ");
                result.AppendLine(ASIN);
            }
            if (IsSetSellerSKU())
            {
                result.Append("SKU: ");
                result.AppendLine(SellerSKU);
            }
            if (IsSetItemPrice())
            {
                result.Append("Price: ");
                result.AppendLine(ItemPrice.ToString());
            }
            if (IsSetItemTax())
            {
                result.Append("Item Tax: ");
                result.AppendLine(ItemTax.ToString());
            }
            if (IsSetPromotionDiscount())
            {
                result.Append("Promotions Discount: ");
                result.AppendLine(PromotionDiscount.ToString());
            }
            if (IsSetPromotionIds())
            {
                if (PromotionIds.PromotionId != null)
                {
                    foreach (string promotionId in PromotionIds.PromotionId)
                    {
                        result.Append("\tPromotion Id: ");
                        result.AppendLine(promotionId);
                    }
                }
            }
            if (IsSetShippingDiscount())
            {
                result.Append("Shipping Discount: ");
                result.AppendLine(ShippingDiscount.ToString());
            }
            if (IsSetQuantityOrdered())
            {
                result.Append("Quantity: ");
                result.AppendLine(QuantityOrdered.ToString());
            }
            if (IsSetQuantityShipped())
            {
                result.Append("Quantity Shipped: ");
                result.AppendLine(QuantityShipped.ToString());
            }
            if (IsSetCODFee())
            {
                result.Append("COD Fee: ");
                result.AppendLine(CODFee.ToString());
            }
            if (IsSetCODFeeDiscount())
            {
                result.Append("COD Fee Discount: ");
                result.AppendLine(CODFeeDiscount.ToString());
            }
            if (IsSetGiftMessageText())
            {
                result.Append("Gift Message Text: ");
                result.AppendLine(GiftMessageText);
            }
            if (IsSetGiftWrapPrice())
            {
                result.Append("Gift Wrap Price: ");
                result.AppendLine(GiftWrapPrice.ToString());
            }
            if (IsSetGiftWrapLevel())
            {
                result.Append("Gift Wrap Level: ");
                result.AppendLine(GiftWrapLevel.ToString());
            }
            return(result.ToString());
        }