override protected void Start() { Button = Button.GetComponent <Button> (); Score = Score.GetComponent <ScoreController> (); Createapple = Createapple.GetComponent <CreateApple> (); Text = Text.GetComponent <Text> (); Pricetag = Pricetag.GetComponent <Text> (); }
//Get all price tags information stored in memory private List<Pricetag> getPriceTagsFromMemory() { List<Pricetag> result = new List<Pricetag>(); string query = "SELECT PriceDisplay.priceDisplayId, " + "PriceDisplay.linkedProductBarcode, Product.name, Product.sellingPrice " + "FROM PriceDisplay, Product " + "WHERE PriceDisplay.linkedProductBarcode = Product.barcode " + "UNION SELECT priceDisplayId, " + "\"\" AS linkedProductBarcode, \"\" AS name, \"\" AS sellingPrice " + "FROM PriceDisplay " + "WHERE linkedProductBarcode IS NULL"; MySqlDataReader queryOutcome = _singletonConnection.queryResult(query); //If there is a connection if (queryOutcome != null) { //If price display info is found while (queryOutcome.Read()) { Pricetag display = new Pricetag( queryOutcome[0].ToString(), queryOutcome[1].ToString(), queryOutcome[2].ToString(), queryOutcome[3].ToString()); result.Add(display); _queuingPriceTags.Enqueue(display); } } else { } return result; }