Exemple #1
0
 public void Cargar_Datos()
 {
     conexion.conectar();
     tabla = conexion.consulta(string.Format("SELECT idCategoria, nombre, descripcion FROM taller.categoria"));
     foreach (DataRow f in tabla.Rows)
     {
         ClaCategoria C = new ClaCategoria();
         C.IdCategoria = f.Field <int>(0);
         C.Nombre      = f.Field <string>(1);
         C.Descripcion = f.Field <string>(2);
         categorias.Add(C);
     }
 }
Exemple #2
0
 public void Cargar_Datos()
 {
     conexion.conectar();
     tabla = conexion.consulta(string.Format("SELECT idInventario, producto, existencia, precio FROM taller.inventario"));
     foreach (DataRow f in tabla.Rows)
     {
         ClaInventario I = new ClaInventario();
         I.IdInventario = f.Field <int>(0);
         I.Producto     = f.Field <string>(1);
         I.Existencia   = f.Field <int>(2);
         I.Precio       = f.Field <decimal>(3);
         inventario.Add(I);
     }
 }
Exemple #3
0
 public void Cargar_Datos()
 {
     conexion.conectar();
     tabla = conexion.consulta(string.Format("SELECT idProveedor, RTNProveedor, nombre, telefono, " +
                                             "direccion, correoElectronico FROM taller.proveedor"));
     foreach (DataRow f in tabla.Rows)
     {
         ClaProveedor P = new ClaProveedor();
         P.p = f.Field <int>(0);
         P.r = f.Field <string>(1);
         P.n = f.Field <string>(2);
         P.t = f.Field <string>(3);
         P.d = f.Field <string>(4);
         P.c = f.Field <string>(5);
         proveedores.Add(P);
     }
 }
 public void Cargar_Datos()
 {
     conexion.conectar();
     tabla = conexion.consulta(string.Format("SELECT idProducto, nombre, categoria, marca, año, proveedor, existencia, precioCompra, precioVenta FROM taller.producto"));
     foreach (DataRow f in tabla.Rows)
     {
         ClaProducto P = new ClaProducto();
         P.IdProducto   = f.Field <string>(0);
         P.Nombre       = f.Field <string>(1);
         P.Categoria    = f.Field <int>(2);
         P.Marca        = f.Field <string>(3);
         P.Año          = f.Field <string>(4);
         P.Proveedor    = f.Field <int>(5);
         P.Existencia   = f.Field <int>(6);
         P.PrecioCompra = (f.Field <decimal>(7));
         P.PrecioVenta  = (f.Field <decimal>(8));
         productos.Add(P);
     }
 }
 public void Cargar_Datos()
 {
     conexion.conectar();
     tabla = conexion.consulta(string.Format("SELECT ev.numeroFactura, ev.fecha, ev.cliente, dv.idDetalle, dv.encabezado, " +
                                             "dv.producto, dv.cantidad, dv.precio, dv.impuesto, dv.subTotal, dv.total FROM taller.encabezadoventa As ev " +
                                             "INNER JOIN taller.detalleventa AS dv ON ev.numeroFactura = dv.encabezado"));
     foreach (DataRow f in tabla.Rows)
     {
         ClaVenta V = new ClaVenta();
         V.Encabezado    = f.Field <int>(0);
         V.Fecha         = f.Field <DateTime>(1);
         V.Cliente       = f.Field <string>(2);
         V.IdDetalle     = f.Field <int>(3);
         V.NumeroFactura = f.Field <int>(4);
         V.IDProducto    = f.Field <string>(5);
         V.Cantidad      = f.Field <int>(6);
         V.Precio        = f.Field <decimal>(7);
         V.Impuesto      = f.Field <decimal>(8);
         V.Subtotal      = f.Field <decimal>(9);
         V.Total         = f.Field <decimal>(10);
         ventas.Add(V);
     }
 }
        /// Encabezado Compra

        public void Cargar_Datos()
        {
            conexion.conectar();
            tabla = conexion.consulta(string.Format("SELECT e.numeroFactura, e.proveedor, e.fecha, e.facturaProveedor, d.idDetalleCompra , " +
                                                    "d.encabezadoCompra, d.producto, d.cantidad, d.precio, d.impuesto,d.subTotal,d.total FROM taller.encabezadocompra " +
                                                    "As e INNER JOIN taller.detallecompra AS d ON e.numeroFactura = d.encabezadocompra"));
            foreach (DataRow f in tabla.Rows)
            {
                ClaCompra Cm = new ClaCompra();
                Cm.Encabezado       = f.Field <int>(0);
                Cm.Proveedor        = f.Field <int>(1);
                Cm.Fecha            = f.Field <DateTime>(2);
                Cm.FacturaProveedor = f.Field <string>(3);
                Cm.IdDetalleCompra  = f.Field <int>(4);
                Cm.NumeroFactura    = f.Field <int>(5);
                Cm.Producto         = f.Field <string>(6);
                Cm.Cantidad         = f.Field <int>(7);
                Cm.Precio           = (f.Field <decimal>(8));
                Cm.Impuesto         = (f.Field <decimal>(9));
                Cm.SubTotal         = (f.Field <decimal>(10));
                Cm.Total            = (f.Field <decimal>(11));
                compras.Add(Cm);
            }
        }