public proveedor[] obtenerFiltro(string tex)
        {
            //Lineas de codigos en comun para todos los metodos.
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "proveedores";
            String     NomCampo = "Nombre";
            ArrayList  array    = new ArrayList();

            array.Add("CodigoProvedor");
            array.Add("Nombre");
            //Lineas con detalles especificos por metodo.

            DataTable tab = new DataTable();

            tab = opciones.BuscarRegistroAutoincremetable(NomTabla, NomCampo, array, tex);
            int tamanio = tab.Rows.Count;


            proveedor[] coleccionProveedores = new proveedor[tamanio];

            for (int j = 0; j < tamanio; j++)
            {
                DataRow   row   = tab.Rows[j];
                proveedor prove = new proveedor(row["CodigoProvedor"].ToString(), row["Nombre"].ToString());
                coleccionProveedores[j] = prove;
            }
            return(coleccionProveedores);
        }
예제 #2
0
        public void cargarFacturasBorrador(String sucursal)
        {
            this.radGridView1.MasterTemplate.Rows.Clear();
            opcionesdb opcione  = new opcionesdb();
            String     NomTabla = "Ventas";
            Hashtable  crit     = new Hashtable();
            Hashtable  reg      = new Hashtable();

            //Lineas con detalles especificos por metodo.
            reg.Add("NVentas", "NVentas");
            reg.Add("Fecha", "Fecha");
            reg.Add("TotalReal", "TotalReal");

            crit.Add("TipoVenta", "Borrador");
            crit.Add("CodigoSucursal", sucursal);

            DataTable tabla = opcione.BuscarRegistro(NomTabla, crit, reg);


            DataRow row;

            for (int f = 0; f < tabla.Rows.Count; f++)
            {
                row = tabla.Rows[f];
                radGridView1.Rows.AddNew();
                int x = radGridView1.Rows.Count;
                this.radGridView1.Rows[x - 1].Cells[0].Value = row["Nventas"].ToString();
                this.radGridView1.Rows[x - 1].Cells[1].Value = row["Fecha"].ToString();
                this.radGridView1.Rows[x - 1].Cells[2].Value = row["TotalReal"].ToString();
            }
        }
예제 #3
0
        public producto obtener(String CodBarra)
        {
            //Lineas de codigos en comun para todos los metodos.
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "productos";
            Hashtable  crit     = new Hashtable();
            Hashtable  reg      = new Hashtable();

            //Lineas con detalles especificos por metodo.
            crit.Add("CodigoBarra", CodBarra);
            reg.Add("CodigoBarra", "CodigoBarra");
            reg.Add("nombre", "nombre");

            DataTable tab = new DataTable();

            tab = opciones.BuscarRegistro(NomTabla, crit, reg);
            producto pro = new producto("", "");

            if (tab.Rows.Count > 0)
            {
                DataRow row = tab.Rows[0];
                pro = new producto(row["CodigoBarra"].ToString(), row["nombre"].ToString());
                //   MessageBox.Show(row["nombre"].ToString());
                return(pro);
            }
            else
            {
                return(pro);
            }
        }
예제 #4
0
        private void btneliminarsucursal_Click(object sender, EventArgs e)
        {
            if (this.txtCodSucur.Text == "")
            {
                MessageBox.Show("Debe llenar el campo Codigo o elija un registro de la tabla");
            }
            else if (this.txtNombreSucur.Text == "")
            {
                MessageBox.Show("Debe llenar el campo Nombre o elija un registro de la tabla");
            }
            else
            {
                sucursal sucu = new sucursal(txtCodSucur.Text, txtNombreSucur.Text);
                //Lineas de codigos en comun para todos los metodos.
                opcionesdb opciones = new opcionesdb();
                String     NomTabla = "Sucursal";
                Hashtable  crit     = new Hashtable();

                //Lineas con detalles especificos por metodo.
                crit.Add("CodigoSucursal", sucu.Codigosucursal.ToString());
                crit.Add("Nombre", sucu.Nombre.ToString());

                opciones.EliminarRegistro(NomTabla, crit);
                //    MessageBox.Show("Sucursal Eliminada Satisfactoriamente'¡¡¡¡¡");
                cargarSucursales();
            }
        }
예제 #5
0
        public void MostrarDetalles()
        {
            if (radGridView1.Rows.Count > 0)
            {
                detalleborrador detalle  = new detalleborrador(listSucursal.SelectedValue.ToString());
                opcionesdb      opcion   = new opcionesdb();
                String          NomTabla = "DetalleVenta";
                Hashtable       crit     = new Hashtable();
                Hashtable       reg      = new Hashtable();

                //Obtener Id de Venta
                int    fila = System.Convert.ToInt32(radGridView1.MasterGridViewInfo.CurrentIndex.ToString());
                String id   = radGridView1.Rows[fila].Cells[0].Value.ToString();
                //MessageBox.Show(id);

                //obtenerdetalle
                //Lineas con detalles especificos por metodo.
                reg.Add("CodigoBarra", "CodigoBarra");
                reg.Add("Correlativo", "Correlativo");
                reg.Add("PrecioReal", "PrecioReal");
                reg.Add("PrecioVenta", "PrecioVenta");

                crit.Add("NVenta", id);

                DataTable tabla = opcion.BuscarRegistro(NomTabla, crit, reg);
                detalle.DesabilitarFact();
                detalle.llenarDetalle(tabla);
                detalle.Show();
            }
        }
예제 #6
0
        private void btnGCambPara_Click(object sender, EventArgs e)
        {
            if (this.txtnombreparam.Text == "")
            {
                MessageBox.Show("Debe llenar el campo Nombre o elija un registro de la tabla");
            }
            else if (this.txtvalorparam.Text == "")
            {
                MessageBox.Show("Debe llenar el campo Valor o elija un registro de la tabla");
            }
            else
            {
                parametros para = new parametros(txtnombreparam.Text, txtvalorparam.Text);

                //Lineas de codigos en comun para todos los metodos.
                opcionesdb opciones = new opcionesdb();
                String     NomTabla = "Parametros";
                Hashtable  crit     = new Hashtable();

                Hashtable reg = new Hashtable();

                //Lineas con detalles especificos por metodo.
                reg.Add("Nombre", para.nombre.ToString());
                reg.Add("Valor", para.valor.ToString());

                //Nuevos valores de la tupla a actualizar.
                crit.Add("Nombre", para.nombre.ToString());

                opciones.ModificarRegistro(NomTabla, crit, reg);
                //    MessageBox.Show("Parametro Modificado Satisfactoriamente'¡¡¡¡¡");
                cargarParametros();
            }
        }
예제 #7
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (this.txtNombre.Text == "")
            {
                MessageBox.Show("Debe llenar el campo Nombre");
            }
            else if (this.txtGananciaNueva.Text == "")
            {
                MessageBox.Show("Debe llenar el campo Ganancia");
            }
            else
            {
                //Lineas de codigos en comun para todos los metodos.
                opcionesdb opciones = new opcionesdb();
                String     NomTabla = "TipoPrecio";
                Hashtable  crit     = new Hashtable();

                //Lineas con detalles especificos por metodo.
                crit.Add("TipoPrecio", txtNombre.Text);
                crit.Add("Formula", txtGananciaNueva.Text);

                opciones.InsertarRegistro(NomTabla, crit);

                txtNombre.Text            = "";
                txtGananciaNueva.Text     = "";
                labelMensajes.Text        = "Nueva categoria creada exitosamente.";
                txtGananciaModificar.Text = "";
                cargarCombox();
            }
        }
예제 #8
0
        public void Facturar()
        {
            // MessageBox.Show(sucursal1);
            ven.generarNumeroVentas();
            //lineas comun
            opcionesdb opcion   = new opcionesdb();
            String     NomTabla = "";
            Hashtable  crit     = new Hashtable();
            Hashtable  reg      = new Hashtable();


            //Modificar Venta agregar nueva factura
            NomTabla = "Ventas";

            calcularutilidad();

            //   MessageBox.Show(Convert.ToString(ven.NVenta));
            crit.Add("TipoVenta", "FACTURA");
            crit.Add("Numero", Convert.ToString(ven.NVenta));
            crit.Add("TotalReal", Convert.ToString(CalcularTotalReal()).Replace(",", "."));
            crit.Add("TotalVenta", radTextBox2.Text.Replace(",", "."));
            crit.Add("Fecha", fact.pasarfecha());

            crit.Add("CodigoSucursal", sucursal1);
            crit.Add("Comentario", txtComentarios.Text);
            crit.Add("Gravado", Convert.ToString(CalcularTotalReal()));
            crit.Add("IVA", Convert.ToString(this.IvATotal()).Replace(",", "."));
            crit.Add("PagoACuenta", Convert.ToString(this.PagoACTotal()).Replace(",", "."));
            crit.Add("Renta", Convert.ToString(this.RentaFinal()).Replace(",", "."));

            crit.Add("Utilidad", Convert.ToString(this.UtilidadFinal()).Replace(",", "."));

            // crit.Add();
            opcion.InsertarRegistro(NomTabla, crit);
        }
예제 #9
0
        public void ObtenerParametros()
        {
            opcionesdb opcion   = new opcionesdb();
            String     Nomtabla = "Parametros";

            DataTable tabla = opcion.ObtenerTodasTuplas(Nomtabla);
            DataRow   row;

            for (int i = 0; i < tabla.Rows.Count; i++)
            {
                row = tabla.Rows[i];
                if (row["Nombre"].ToString() == "IVA")
                {
                    IVA = Convert.ToDouble(row["Valor"].ToString().Replace(".", ","));
                }
                else if (row["Nombre"].ToString() == "Pago a Cuenta")
                {
                    PagoACuenta = Convert.ToDouble(row["Valor"].ToString().Replace(".", ","));
                }
                else if (row["Nombre"].ToString() == "Renta")
                {
                    Renta = Convert.ToDouble(row["Valor"].ToString().Replace(".", ","));
                }
            }
        }
예제 #10
0
        public void totalVentas()
        {
            //Lineas de codigos en comun para todos los metodos.
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "ventas";
            Hashtable  crit     = new Hashtable();
            Hashtable  reg      = new Hashtable();

            //Lineas con detalles especificos por metodo.
            crit.Add("MONTH(Fecha)", radDropDownList3.SelectedItem.Value.ToString());
            crit.Add("YEAR(Fecha)", txtAnio.Text);
            crit.Add("CodigoSucursal", radDropDownList2.SelectedItem.Value.ToString());

            reg.Add("TotalVenta", "TotalVenta");
            reg.Add("Utilidad", "Utilidad");

            DataTable tab = new DataTable();

            tab = opciones.BuscarRegistro(NomTabla, crit, reg);
            double total    = 0.0;
            double utilidad = 0.0;

            for (int i = 0; i < tab.Rows.Count; i++)
            {
                DataRow row = tab.Rows[i];
                total    = total + System.Convert.ToDouble(row["TotalVenta"].ToString());
                utilidad = utilidad + System.Convert.ToDouble(row["Utilidad"].ToString());
            }
            txtVentasMes.Text = Decimal.Round(System.Convert.ToDecimal(total), 2) + "";
            txtUtilidad.Text  = Decimal.Round(System.Convert.ToDecimal(utilidad), 2) + "";
        }
예제 #11
0
        public void Ventaconsumidor()
        {
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "Ventas";
            Hashtable  crit     = new Hashtable();

            Hashtable reg = new Hashtable();

            crit.Add("MONTH(Fecha)", MesList.SelectedItem.Value.ToString());
            crit.Add("YEAR(Fecha)", AnyoBox.Text);
            crit.Add("CodigoSucursal", SucursalList.SelectedItem.Value.ToString());


            crit.Add("TipoVenta", "FACTURA");
            reg.Add("Gravado", "Gravado");
            reg.Add("Fecha", "Fecha");
            reg.Add("IVA", "IVA");
            reg.Add("PagoACuenta", "PagoACuenta");
            reg.Add("Renta", "Renta");
            reg.Add("Utilidad", "Utilidad");


            DataTable tab = new DataTable();

            tab = opciones.BuscarRegistro(NomTabla, crit, reg);
            double total           = 0.00;
            double TotalIva        = 0.00;
            double TotalPagoCuenta = 0.00;
            double Rentax          = 0.00;
            double UtilidadFinal   = 0.00;

            try
            {
                for (int i = 0; i < tab.Rows.Count; i++)
                {
                    DataRow row = tab.Rows[i];
                    total           = total + System.Convert.ToDouble(row["Gravado"].ToString());
                    TotalIva        = TotalIva + System.Convert.ToDouble(row["IVA"].ToString());
                    TotalPagoCuenta = TotalPagoCuenta + System.Convert.ToDouble(row["PagoACuenta"].ToString());
                    Rentax          = Rentax + System.Convert.ToDouble(row["Renta"].ToString());
                    UtilidadFinal  += System.Convert.ToDouble(row["Utilidad"].ToString());
                }
                TxtFinal.Text      = Decimal.Round(System.Convert.ToDecimal(total), 2) + "";
                TxtVentaIva.Text   = Decimal.Round(System.Convert.ToDecimal(TotalIva), 2) + "";
                TxtPagoCuenta.Text = Decimal.Round(System.Convert.ToDecimal(TotalPagoCuenta), 2) + "  ";
                TxtRenta.Text      = Decimal.Round(System.Convert.ToDecimal(Rentax), 2) + "";
                TxtUtilidad.Text   = Decimal.Round(System.Convert.ToDecimal(UtilidadFinal), 2) + "  ";
            }
            catch (Exception ex)
            {
                RadMessageBox.SetThemeName("TelerikMetroBlue");
                Telerik.WinControls.RadMessageBox.Show("Tuplas de la tabla Ventas tienen un valor de NULL " + ex.HResult + "\n Revice la base de Datos");
            }
        }
예제 #12
0
        public void eliminar(producto product)
        {
            //Lineas de codigos en comun para todos los metodos.
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "productos";
            Hashtable  crit     = new Hashtable();

            //Lineas con detalles especificos por metodo.
            crit.Add("CodigoBarra", product.CodigoBarra.ToString());
            crit.Add("Nombre", product.Nombre.ToString());

            opciones.EliminarRegistro(NomTabla, crit);
        }
예제 #13
0
        public void agregar(TipoPrecio TipoPrec)
        {
            //Lineas de codigos en comun para todos los metodos.
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "TipoPrecio";
            Hashtable  crit     = new Hashtable();

            //Lineas con detalles especificos por metodo.
            crit.Add("TipoPrecio", TipoPrec.TipoPrecio1.ToString());
            crit.Add("Formula", TipoPrec.Formula.ToString());

            opciones.InsertarRegistro(NomTabla, crit);
        }
예제 #14
0
        public void agregar(proveedor proveedo)
        {
            //Lineas de codigos en comun para todos los metodos.
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "proveedores";
            Hashtable  crit     = new Hashtable();

            //Lineas con detalles especificos por metodo.
            crit.Add("CodigoProvedor", proveedo.CodigoProveedor.ToString());
            crit.Add("Nombre", proveedo.Nombre.ToString());

            opciones.InsertarRegistro(NomTabla, crit);
        }
예제 #15
0
        public void EliminarBorrador()
        {
            //  MessageBox.Show(sucursal1);
            opcionesdb opcion   = new opcionesdb();
            String     NomTabla = "Ventas";
            Hashtable  crit     = new Hashtable();

            //Eliminar Registro de Ventas Borrador

            crit.Add("TipoVenta", "Borrador");
            crit.Add("CodigoSucursal", sucursal1);



            opcion.EliminarRegistro(NomTabla, crit);
        }
예제 #16
0
        public void ObtenerTodos()
        {
            detalleborrador detalle = new detalleborrador(listSucursal.SelectedValue.ToString());
            int             filas   = radGridView3.Rows.Count;
            rowGridView     grid    = new rowGridView();
            DataTable       todos   = new DataTable();
            String          ids;
            opcionesdb      opcion   = new opcionesdb();
            String          NomTabla = "DetalleVenta";
            Hashtable       crit     = new Hashtable();
            Hashtable       reg      = new Hashtable();

            //Obtener Id de Venta
            //  int fila = System.Convert.ToInt32(radGridView1.MasterGridViewInfo.CurrentIndex.ToString());
            //  String id = radGridView1.Rows[fila].Cells[0].Value.ToString();
            //MessageBox.Show(id);

            //obtenerdetalle
            //Lineas con detalles especificos por metodo.
            reg.Add("CodigoBarra", "CodigoBarra");
            reg.Add("Correlativo", "Correlativo");
            reg.Add("PrecioReal", "PrecioReal");
            reg.Add("PrecioVenta", "PrecioVenta");

            for (int f = 0; f < filas; f++)
            {
                ids = radGridView3.Rows[f].Cells[0].Value.ToString();
                crit.Add("NVenta", ids);

                DataTable tabla = opcion.BuscarRegistro(NomTabla, crit, reg);
                todos = tabla.Clone();
                for (int a = 0; a < tabla.Rows.Count; a++)
                {
                    todos.ImportRow(tabla.Rows[a]);
                }


                detalle.llenarDetalle(todos);
                tabla.Clear();
                crit.Clear();
            }

            detalle.HabilitarFact();
            detalle.Show();
        }
예제 #17
0
        public void CreditoCompra()
        {
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "Compras";
            Hashtable  crit     = new Hashtable();
            Hashtable  reg      = new Hashtable();

            crit.Add("MONTH(Fecha)", MesList.SelectedItem.Value.ToString());
            crit.Add("YEAR(Fecha)", AnyoBox.Text);
            crit.Add("CodigoSucursal", SucursalList.SelectedItem.Value.ToString());


            crit.Add("TipoCompra", 1);
            reg.Add("Gravado", "Gravado");
            reg.Add("Fecha", "Fecha");
            reg.Add("IVA", "IVA");
            reg.Add("Percepcion", "Percepcion");


            DataTable tab = new DataTable();

            tab = opciones.BuscarRegistro(NomTabla, crit, reg);
            double total           = 0.00;
            double TotalIva        = 0.00;
            double TotalPercepcion = 0.00;

            try
            {
                for (int i = 0; i < tab.Rows.Count; i++)
                {
                    DataRow row = tab.Rows[i];
                    total            = total + System.Convert.ToDouble(row["Gravado"].ToString());
                    TotalIva         = TotalIva + System.Convert.ToDouble(row["IVA"].ToString());
                    TotalPercepcion += System.Convert.ToDouble(row["Percepcion"].ToString());
                }
                Creditotxt.Text    = Decimal.Round(System.Convert.ToDecimal(total), 2) + "";
                TxtIva.Text        = Decimal.Round(System.Convert.ToDecimal(TotalIva), 2) + "";
                TxtPercepcion.Text = Decimal.Round(System.Convert.ToDecimal(TotalPercepcion), 2) + "  ";
            }
            catch (Exception ex)
            {
                RadMessageBox.SetThemeName("TelerikMetroBlue");
                Telerik.WinControls.RadMessageBox.Show("Tuplas de la tabla Compras tienen un valor de NULL " + ex.HResult + "\n Revice la base de Datos");
            }
        }
예제 #18
0
        public void cargarParametros()
        {
            this.radGridView2.MasterTemplate.Rows.Clear();
            opcionesdb opcione = new opcionesdb();
            DataTable  tabla   = opcione.ObtenerTodasTuplas("Parametros");
            DataRow    row;

            for (int f = 0; f < tabla.Rows.Count; f++)
            {
                row = tabla.Rows[f];
                radGridView2.Rows.AddNew();
                int x = radGridView2.Rows.Count;
                this.radGridView2.Rows[x - 1].Cells[0].Value = row["Nombre"].ToString();
                this.radGridView2.Rows[x - 1].Cells[1].Value = row["Valor"].ToString();
            }
            txtnombreparam.Text = "";
            txtvalorparam.Text  = "";
        }
예제 #19
0
        public void cargarSucursales()
        {
            this.radGridView3.MasterTemplate.Rows.Clear();
            opcionesdb opcione = new opcionesdb();
            DataTable  tabla   = opcione.ObtenerTodasTuplas("Sucursal");
            DataRow    row;

            for (int f = 0; f < tabla.Rows.Count; f++)
            {
                row = tabla.Rows[f];
                radGridView3.Rows.AddNew();
                int x = radGridView3.Rows.Count;
                this.radGridView3.Rows[x - 1].Cells[0].Value = row["CodigoSucursal"].ToString();
                this.radGridView3.Rows[x - 1].Cells[1].Value = row["Nombre"].ToString();
            }
            txtCodSucur.Text    = "";
            txtNombreSucur.Text = "";
        }
예제 #20
0
        public void modificar(producto product)
        {
            //Lineas de codigos en comun para todos los metodos.
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "productos";
            Hashtable  crit     = new Hashtable();

            Hashtable reg = new Hashtable();

            //Lineas con detalles especificos por metodo.
            reg.Add("CodigoBarra", product.CodigoBarra.ToString());
            reg.Add("Nombre", product.Nombre.ToString());

            //Nuevos valores de la tupla a actualizar.
            crit.Add("CodigoBarra", product.CodigoBarra.ToString());

            opciones.ModificarRegistro(NomTabla, crit, reg);
        }
예제 #21
0
        public void modificar(TipoPrecio TipoPrec)
        {
            //Lineas de codigos en comun para todos los metodos.
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "TipoPrecio";
            Hashtable  crit     = new Hashtable();

            Hashtable reg = new Hashtable();

            //Lineas con detalles especificos por metodo.
            reg.Add("TipoPrecio", TipoPrec.TipoPrecio1.ToString());
            reg.Add("Formula", TipoPrec.Formula.ToString());

            //Nuevos valores de la tupla a actualizar.
            crit.Add("TipoPrecio", TipoPrec.TipoPrecio1.ToString());

            opciones.ModificarRegistro(NomTabla, crit, reg);
        }
예제 #22
0
        public String ObtenerNventa()
        {
            String     Nventa;
            opcionesdb opcion    = new opcionesdb();
            String     NomTabla2 = "Ventas";
            Hashtable  crit      = new Hashtable();
            Hashtable  reg       = new Hashtable();

            reg.Add("NVentas", "NVentas");
            crit.Add("Numero", Convert.ToString(ven.NVenta));

            DataTable tabla = opcion.BuscarRegistro(NomTabla2, crit, reg);


            Nventa = tabla.Rows[0]["NVentas"].ToString();
            //  MessageBox.Show(Nventa);
            return(Nventa);
        }
예제 #23
0
        public void CargarSucursales()
        {
            opcionesdb  opcionesS   = new opcionesdb();
            String      NombreTabla = "Sucursal";
            DataTable   tabla       = opcionesS.ObtenerTodasTuplas(NombreTabla);
            List <Item> lista       = new List <Item>();

            DataRow row;

            for (int i = 0; i < tabla.Rows.Count; i++)
            {
                row = tabla.Rows[i];
                lista.Add(new Item(row["Nombre"].ToString(), System.Convert.ToInt32(row["CodigoSucursal"])));
            }

            SucursalList.DisplayMember = "Name";
            SucursalList.ValueMember   = "Value";
            SucursalList.DataSource    = lista;
        }
예제 #24
0
        public void generarNumeroVentas()
        {
            opcionesdb op     = new opcionesdb();
            String     NTabla = "Ventas";
            DataTable  tab    = new DataTable();

            tab = op.obtenerNVenta(NTabla, "Numero");
            DataRow row;

            if (tab.Rows.Count == 0)
            {
                NVenta = 0;
            }
            else
            {
                row    = tab.Rows[0];
                NVenta = System.Convert.ToInt32(row["Numero"].ToString()) + 1;
            }
        }
예제 #25
0
        public void cargarCombox()
        {
            //Lineas de codigos en comun para todos los metodos.
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "TipoPrecio";

            DataTable   tabla = opciones.ObtenerTodasTuplas(NomTabla);
            List <Item> lista = new List <Item>();

            DataRow row;

            for (int i = 0; i < tabla.Rows.Count; i++)
            {
                row = tabla.Rows[i];
                lista.Add(new Item(row["TipoPrecio"].ToString(), System.Convert.ToInt32(row["Formula"])));
            }
            radDropDownList1.DisplayMember = "Name";
            radDropDownList1.ValueMember   = "Value";
            radDropDownList1.DataSource    = lista;
        }
예제 #26
0
        public void cargarCombox2()
        {
            //this.radGridView1.MasterTemplate.Rows.Clear();
            //Lineas de codigos en comun para todos los metodos.
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "Sucursal";

            DataTable   tabla = opciones.ObtenerTodasTuplas(NomTabla);
            List <Item> lista = new List <Item>();

            DataRow row;

            for (int i = 0; i < tabla.Rows.Count; i++)
            {
                row = tabla.Rows[i];
                lista.Add(new Item(row["Nombre"].ToString(), System.Convert.ToInt32(row["CodigoSucursal"])));
            }
            radDropDownList2.DisplayMember = "Name";
            radDropDownList2.ValueMember   = "Value";
            radDropDownList2.DataSource    = lista;
        }
예제 #27
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            TipoPrecio TipoPrec = new TipoPrecio(txtGananciaModificar.Text, radDropDownList1.SelectedText.ToString());
            //Lineas de codigos en comun para todos los metodos.
            opcionesdb opciones = new opcionesdb();
            String     NomTabla = "TipoPrecio";
            Hashtable  crit     = new Hashtable();

            Hashtable reg = new Hashtable();

            //Lineas con detalles especificos por metodo.
            reg.Add("TipoPrecio", TipoPrec.TipoPrecio1.ToString());
            reg.Add("Formula", TipoPrec.Formula.ToString());

            //Nuevos valores de la tupla a actualizar.
            crit.Add("TipoPrecio", TipoPrec.TipoPrecio1.ToString());

            opciones.ModificarRegistro(NomTabla, crit, reg);
            msj2.Text = "Modificado exitosamente.";
            cargarCombox();
        }
예제 #28
0
        public void ModificarDetalle()
        {
            opcionesdb opcion = new opcionesdb();

            Hashtable crit = new Hashtable();
            Hashtable reg  = new Hashtable();
            ventas    ven  = new ventas();
            //Modificar Detalle Venta Actualizar los Productos
            //obtener correlativos


            int    filas = radGridView4.Rows.Count;
            String corre;
            String barra;
            double precioR;
            double precioVenta;

            for (int f = 0; f < filas; f++)
            {
                String NomTabla2 = "DetalleVenta";

                barra       = radGridView4.Rows[f].Cells[0].Value.ToString();
                corre       = radGridView4.Rows[f].Cells[1].Value.ToString();
                precioR     = Convert.ToDouble(radGridView4.Rows[f].Cells[2].Value.ToString());
                precioVenta = Convert.ToDouble(radGridView4.Rows[f].Cells[3].Value.ToString());
                crit.Add("NVenta", this.ObtenerNventa());
                crit.Add("CodigoBarra", barra);
                crit.Add("Correlativo", corre);
                crit.Add("PrecioReal", precioR.ToString().Replace(",", "."));
                crit.Add("PrecioVenta", precioVenta.ToString().Replace(",", "."));

                //MessageBox.Show(barra + "   " + corre+precioR+precioVenta);


                opcion.InsertarRegistro(NomTabla2, crit);

                reg.Clear();
                crit.Clear();
            }
        }
예제 #29
0
        public void EliminarDetalleV()
        {
            opcionesdb opcion   = new opcionesdb();
            String     NomTabla = "DetalleVenta";
            Hashtable  crit     = new Hashtable();
            int        filas    = radGridView4.Rows.Count;
            String     corre;
            String     barra;

            //Eliminar Registro de Ventas Borrador

            for (int f = 0; f < filas; f++)
            {
                barra = radGridView4.Rows[f].Cells[0].Value.ToString();
                corre = radGridView4.Rows[f].Cells[1].Value.ToString();
                crit.Add("CodigoBarra", barra);
                crit.Add("Correlativo", corre);

                opcion.EliminarRegistro(NomTabla, crit);
                crit.Clear();
            }
        }
예제 #30
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            opcionesdb opciones = new opcionesdb();
            DataTable  tabla    = opciones.productoJOINFiltro(System.Convert.ToInt32(radDropDownList2.SelectedItem.Value.ToString()), txtNombre.Text);
            DataRow    row;

            this.radGridView1.MasterTemplate.Rows.Clear();
            for (int f = 0; f < tabla.Rows.Count; f++)
            {
                row = tabla.Rows[f];
                radGridView1.Rows.AddNew();
                int x = radGridView1.Rows.Count;
                this.radGridView1.Rows[x - 1].Cells[0].Value = row["CodigoBarra"].ToString();
                this.radGridView1.Rows[x - 1].Cells[1].Value = row["Correlativo"].ToString();
                this.radGridView1.Rows[x - 1].Cells[2].Value = row["Nombre"].ToString();
                this.radGridView1.Rows[x - 1].Cells[3].Value = row["Gravado"].ToString();
                this.radGridView1.Rows[x - 1].Cells[4].Value = row["NombreP"].ToString();
                TotalInve = TotalInve + System.Convert.ToDouble(row["Gravado"].ToString());
            }
            txtTotal.Text = TotalInve + "";
            labelTP.Text  = radGridView1.Rows.Count + "";
        }