Пример #1
0
        public static Ctrl_articulos ClaseActiva()
        {
            if (Control == null)
            {
                Control = new Ctrl_articulos();
                Control.CargarVigentes();
                Control.CargarNoVigentes();
            }

            return(Control);
        }
Пример #2
0
        public void CargarItems(Cventa oVenta, int caja_diaria)
        {
            DataTable      DT     = Cdatos_ventas.DevolverArticulosVenta(oVenta, caja_diaria);
            Ctrl_articulos admArt = Ctrl_articulos.ClaseActiva();

            admArt.DevolverListaVigentes();
            foreach (DataRow DR in DT.Rows)
            {
                Carticulo obj = admArt.BuscarEnVigentes(DR[0].ToString());
                oVenta.Items().Add(new Citem(obj, Convert.ToDecimal(DR[1]), Convert.ToDecimal(DR[2])));
            }
        }
Пример #3
0
        public void GuardarItems(Ccompra obj)
        {
            Ctrl_articulos admArt = Ctrl_articulos.ClaseActiva();
            int            cont   = 0;

            foreach (Citem aux in obj.Lista())
            {
                Cdatos_compras.GuardarItem(aux, obj);
                aux.Articulo.Stock += aux.Cantidad;
                aux.Articulo.Costo  = aux.Precio_Uni;
                admArt.Modificar(aux.Articulo);
                cont++;
                if (cont == 3 || cont == 6 || cont == 9)
                {
                    System.Threading.Thread.Sleep(2000);
                }
            }
        }
Пример #4
0
        public void CargarItems(Ccompra obj)
        {
            DataTable      DT  = Cdatos_compras.VerItems(obj);
            Ctrl_articulos adm = Ctrl_articulos.ClaseActiva();
            Carticulo      oart;
            List <Citem>   list = new List <Citem>();

            foreach (DataRow DR in DT.Rows)
            {
                oart = adm.BuscarEnVigentes(DR[0].ToString());
                if (oart == null)
                {
                    oart = adm.BuscarEnNoVigentes(DR[0].ToString());
                }
                list.Add(new Citem(oart, Convert.ToDecimal(DR[1]), Convert.ToDecimal(DR[2])));
            }

            obj.L_items = list;
        }