Beispiel #1
0
        private void txtFiltro_TextChanged(object sender, EventArgs e)
        {
            String    Sql    = String.Format("Select * from Inventario Where concat (Id, Producto_id, Sucursal_id, Movimiento, Cantidad_Pro) LIKE '%" + txtFiltro.Text + "%'");
            DataTable consul = ConexionBD.Data(Sql);

            View.DataSource = consul;
        }
Beispiel #2
0
 private void captura_KeyPress(object sender, KeyPressEventArgs e)
 {
     tabla.DataSource = ConexionBD.Data("SELECT per.Id, per.Nombre, per.Apellido, Roll, Ubicacion FROM persona AS per " +
                                        "INNER JOIN roles ON Roll_Id = roles.Id " +
                                        "INNER JOIN sucursal ON Sucursal_Id= sucursal.id " +
                                        "WHERE nombre LIKE '%" + captura.Text + "%'");
 }
Beispiel #3
0
        public Facturas()
        {
            //dt = null;
            InitializeComponent();
            tablaVenta.ColumnHeadersDefaultCellStyle.BackColor = Color.OrangeRed;
            tablaVenta.EnableHeadersVisualStyles = false;



            int numero = ConexionBD.Id(5) + 1;

            CoansecutivoFac.Text = numero + "";

            lbSucursal.Text = Log.sucursal;
            lbEmpleado.Text = Log.nombre;
            lbFecha.Text    = DateTime.Now.ToString("yyyy-MM-dd H:mm:ss");
            txCantidad.Text = "1";
            txCliente.Text  = "Some User No. " + numero;

            cxVendedores.Items.Add("<--Seleccione-->");
            cxVendedores.SelectedIndex = 0;
            DataTable dato = ConexionBD.Data("SELECT persona.Id, Nombre FROM persona " +
                                             "INNER JOIN roles ON roles.Id = persona.Roll_Id " +
                                             "INNER JOIN sucursal ON sucursal.Id = persona.Sucursal_Id " +
                                             "WHERE persona.Sucursal_id=" + Log.sucurId + " AND persona.Roll_Id=" + 1);

            for (int j = 0; j < dato.Rows.Count; j++)
            {
                cxVendedores.Items.Add(dato.Rows[j]["Id"].ToString() + " - " + dato.Rows[j]["Nombre"].ToString());
            }
            cxProducto();
            mensaje.Text  = "Jamás debes abandonar tus \nsueños, lo que debes hacer es \nderrumbar y destruir todas las \nbarreras que te impiden lograr tus \nSUEÑOS...";
            mensaje1.Text = "Si te vas a caer, que sea \na propósito y para tomar impulso \npara dar un gran salto, cruzar \nlas barreras que se interponen en \ntu camino y logres todas tus\n METAS!!!.";
        }
Beispiel #4
0
        public void cargar()
        {
            String    Sql     = String.Format("Select * from Producto");
            DataTable tabview = ConexionBD.Data(Sql);

            View.DataSource = tabview;
        }
Beispiel #5
0
        public void cargarCx()
        {
            tipoDoc.Items.Add("<--Seleccione-->");
            tipoDoc.Items.Add("CC");
            tipoDoc.Items.Add("TI");
            tipoDoc.Items.Add("PS");
            tipoDoc.SelectedIndex = 0;

            DataTable tb1 = ConexionBD.Data("SELECT * FROM roles");

            privilegios.Items.Add("<--Seleccione-->");

            for (int j = 0; j < tb1.Rows.Count; j++)
            {
                privilegios.Items.Add(tb1.Rows[j][0] + " - " + tb1.Rows[j][1]);
            }
            privilegios.SelectedIndex = 0;

            DataTable tb2 = ConexionBD.Data("SELECT * FROM sucursal");

            cxSucursal.Items.Add("<--Seleccione-->");
            for (int j = 0; j < tb2.Rows.Count; j++)
            {
                cxSucursal.Items.Add(tb2.Rows[j][0] + " - " + tb2.Rows[j][1]);
            }

            cxSucursal.SelectedIndex = 0;
        }
Beispiel #6
0
        private void txtSearch_TextChanged(object sender, EventArgs e)
        {
            String    Sql    = String.Format("Select * from Producto Where concat (Id, Nombre, Precio, Iva, Descripcion) LIKE '%" + txtSearch.Text + "%'");
            DataTable consul = ConexionBD.Data(Sql);

            View.DataSource = consul;
        }
Beispiel #7
0
        public void cargar()
        {
            String    Sql     = String.Format("Select * from Inventario");
            DataTable tabview = ConexionBD.Data(Sql);

            /*DataColumn col = tabview.Columns[5];
             * Convert.ToDateTime(col["Fecha"]);*/
            View.DataSource = tabview;
        }
Beispiel #8
0
        public void CargarSucur()
        {
            String    Sql = String.Format("Select Id, Ubicacion from Sucursal");
            DataTable com = ConexionBD.Data(Sql);

            boxSucur.ValueMember   = "Id";
            boxSucur.DisplayMember = "Ubicacion";
            boxSucur.DataSource    = com;
        }
Beispiel #9
0
        public void CargarPro()
        {
            String    Sql = String.Format("Select * from Producto");
            DataTable com = ConexionBD.Data(Sql);

            BoxPro.ValueMember   = "Id";
            BoxPro.DisplayMember = "Nombre";
            BoxPro.DataSource    = com;
        }
Beispiel #10
0
        public void getId()
        {
            DataTable tb     = ConexionBD.Data("CALL getIdTablas(1)");
            int       numero = int.Parse(tb.Rows[0][0].ToString().Trim());

            numero    = numero + 1;
            LbId.Text = "" + numero;
            //return numero;
        }
Beispiel #11
0
        private void tabla_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            MessageBox.Show("entro al cell click");
            int IDs = Convert.ToInt16(this.tabla.CurrentRow.Cells[0].Value);

            tb1 = ConexionBD.Data("SELECT * FROM persona where Id = " + IDs);
            //btActualiza.Enabled = false;
            BtEliminar.Enabled = true;

            BtEditar.Enabled = true;
        }
Beispiel #12
0
        public Form2()
        {
            InitializeComponent();
            sucursales.Items.Add("<--Seleccione-->");
            DataTable dt = ConexionBD.Data("SELECT * FROM sucursal");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                sucursales.Items.Add(dt.Rows[i]["Id"].ToString() + "-" + dt.Rows[i]["Ubicacion"].ToString());
            }
            sucursales.SelectedIndex = 0;
        }
Beispiel #13
0
        private void txProducto_KeyPress(object sender, KeyPressEventArgs e)
        {
            dt1 = ConexionBD.Data("SELECT 1 Item, Id, Nombre, Cantidad as Disponibilidad, 1 as Cantidad, Precio, Iva*Precio, Precio as SubTotal FROM Producto " +
                                  "WHERE Nombre LIKE '%" + txProducto.Text + "%' AND Sucursal_Id =" + Log.sucurId);

            if (dt1.Rows.Count == 0)
            {
                MessageBox.Show("No se encuentra ningun producto con ese Codigo");
            }
            else
            {
                TablaNombres.DataSource = dt1;
            }
        }
Beispiel #14
0
        public void cxProducto()
        {
            //DataTable tb = ConexionBD.Data("SELECT Id, Nombre FROM producto WHERE Sucursal_Id =" + Log.sucurId);
            DataTable tb = ConexionBD.Data("SELECT Id, Nombre FROM producto WHERE Sucursal_Id =" + Log.sucurId);


            //Tuple<String> Tuple = new Tuple.Create(tb);

            cxProduc.Items.Add("<--Seleccione-->");

            for (int j = 0; j < tb.Rows.Count; j++)
            {
                cxProduc.Items.Add(tb.Rows[j]["Id"] + " - " + tb.Rows[j]["Nombre"]);
            }
            cxProduc.SelectedIndex = 0;
        }
Beispiel #15
0
        public Productos(int ID)
        {
            InitializeComponent();
            btnActu.Enabled = true;
            btnIn.Enabled   = false;
            Nuevo           = false;
            this.ID         = ID;
            lbId.Text       = ID + "";
            String    Sql = String.Format("Select * from Producto where Id ='" + lbId.Text + "'");
            DataTable re  = ConexionBD.Data(Sql);
            DataRow   row = re.Rows[0];

            txtName.Text           = row["Nombre"].ToString();
            txtPre.Text            = row["Precio"].ToString();
            ComboxIva.SelectedItem = row["Iva"].ToString();
            txtBoxDescri.Text      = row["Descripcion"].ToString();
        }
Beispiel #16
0
        private void Loger()
        {
            if (txtPass.Text.Length > 0 && txtUser.Text.Length > 0)
            {
                String    sql = String.Format("Select pass, name from persona where pass= '******' and name ='" + txtUser.Text + "'");
                DataTable Tab = ConexionBD.Data(sql);

                if (Tab.Rows.Count > 0)
                {
                    DataTable datos = ConexionBD.Data("SELECT per.nombre, per.apellido, rol.Roll, suc.ubicacion, suc.Id " +
                                                      "FROM persona AS per " +
                                                      "INNER JOIN sucursal AS suc ON per.Sucursal_Id = suc.Id " +
                                                      "INNER JOIN roles AS rol ON per.Roll_Id = rol.Id " +
                                                      "WHERE per.pass='******'");

                    //--------------se asignan valores a las variables globales----------------------//
                    numero   = int.Parse(txtPass.Text);
                    nombre   = datos.Rows[0][0].ToString() + " " + datos.Rows[0][1];
                    rol      = datos.Rows[0][2].ToString();
                    sucursal = datos.Rows[0][3].ToString();
                    sucurId  = datos.Rows[0][4].ToString();

                    //Console.WriteLine(numero + " " + nombre + " " + rol + " " + sucursal);

                    Hide();
                    txtUser.Text = "";
                    txtPass.Text = "";
                    //new Form1(Tab.Rows[0]).ShowDialog();
                    MessageBox.Show("Bienvenido señor@!!! " + nombre, "Login Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    new Inicio().Show();
                }
                else
                {
                    MessageBox.Show("Credenciales invalidas y/o usuario no exisente.", "Verifica tus detalles",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Formulario incompleto", "Verifica tus detalles", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Beispiel #17
0
        private void Buscar_Click(object sender, EventArgs e)
        {
            btnActu.Enabled = true;
            btnIn.Enabled   = false;
            String    Sql = String.Format("Select Id,Producto_id,Sucursal_id,Movimiento,Cantidad_Pro from Inventario where Id ='" + txtId.Text + "'");
            DataTable re  = ConexionBD.Data(Sql);
            DataRow   row = re.Rows[0];

            if (row["Id"].ToString() != txtId.Text)
            {
                MessageBox.Show("El codigo del Id ingresado no existe o es erroneo");
            }
            else
            {
                this.BoxPro.SelectedValue   = row["Producto_id"].ToString();
                this.boxSucur.SelectedValue = row["Sucursal_id"].ToString();
                this.txtMovi.Text           = row["Movimiento"].ToString();
                this.spnCan.Value           = Convert.ToInt16(row["Cantidad_Pro"]);
            }
        }
Beispiel #18
0
        private void button2_Click(object sender, EventArgs e)
        {
            DataTable tb = ConexionBD.Data("SELECT * FROM persona WHERE Nombre='" + txnombre.Text + "' and Apellido='" + txapellido.Text + "' " +
                                           "and name='" + txusuario.Text + "' and Correo='" + txmail.Text + "'");


            if (tb.Rows.Count > 0)
            {
                //Console.WriteLine(tb.Rows[0][0].ToString()+" Aquiiiiiii");
                int id = int.Parse(tb.Rows[0][0].ToString());

                this.Hide();
                new Recuperar(id).ShowDialog();
                Dispose();
            }
            else
            {
                MessageBox.Show("Los Datos Ingresados NO son Compatibles!!!\nVuelve a Intentar", "Error 1355", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #19
0
        private void btConfirma_Click(object sender, EventArgs e)
        {
            if (tipo == "Administrador")
            {
                tb12 = ConexionBD.Data("SELECT * FROM persona WHERE name='" + txUsuario.Text + "' and pass='******' and Roll_Id =" + 5);

                //Console.WriteLine(txUsuario + " usuario" + txPass + " passwords\n " + tb12.Rows[0][0]);
                if (tb12.Rows.Count > 0)
                {
                    this.Dispose();
                    Persona.bandera = false;
                    MessageBox.Show("La Persona ha Sido Eliminada Satisfactoriamente", "Completado", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    MessageBox.Show("Las Credenciales Son Incorrectas\n Intente de Nuevo", "Error 1355", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                }
            }
            else if (tipo == "Supervisor")
            {
                label1.Text = "Necesita las Credenciales de un Supervisor";
                tb12        = ConexionBD.Data("SELECT * FROM persona WHERE name='" + txUsuario.Text + "' and pass='******' and Roll_Id =" + 5);

                //Console.WriteLine(txUsuario + " usuario" + txPass + " passwords\n " + tb12.Rows[0][0]);
                if (tb12.Rows.Count > 0)
                {
                    this.Dispose();
                    Facturas.banderaConfirma = false;
                    MessageBox.Show("El producto ha sido Eliminado de la Tabla Satisfactoriamente", "Completado", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    MessageBox.Show("Las Credenciales Son Incorrectas\n Intente de Nuevo", "Error 1355", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Error de Parametro", "Error 1308", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
            }
        }
Beispiel #20
0
        private void Consultar_Click_1(object sender, EventArgs e)
        {
            ///////////////////////////////
            MessageBox.Show("entro al evento " + condicion);
            Boolean ok = true;


            if (tipoReporte != "<--Seleccione-->")
            {
                if (tipoReporte != "Anual" && cxPeriodo.Text == "<--Seleccione-->")
                {
                    ok = false;
                    MessageBox.Show("Debese Seleccionar El periodo que desea seleccionar", "Error 1355", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (tipoReporte == "Anual" && cxSucursal.Text == "<--Seleccione-->")
                {
                    MessageBox.Show(Finicio + "   -...-anual" + Ffinal);
                    tablaReport.DataSource = null;

                    sql = "SELECT suc.Id, Ubicacion, SUM(TotalFatura) AS 'Total Vendido' FROM ventas AS ven " +
                          "INNER JOIN sucursal AS suc ON suc.Id = ven.Sucursal_Id " +
                          "WHERE (Fecha BETWEEN '" + Finicio + "' AND '" + Ffinal + "' ) " +
                          "GROUP BY Ubicacion";

                    tablaReport.DataSource = ConexionBD.Data(sql);

                    bandera = "anual";
                }
                else
                {
                    if (cxSucursal.Text != "<--Seleccione-->" && cxSucursal.Text != "0 - Todas")
                    {
                        if (cxVendedor.Text != "<--Seleccione-->")
                        {
                            tablaReport.DataSource = null;

                            sql = "SELECT ven.Id, concat(Nombre, ' ', Apellido) AS Nombre, SUM(TotalFatura) AS 'Total' FROM ventas AS ven " +
                                  "INNER JOIN persona AS per ON per.Id = ven.Vendedor_Id " +
                                  "INNER JOIN sucursal AS suc ON suc.Id = ven.Sucursal_Id " +
                                  "WHERE (Fecha BETWEEN '" + Finicio + "' AND '" + Ffinal + "' ) AND Vendedor_Id = " + vendedorId;


                            tablaReport.DataSource = ConexionBD.Data(sql);

                            bandera = "vendedor";
                        }
                        else
                        {
                            MessageBox.Show("AQUI EN ESTA" + condicion, "Error 1355", MessageBoxButtons.OK, MessageBoxIcon.Information);

                            tablaReport.DataSource = null;

                            sql = "SELECT suc.Id, Ubicacion, TotalFatura AS 'Total Vendido' FROM ventas AS ven " +
                                  "INNER JOIN sucursal AS suc ON suc.Id = ven.Sucursal_Id " +
                                  "WHERE  (Fecha BETWEEN '" + Finicio + "' AND '" + Ffinal + "' ) AND Sucursal_Id = " + sucuralId;

                            tablaReport.DataSource = ConexionBD.Data(sql);

                            bandera = "sucursal";
                        }
                    }
                    else if (cxSucursal.Text == "0 - Todas")
                    {
                        tablaReport.DataSource = null;

                        sql = "SELECT suc.Id, Ubicacion Fecha, SUM(TotalFatura) AS 'Total Vendido' FROM ventas AS ven " +
                              "INNER JOIN sucursal AS suc ON suc.Id = ven.Sucursal_Id " +
                              "WHERE (Fecha BETWEEN '" + Finicio + "' AND '" + Ffinal + "' )" +
                              "GROUP BY ven.Id";

                        tablaReport.DataSource = ConexionBD.Data(sql);

                        bandera = "todas";
                    }
                    else
                    {
                        if (cxVendedor.Text != "<--Seleccione-->")
                        {
                            tablaReport.DataSource = null;

                            sql = "SELECT ven.Id, concat(Nombre, ' ', Apellido) AS Nombre, SUM(TotalFatura) AS 'Total' FROM ventas AS ven " +
                                  "INNER JOIN persona AS per ON per.Id = ven.Vendedor_Id " +
                                  "INNER JOIN sucursal AS suc ON suc.Id = ven.Sucursal_Id " +
                                  "WHERE (Fecha BETWEEN '" + Finicio + "' AND '" + Ffinal + "' ) AND Vendedor_Id = " + vendedorId;


                            tablaReport.DataSource = ConexionBD.Data(sql);

                            bandera = "vendedor";
                        }
                    }
                }
            }
            else
            {
                ok = false;
                MessageBox.Show("Debese Seleccionar Un tipo de Reporte Primero", "Error 1355", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            /////////////////////////////////
        }
Beispiel #21
0
        public void consulta(String tipo, String condicion)
        {
            DataTable tb2 = new DataTable();

            if (tipo == "codigo")
            {
                //MessageBox.Show("codigo " + Log.sucurId);
                tb2 = ConexionBD.Data("SELECT 1 Item, Id, Nombre, Cantidad as Disponibilidad, 1 as Cantidades, Precio, Iva*Precio AS Iva, Precio as SubTotal FROM Producto WHERE Id = " + condicion + " AND Sucursal_Id= " + Log.sucurId);
            }
            else if (tipo == "lista")
            {
                // MessageBox.Show("lista " + Log.sucurId);

                tb2 = ConexionBD.Data("SELECT 1 Item, Id, Nombre, Cantidad as Disponibilidad, 1 as Cantidad, Precio, Iva*Precio, Precio as SubTotal FROM Producto WHERE Id = '" + condicion + "' AND Sucursal_Id= " + Log.sucurId);
            }
            else if (tipo == "nombre")
            {
                MessageBox.Show("nombre " + Log.sucurId);
            }

            if (int.Parse(tb2.Rows[0][3].ToString()) > 0)
            {
                String[] datosBd = new String[8];

                for (int j = 0; j < tb2.Columns.Count; j++)
                {
                    datosBd[j] = tb2.Rows[0][j].ToString(); // agrego el resultado a un arraya
                }

                if (tb2.Rows.Count == 0)
                {
                    MessageBox.Show("No se encuentra ningun producto con ese Codigo");
                }
                else
                {
                    if (tablaVenta.Rows.Count == 0)
                    {
                        lista.Add(datosBd);         // agrego el array en la lista
                        dt = tb2;                   //le paso el resultado a la table padre
                        tablaVenta.DataSource = dt; //le paso los valores a la view
                        txCantidad.Focus();
                    }
                    else
                    {
                        Boolean si = true;
                        for (int j = 0; j < lista.Count; j++)
                        {
                            if (datosBd[1] == lista[j][1])                         //comparo lo que hay almacenado en el array con el list
                            {
                                tablaVenta.Rows[j].Cells[6].Value    = datosBd[6]; //si hay algo le manda el verdadero valor del iva
                                tablaVenta.Rows[j].Cells[6].Selected = true;
                                txCantidad.Focus();
                                si = false;
                                break;
                            }
                        }
                        if (si)
                        {
                            //si es un producto nuevo se agraga normal a la tabla view

                            dt.Rows.Add(tb2.Rows[0][0], tb2.Rows[0][1], tb2.Rows[0][2], tb2.Rows[0][3], tb2.Rows[0][4], tb2.Rows[0][5], tb2.Rows[0][6], tb2.Rows[0][7]);
                            tablaVenta.DataSource = dt;
                            lista.Add(datosBd);
                            txCantidad.Focus();
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("No Hay Suficientes Ariculos de " + tb2.Rows[0][1]);
            }
        }
Beispiel #22
0
 public ImpresionFactura()
 {
     InitializeComponent();
     reportes1.SetDataSource(ConexionBD.Data("SELECT * FROM reporte WHERE 'No. Factura'= (SELECT MAX(Id) FROM ventas)"));
 }
Beispiel #23
0
        public void cargarCX(int tipo)
        {
            if (tipo == 0)
            {
                cxReporte.Items.Add("<--Seleccione-->");
                cxReporte.Items.Add("Trimestral");
                cxReporte.Items.Add("Semestral");
                cxReporte.Items.Add("Anual");
                cxReporte.SelectedIndex = 0;
            }
            else if (tipo == 1)
            {
                cxPeriodo.Items.Clear();
                cxPeriodo.Items.Add("<--Seleccione-->");
                cxPeriodo.SelectedIndex = 0;
                cxPeriodo.Items.Add("1 - Periodo");
                cxPeriodo.Items.Add("2 - Periodo");
                cxPeriodo.Items.Add("3 - Periodo");
                cxPeriodo.Items.Add("4 - Periodo");
            }
            else if (tipo == 2)
            {
                cxPeriodo.Items.Clear();
                cxPeriodo.Items.Add("<--Seleccione-->");
                cxPeriodo.SelectedIndex = 0;
                cxPeriodo.Items.Add("1 - Semestre");
                cxPeriodo.Items.Add("2 - Semestre");
            }
            else if (tipo == 3)
            {
                cxSucursal.Items.Add("<--Seleccione-->");
                cxSucursal.Items.Add("0 - Todas");
                DataTable tb = ConexionBD.Data("SELECT * FROM sucursal");

                if (tb.Rows.Count > 0 && cxSucursal.Text != "<--Seleccione-->")
                {
                    for (int j = 0; j < tb.Rows.Count; j++)
                    {
                        cxSucursal.Items.Add(tb.Rows[j]["Id"].ToString() + " - " + tb.Rows[j]["Ubicacion"].ToString());
                    }
                }
                cxSucursal.SelectedIndex = 0;
                //cxSucursal.DataSource = ConexionBD.Data("SELECT * FROM sucursal");
                //cxSucursal.DisplayMember="Ubicacion";
                //cxSucursal.ValueMember = "Id";
            }
            else if (tipo == 4)
            {
                cxVendedor.Items.Add("<--Seleccione-->");
                DataTable tb = ConexionBD.Data("SELECT Id, concat(Nombre, ' ', Apellido) as Nombre FROM persona WHERE Roll_Id =" + 1);
                if (tb.Rows.Count > 0 && cxSucursal.Text == "<--Seleccione-->")
                {
                    for (int j = 0; j < tb.Rows.Count; j++)
                    {
                        cxVendedor.Items.Add(tb.Rows[j]["Id"].ToString() + " - " + tb.Rows[j]["Nombre"].ToString());
                    }
                }
                cxVendedor.SelectedIndex = 0;
            }
            else if (tipo == 5)
            {
                cxVendedor.Items.Clear();
                //cxVendedor.ResetText();

                cxVendedor.Items.Add("<--Seleccione-->");

                DataTable tb = ConexionBD.Data("SELECT Id, concat(Nombre, ' ', Apellido) as Nombre FROM persona WHERE Roll_Id =" + 1 + " AND Sucursal_Id=" + sucuralId);

                if (tb.Rows.Count > 0 && (cxSucursal.Text != "<--Seleccione-->" || cxSucursal.Text != "0 - Todas"))
                {
                    //MessageBox.Show("aqui");
                    for (int j = 0; j < tb.Rows.Count; j++)
                    {
                        cxVendedor.Items.Add(tb.Rows[j]["Id"].ToString() + " - " + tb.Rows[j]["Nombre"].ToString());
                    }
                }
                cxVendedor.SelectedIndex = 0;
            }
        }