// constructor for loading an EXISTING Inventory Item - This constructor DOES NOT create a new GUID public InventoryItem(Guid inventoryItemId, InventoryItemStatus inventoryItemStatus, string inventoryItemName, int numberInStock, Guid catalogItemId, string itemManufacturer, int numberInscriptionLines, int numberLineCharacters, decimal itemCost, decimal itemRetailPrice, InscriptionType inscriptionType) : base(catalogItemId) { _inventoryItemId = inventoryItemId; InventoryItemStatus _inventoryItemStatus = inventoryItemStatus; base.ItemName = inventoryItemName; base.CatalogItemId = catalogItemId; base.Manufacturer = itemManufacturer; base.NumberInscriptionLines = numberInscriptionLines; base.NumberLineCharacters = numberLineCharacters; base.ItemCost = itemCost; base.ItemRetailPrice = itemRetailPrice; base.InscriptionType = inscriptionType; }
// 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("Catalog Item ID: " + CatalogItemId.ToString()); itemDescription.Add("Item Name: " + ItemName); itemDescription.Add("Number In Stock: " + NumberInStock.ToString()); itemDescription.Add("Item Manufacturer: " + Manufacturer); itemDescription.Add("Number of Inscription Lines: " + NumberInscriptionLines.ToString()); itemDescription.Add("Characters Per Line: " + NumberLineCharacters.ToString()); itemDescription.Add("Item Cost: " + ItemCost.ToString("C")); itemDescription.Add("Retail Price: " + ItemRetailPrice.ToString("C")); itemDescription.Add("Inscription Type: " + InscriptionType.ToString()); return(itemDescription); }