public void add(string name, string type, string formula, int price, int quantity, DateTime exp)
        {
            StockClass st = new StockClass();

            st.ItemName     = name;
            st.ItemType     = type;
            st.ItemFormula  = formula;
            st.ItemPrice    = price;
            st.ItemQuantity = quantity;
            st.ItemDate     = exp;
            StockDL.stocklist.Add(st);
        }
        public static List <StockClass> searchByFormula(string formula)
        {
            List <StockClass> formulalist = new List <StockClass>();
            StockClass        s           = new StockClass();

            s.ItemFormula = formula;
            foreach (StockClass l in stocklist)
            {
                if (l.ItemFormula == s.ItemFormula)
                {
                    formulalist.Add(l);
                }
            }
            return(formulalist);
        }
        public static List <StockClass> searchByType(string type)
        {
            List <StockClass> typelist = new List <StockClass>();
            StockClass        s        = new StockClass();

            s.ItemType = type;
            foreach (StockClass l in stocklist)
            {
                if (l.ItemType == s.ItemType)
                {
                    typelist.Add(l);
                }
            }
            return(typelist);
        }
        public static List <StockClass> searchByName(string name)
        {
            List <StockClass> namelist = new List <StockClass>();
            StockClass        s        = new StockClass();

            s.ItemName = name;
            foreach (StockClass l in stocklist)
            {
                if (l.ItemName == s.ItemName)
                {
                    namelist.Add(l);
                }
            }
            return(namelist);
        }
        public void undoupdateStock(string name, string type, int quantity)
        {
            int sel = 0;

            foreach (StockClass s in stocklist)
            {
                if (s.ItemName == name && s.ItemType == type)
                {
                    sel = StockDL.stocklist.IndexOf(s);
                    break;
                }
            }
            StockClass up = new StockClass();

            up = stocklist.ElementAt(sel);
            up.ItemQuantity = up.ItemQuantity + quantity;
        }
 public static void addProduct(StockClass product)
 {
     stocklist.Add(product);
 }