public static int getProxID() { try { DataSet ds = ExecuteQuery("Select p.* from Perfil_Externo p where p.Cod_perfilExt like (select MAX(Cod_perfilExt) from Perfil_Externo)", getConnection(true)); DataRow row = ds.Tables[0].Rows[0]; Perfil_Externo perfil = new Perfil_Externo(row); return perfil.CODPERFILEXT + 1; } catch (Exception e) { throw new ApplicationException("ErroBD", e); } }
public static IList LoadAll() { try { DataSet ds = ExecuteQuery("Select * From Perfil_Externo", getConnection(true)); IList list = new ArrayList(); foreach (DataRow row in ds.Tables[0].Rows) { Perfil_Externo estado = new Perfil_Externo(row); list.Add(estado); } return list; } catch (Exception e) { throw new ApplicationException("ErroBD", e); } }