Exemplo n.º 1
0
        /// <summary>
        /// Metodo para inicializar los objetos
        /// y variables del MVVM del MV de ventas
        /// </summary>
        private void inicializa()
        {
            ventaServ = new VentasServicio(tpvEnt);

            usuServ       = new UsuariosServicio(tpvEnt);
            cliServ       = new ClienteServicio(tpvEnt);
            ventaProdServ = new Ventas_De_ProductosServicio(tpvEnt);


            objVenta       = new ventas();
            objVenta.fecha = DateTime.Now;

            objVentasProductos = new ventas_de_productos();

            listaVentasProdCompra = new List <ventas_de_productos>();

            listaCollecVentasDataGrid = new ListCollectionView(ventaServ.getAll().ToList());

            fechaIni = DateTime.Now;
            fechaFin = DateTime.Now;
        }
        /// <summary>
        /// Metodo para inicializar los objetos
        /// y variables del MVVM del MV de ventas de productos
        /// </summary>
        private void inicializa()
        {
            //ventaProdServ = new ServicioGenerico<ventas_de_productos>(tpvEnt);
            ventaProdServ = new Ventas_De_ProductosServicio(tpvEnt);
            //ventaServ = new VentasServicio(tpvEnt);
            ventaServ = new ServicioGenerico <ventas>(tpvEnt);

            listaVentasProdCompra       = new List <ventas_de_productos>();
            listaCollecVentasProdCompra = new ListCollectionView(ventaProdServ.getAll().ToList());
            ventaProdSelect             = new ventas_de_productos();

            fechaIni = DateTime.Now;
            fechaFin = DateTime.Now;

            //Obtener ultima venta para la factura
            ventaFactura           = new ventas();
            ventaServFactura       = new VentasServicio(tpvEnt);
            listaVentasProdFactura = new List <ventas_de_productos>();

            ventaFactura = ventaServFactura.getLastVenta();

            sacarVentasDeProdFactura(ventaFactura);
        }