public void GetByID(String id) { try { String query = String.Format(@"SELECT * FROM xCNBVCriterios WHERE IDCriterio = {0} ORDER BY IDCriterio", id); DataBaseSettings db = new DataBaseSettings(); DataTable aux = db.GetDataTable(query); if (aux.Rows.Count > 0) { this.criterio = aux.Rows[0]["Criterio"].ToString(); this.tipoOpcion = aux.Rows[0]["TipoOpcion"].ToString(); } else { throw new Exception(String.Format("Criterio con el ID {0} no fue encontrado", id)); } } catch (Exception ex) { throw ex; } }
public DataTable Get() { try { String query = String.Format(@"SELECT * FROM xCNBVCriterios ORDER BY IDCriterio"); DataBaseSettings db = new DataBaseSettings(); return(db.GetDataTable(query)); } catch (Exception ex) { throw ex; } }