コード例 #1
0
 private void DgvProductos_DataSourceChanged(object sender, EventArgs e)
 {
     try
     {
         bool[] columns_visible =
         {
             false, true, true
         };
         this.dgvProductos =
             DatagridString.ChangeColumnsVisible(this.dgvProductos, columns_visible);
     }
     catch (Exception ex)
     {
         Mensajes.MensajeErrorCompleto(this.Name, "DgvProductos_DataSourceChanged",
                                       "Hubo un error al cambiar las propiedades de la columna en el dgv", ex.Message);
     }
 }
コード例 #2
0
 private void BuscarEmpleados(string tipo_busqueda, string texto_busqueda)
 {
     try
     {
         string    rpta;
         DataTable Tabla =
             NEmpleados.BuscarEmpleados(tipo_busqueda, texto_busqueda, out rpta);
         this.dgvEmpleados.DataSource = Tabla;
         if (Tabla != null)
         {
             this.dgvEmpleados.Enabled = true;
             this.lblResultados.Text   = "Se encontraron " + Tabla.Rows.Count + " empleados";
             string[] columns_header_text =
             {
                 "Id empleado", "Nombre", "Teléfono", "Correo electrónico", "Cargo", "Contraseña", "Clave maestra", "Estado"
             };
             this.dgvEmpleados =
                 DatagridString.ChangeColumnsHeaderText(this.dgvEmpleados, columns_header_text);
             bool[] columns_visible =
             {
                 false, true, true, true, true, false, false, false, false
             };
             this.dgvEmpleados =
                 DatagridString.ChangeColumnsVisible(this.dgvEmpleados, columns_visible);
             this.CargarPanelColumnas(this.dgvEmpleados);
         }
         else
         {
             this.dgvEmpleados.Enabled = false;
             this.lblResultados.Text   = "No se encontraron empleados";
         }
     }
     catch (Exception ex)
     {
         Mensajes.MensajeErrorCompleto(this.Name, "BuscarEmpleados",
                                       "Hubo un error al buscar un empleado", ex.Message);
     }
 }
コード例 #3
0
 private void BuscarClientes(string tipo_busqueda, string texto_busqueda)
 {
     try
     {
         DataTable Tabla = NClientes.BuscarClientes(tipo_busqueda, texto_busqueda);
         this.dgvClientes.DataSource = Tabla;
         if (Tabla != null)
         {
             this.lblResultados.Text  = "Se encontraron " + Tabla.Rows.Count + " clientes";
             this.dgvClientes.Enabled = true;
             string[] columns_header_text =
             {
                 "Id cliente", "Nombre", "Teléfono", "Correo electrónico"
             };
             this.dgvClientes =
                 DatagridString.ChangeColumnsHeaderText(this.dgvClientes,
                                                        columns_header_text);
             bool[] columns_visible =
             {
                 false, true, true, true
             };
             this.dgvClientes =
                 DatagridString.ChangeColumnsVisible(this.dgvClientes,
                                                     columns_visible);
         }
         else
         {
             this.lblResultados.Text  = "No se encontraron clientes";
             this.dgvClientes.Enabled = false;
         }
     }
     catch (Exception ex)
     {
         Mensajes.MensajeErrorCompleto(this.Name, "BuscarClientes",
                                       "Hubo un error con la tabla de datos", ex.Message);
     }
 }
コード例 #4
0
        private void ActualizarProductos()
        {
            this.dgvProductos.DataSource =
                this.tablasPedido.dtVistaPedido();
            if (this.dgvProductos.DataSource != null)
            {
                bool[] columns_visible =
                {
                    false, true, true, true, true, true
                };
                this.dgvProductos = DatagridString.ChangeColumnsVisible(this.dgvProductos, columns_visible);
            }

            if (this.IsEditar)
            {
                this.dgvProductosEditar.DataSource =
                    this.tablasPedido.dtDetallePedidoEditado();
                bool[] columns_visible =
                {
                    false, true, true, true, true, true
                };
                this.dgvProductosEditar = DatagridString.ChangeColumnsVisible(this.dgvProductosEditar, columns_visible);
            }
        }