示例#1
0
        public inventario buscar_item(int id_material)
        {
            ic = dm.GetinventarioCollection();
            inventario i = ic.FindByidmaterial(id_material);

            return(i);
        }
示例#2
0
        public void insertar_item(int id_material, int cantidad)
        {
            if (ic.FindByidmaterial(id_material) == null)
            {
                ic = dm.GetinventarioCollection();
                List <inventario> lp = ic.Cast <inventario>().ToList();
                int id;
                if (lp.Count == 0)
                {
                    id = 1;
                }
                else
                {
                    id = lp.Last().id + 1;
                }
                mhc = dm.Getmaterial_herramientaCollection();

                dm.Newinventario(id, id_material, cantidad, mhc.FindByid(id_material));
                dm.CommitAll();
            }
        }