public bool Delete(int id)
        {
            try
            {
                var    campos = typeof(T).GetProperties();
                Type   Ttypo  = typeof(T);
                string sql    = "DELETE FROM " + typeof(T).Name + " WHERE " + campos[0].Name + "=";
                switch (Ttypo.GetProperty(campos[0].Name).PropertyType.Name)
                {
                case "String":
                    sql += "'" + id + "'";
                    break;

                default:
                    sql += " " + id;
                    break;
                }
                if (db.Comando(sql + ";"))
                {
                    Error = "";
                    return(true);
                }
                else
                {
                    Error = db.Error;
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Error = ex.Message;
                return(false);
            }
        }
 private bool EjecutarComando(string sql)
 {
     db = new DBMySQL();
     if (db.Comando(sql))
     {
         Error = "";
         db.CerrarConexion();
         return(true);
     }
     else
     {
         Error = db.Error;
         db.CerrarConexion();
         return(false);
     }
 }