/// <summary> /// Initialization of the upgrade purchase item panel. /// </summary> void Start() { // Set the icon of this item. transform.GetChild(ItemSpriteIndex).GetComponent <Image>().sprite = ItemIconSprite; // Set the name of this item. transform.GetChild(ItemNameTextIndex).GetComponent <Text>().text = ItemName; // Set the cost of this item. transform.GetChild(ItemCostTextIndex).GetComponent <Text>().text = ItemCost.ToString(); }
private void OnFormLoad(object sender, EventArgs e) { if (ExpenseItem?.Length > 0) { cboSelection.Text = ExpenseItem; txtCost.Text = ItemCost.ToString(); cboUnit.Text = Unit; txtUnitQuantity.Text = UnitQuantity.ToString(); } }
// 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); }