Exemple #1
0
        public inventoryItem findByID(string search)
        {
            inventoryItem result = null;

            for (int i = 0; i < theList.Count(); i++)
            {
                //does this product have the same id as id?
                if (theList[i].id.Equals(search))
                {
                    result = theList[i];
                    return(result);
                }
            }
            return(null);
        }
Exemple #2
0
        public inventoryItem findByModel(string search)
        {
            inventoryItem result = null;

            for (int i = 0; i < theList.Count(); i++)
            {
                if (theList[i].model.Equals(search))
                {
                    result = theList[i];
                    return(result);
                }
            }


            return(result);
        }
Exemple #3
0
        public Form1()
        {
            InitializeComponent();

            this.AutoSize     = true;
            this.AutoSizeMode = AutoSizeMode.GrowAndShrink;



            sr = new System.IO.StreamReader("inventoryManager.txt");

            while (!sr.EndOfStream)
            {
                string   line     = sr.ReadLine();
                string[] fileLine = line.Split(',');

                inventoryItem fileItem = new inventoryItem(fileLine[0], fileLine[1], int.Parse(fileLine[2]), fileLine[3], fileLine[4], double.Parse(fileLine[5]));

                itemList.Add(fileItem);
            }
            sr.Close();
        }
Exemple #4
0
 public void restock(inventoryItem item, int restock)
 {
     item.stock = restock;
 }