public static void FillGridView(DataGridView gv, DataTable myDataTable, bool autoGenColumns)
        {
            QUERY Tabla = new QUERY();

            gv.AutoGenerateColumns = autoGenColumns;
            gv.DataSource          = myDataTable;
        }
        public static void FillGridView(DataGridView gv, string TableName, bool autoGenColumns)
        {
            QUERY Tabla = new QUERY();

            gv.AutoGenerateColumns = autoGenColumns;
            gv.DataSource          = Tabla.GetRecords(TableName);
        }
 /// <summary>
 /// Permite validar los permisos en controles Windows forms
 /// </summary>
 /// <param name="objetoContenedor"></param>
 public static void habilitarPermisos(Control objetoContenedor, int perfil)
 {
     try
     {
         foreach (Control ctrl in objetoContenedor.Controls)
         {
             if (ctrl.Tag != null && ctrl.Tag.ToString().Length > 0)
             {
                 QUERY     Query = new QUERY();
                 string    sql   = "SELECT idRol,idComando FROM permiso p WHERE p.idRol = " + perfil + " and p.idComando =" + ctrl.Tag + " order by p.idComando;";
                 DataTable DTP   = Query.Consultar(sql);
                 if (DTP.Rows.Count > 0)
                 {
                     ctrl.Visible = true;
                 }
                 else
                 {
                     ctrl.Visible = false;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        public static void FillCombobox(DataGridViewComboBoxCell cbo, string TableName, string ValueMember, string DisplayMember)
        {
            QUERY Tabla = new QUERY();

            cbo.DataSource    = Tabla.GetRecords(TableName);
            cbo.DisplayMember = DisplayMember;
            cbo.ValueMember   = ValueMember;
        }