示例#1
0
        //NUEVO PRODUCTO
        public bool AgregarBolson(string nombre, string unidad, string tipo, long cantidad, float precioCompra)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("INSERT INTO Bolson (bolsonNombre, bolsonUnidad, bolsonTipo, bolsonCantidad, bolsonPrecioCompra) VALUES ('" + nombre + "', '" + unidad + "', '" + tipo + "', " + cantidad + ", '" + precioCompra + "')"));
            //return consulta;
        }
        public DataSet FacturaProductosMostrar(int nroFactura)
        {
            DataSet         DDSS = new DataSet();
            ConexionGeneral CG   = new ConexionGeneral();

            return(CG.Consultor("SELECT FP.productoID AS 'ID', P.productoNombre, P.productoUnidadMedida, FP.productoCantidad, FP.productoPrecioUnitario FROM Factura F INNER JOIN FacturaProducto FP ON FP.facturaID = F.facturaID INNER JOIN Producto P ON P.productoId = FP.productoID WHERE F.facturaID = " + nroFactura + ""));
        }
        private void Principal_Load(object sender, EventArgs e)
        {
            ConexionGeneral CG = new ConexionGeneral();

            CG.DBCreator();
            CG.AgregarColumnaBarcode();
        }
示例#4
0
        public DataSet MostrarStock()
        {
            DataSet         DS = new DataSet();
            ConexionGeneral CG = new ConexionGeneral();

            DS = CG.Consultor("SELECT * FROM Bolson");
            return(DS);
        }
示例#5
0
        public DataSet MostrarUnidadMedida()
        {
            DataSet         DDSS = new DataSet();
            ConexionGeneral CG   = new ConexionGeneral();

            DDSS = CG.Consultor("SELECT * FROM UnidadMedida");
            return(DDSS);
        }
示例#6
0
        public DataSet MostrarItemBuscado(string nombreBuscado)
        {
            DataSet         DS = new DataSet();
            ConexionGeneral CG = new ConexionGeneral();

            DS = CG.Consultor("SELECT * FROM ItemStock where nombre like '%" + nombreBuscado + "%'");
            return(DS);
        }
示例#7
0
        public int DevolverID(string nombre)
        {
            int             identificador = 0;
            ConexionGeneral CG            = new ConexionGeneral();

            identificador = int.Parse(CG.ValorUnico("SELECT codItem FROM ItemStock WHERE nombre = '" + nombre + "'"));
            return(identificador);
        }
示例#8
0
        public DataSet MostrarItemBajo()
        {
            DataSet         DS = new DataSet();
            ConexionGeneral CG = new ConexionGeneral();

            DS = CG.Consultor("SELECT StockId,codigo,producto,categoria,precioCompra,cantidad FROM Stock where cantidad < 10 ");
            return(DS);
        }
示例#9
0
        public DataSet MostrarDetalle(int id)
        {
            DataSet         DS = new DataSet();
            ConexionGeneral CG = new ConexionGeneral();

            DS = CG.Consultor("SELECT producto,descripcion,precioCompra FROM Stock WHERE StockID =  " + id);
            return(DS);
        }
示例#10
0
        public DataSet MostrarUnBolson(int bolsonId)
        {
            DataSet         ds = new DataSet();
            ConexionGeneral cg = new ConexionGeneral();

            ds = cg.Consultor("SELECT * from Bolson WHERE bolsonId = " + bolsonId + "");
            return(ds);
        }
示例#11
0
        public DataSet MostrarEmpleado()
        {
            DataSet         DS = new DataSet();
            ConexionGeneral CG = new ConexionGeneral();

            DS = CG.Consultor("SELECT idEmpleado,dni,nombre,direccion,horas,Xhs,sueldo FROM Empleado");
            return(DS);
        }
        // //////////////////////////////////////////////////////////////////////////////////



        //TODO PARA EDICIÓN DE FACTURA

        //Muestra los productos de la factura
        public DataSet FacturaEditarMostrarProductos(int id)
        {
            DataSet         DDSS = new DataSet();
            ConexionGeneral CG   = new ConexionGeneral();

            DDSS = CG.Consultor("SELECT FP.productoID AS 'ID', productoNombre AS 'Producto', P.productoUnidadMedida AS 'Cantidad x bulto', FP.productoCantidad AS 'Cant. Bultos', FP.productoPrecioUnitario AS 'Precio x Bulto'  FROM FacturaProducto FP INNER JOIN Producto P ON P.productoID = FP.productoID  WHERE facturaID = " + id + ";");
            return(DDSS);
        }
        //Muestra los datos de la factura
        public DataSet FacturaEditarMostrarFactura(int id)
        {
            DataSet         DDSS = new DataSet();
            ConexionGeneral CG   = new ConexionGeneral();

            DDSS = CG.Consultor("SELECT * FROM Factura WHERE facturaID = " + id + ";");
            return(DDSS);
        }
示例#14
0
        public DataSet MostrarEmpleadoBuscado(string nombreBuscado)
        {
            DataSet         DS = new DataSet();
            ConexionGeneral CG = new ConexionGeneral();

            DS = CG.Consultor("SELECT idEmpleado,dni,nombre,direccion,horas,Xhs,sueldo FROM Empleado where nombre like '%" + nombreBuscado + "%'");
            return(DS);
        }
示例#15
0
        public DataSet MostrarFactura()
        {
            DataSet         DS = new DataSet();
            ConexionGeneral CG = new ConexionGeneral();

            DS = CG.Consultor("SELECT * FROM Factura");
            return(DS);
        }
示例#16
0
        public DataSet MostrarItemBuscado(string nombreBuscado)
        {
            DataSet         DS = new DataSet();
            ConexionGeneral CG = new ConexionGeneral();

            DS = CG.Consultor("SELECT StockId,codigo,producto,categoria,precioCompra,cantidad FROM Stock where producto like '%" + nombreBuscado + "%'");
            return(DS);
        }
示例#17
0
        public string MostrarPrecio(string nombre)
        {
            string          precio   = "0";
            string          consulta = "SELECT precio FROM ItemStock WHERE nombre = '" + nombre + "'";
            ConexionGeneral CG       = new ConexionGeneral();

            precio = CG.ValorUnico(consulta).ToString();
            return(precio);
        }
示例#18
0
        public DataSet MostrarFacturaDesde(DateTime fechaDesde)
        {
            DataSet         DS    = new DataSet();
            ConexionGeneral CG    = new ConexionGeneral();
            string          fecha = fechaDesde.ToString();

            DS = CG.Consultor("SELECT idFactura,codPedido, totalFact, fecha FROM Factura AS f WHERE (f.fecha >= '" + fecha + "') AND (f.totalFact > 0)");
            return(DS);
        }
示例#19
0
        public DataSet MostrarProductoTipo()
        {
            DataSet DS;
            //string query = "SELECT * FROM TipoProducto";
            ConexionGeneral cg = new ConexionGeneral();

            DS = cg.Consultor("SELECT * FROM TipoProducto");
            return(DS);
        }
示例#20
0
        public int CrearPedido(int mesa)
        {
            ConexionGeneral CG = new ConexionGeneral();

            CG.Ejecutor("INSERT INTO Pedido (idCliente, tipo, mesa, idEmpleado) VALUES (0, 0," + mesa + ", 0)");
            string pedidoString = CG.ValorUnico("SELECT idPedido FROM Pedido ORDER BY idPedido DESC LIMIT 1 ");
            int    pedidoNum    = int.Parse(pedidoString);

            return(pedidoNum);
        }
示例#21
0
        public DataSet PedidoVer(int numMesa)
        {
            DataSet         DDSS = new DataSet();
            ConexionGeneral CG   = new ConexionGeneral();

            DDSS = CG.Consultor("SELECT ItemStock.nombre, PedidoItem.cantidad, PedidoItem.precio FROM Mesa INNER JOIN Pedido ON Mesa.pedidoMesa = Pedido.idPedido INNER JOIN PedidoItem ON Pedido.idPedido = PedidoItem.idPedido INNER JOIN ItemStock ON ItemStock.codItem = PedidoItem.codItem WHERE Mesa.idMesa = " + numMesa + "");


            return(DDSS);
        }
示例#22
0
        public DataTable MostrarNombres()
        {
            DataTable       tb   = new DataTable();
            DataSet         DDSS = new DataSet();
            ConexionGeneral CG   = new ConexionGeneral();

            DDSS = CG.Consultor("SELECT nombre FROM ItemStock");
            tb   = DDSS.Tables[0];
            return(tb);
        }
        //Edita los datos de una factura
        public void FacturaEditar(int id, string nombre, string fecha, string descuento, string total)
        {
            int             descuentoEntero = int.Parse(descuento);
            int             totalEntero     = int.Parse(total);
            DataSet         DDSS            = new DataSet();
            ConexionGeneral CG = new ConexionGeneral();

            if (CG.Ejecutor("UPDATE Factura SET 'facturaNombre' = '" + nombre + "', 'facturaFecha' = '" + fecha + "', 'facturaDescuento' = " + descuentoEntero + ", 'facturaTotal' = " + totalEntero + "  WHERE facturaID = " + id + ""))
            {
            }
        }
示例#24
0
        public bool MesaEstado(int mesa)
        {
            bool            MesaEst = false;
            ConexionGeneral CG      = new ConexionGeneral();
            string          mesaTexto;

            mesaTexto = CG.ValorUnico("SELECT estadoMesa FROM Mesa WHERE idMesa = " + mesa + "");
            if (mesaTexto == "1")
            {
                MesaEst = true;
            }
            return(MesaEst);
        }
        // //////////////////////////////////////////////////////////////////////////////////////


        //VALIDADORES

        //Validar producto a agregar a la factura
        public void ProductoAgregar(int facturaID, string productoID, string productoCantidad, string precioUnitario)
        {
            ConexionGeneral CG = new ConexionGeneral();
            //int factID = int.Parse(facturaID);
            int prodID    = int.Parse(productoID);
            int prodCant  = int.Parse(productoCantidad);
            int precioUni = int.Parse(precioUnitario);

            if (CG.Ejecutor("INSERT INTO FacturaProducto (facturaID, productoID, productoCantidad,  productoPrecioUnitario) VALUES (" + facturaID + ", " + prodID + ", " + prodCant + ", " + precioUni + ")"))
            {
                //MessageBox.Show("Factura Creada");
            }
        }
示例#26
0
        private void Impresion_Load(object sender, EventArgs e)
        {
            DataTable       dt = new DataTable();
            ConexionGeneral CG = new ConexionGeneral();

            dt = CG.ImprimirFactura(facturaID);


            reportViewer1.LocalReport.DataSources.Clear();
            ReportDataSource rp = new ReportDataSource("DataSet1", dt);

            reportViewer1.LocalReport.DataSources.Add(rp);



            this.reportViewer1.RefreshReport();
        }
示例#27
0
        static void Main()
        {
            ConexionGeneral cg = new ConexionGeneral();

            cg.DBCreator();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            bool  tx = false;
            Form1 f  = new Form1();

            f.ShowDialog();
            //Inicio i = new Inicio(tx);
            //i.ShowDialog();
            //Menu f = new Menu();
            //f.ShowDialog();
            Application.Run();
        }
        /// ///////////////////////////////////////////////////////////////////////////////

        //ELIMINAR FACTURA

        //Eliminar factura
        public bool FacturaEliminar(int idFactura)
        {
            ConexionGeneral CG    = new ConexionGeneral();
            bool            exito = false;

            if (CG.Ejecutor("DELETE FROM FacturaProducto WHERE facturaID = " + idFactura + ""))
            {
                if (CG.Ejecutor("DELETE FROM Factura WHERE facturaID = " + idFactura + ""))
                {
                    exito = true;
                    MessageBox.Show("Factura eliminada");
                }
                else
                {
                    MessageBox.Show("Hubo un error al eliminar la factura");
                }
            }

            return(exito);
        }
        // /////////////////////////////////////////////////////////////
        // FACTURA CREAR



        public void FacturaCrear(string nombre, string fecha, string descuento, string facturaTotal)
        {
            int             descuentoEntero = 0;
            ConexionGeneral CG = new ConexionGeneral();

            if (descuento == "")
            {
                descuentoEntero = 0;
            }
            else
            {
                descuentoEntero = int.Parse(descuento);
            }

            int total = Int32.Parse(facturaTotal);

            if (CG.Ejecutor("INSERT INTO Factura (facturaNombre, facturaFecha, facturaDescuento,  facturaTotal) VALUES ('" + nombre + "', '" + fecha + "', " + descuentoEntero + ", " + total + ")"))
            {
                //MessageBox.Show("Factura Creada");
            }
        }
示例#30
0
        public bool EliminarEmpleado(int idEmpleado)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("DELETE from Empleado where idEmpleado = " + idEmpleado));
        }