Exemplo n.º 1
0
        private void txbBuscar_TextChanged(object sender, EventArgs e)
        {
            VentasNegocio        vent   = new VentasNegocio();
            List <ListadoVentas> listaV = new List <ListadoVentas>();

            listaV = (List <ListadoVentas>)vent.listar();

            if (txbBuscar.Text == "")
            {
                dgvListadoVentas.DataSource = listaV;
            }
            else
            {
                List <ListadoVentas> lista;
                lista = listaV.FindAll(venta => venta.strNombreC.Contains(txbBuscar.Text));
                dgvListadoVentas.DataSource = lista;
            }
        }
Exemplo n.º 2
0
        private void cargar()
        {
            VentasNegocio ventas = new VentasNegocio();

            try
            {
                dgvListadoVentas.DataSource = ventas.listar();
                dgvListadoVentas.AutoResizeColumns();
                dgvListadoVentas.Columns[0].HeaderText = "ID Venta";
                dgvListadoVentas.Columns[1].HeaderText = "Fecha Venta";
                dgvListadoVentas.Columns[2].HeaderText = "ID Cliente";
                dgvListadoVentas.Columns[3].HeaderText = "Nombre";
                dgvListadoVentas.Columns[4].HeaderText = "ID Pedido";
                dgvListadoVentas.Columns[5].HeaderText = "Fecha Entrega";
                dgvListadoVentas.Columns[6].HeaderText = "Valor";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }