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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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;
        }
Ejemplo n.º 6
0
 public static void addProduct(StockClass product)
 {
     stocklist.Add(product);
 }