public RecSummaryEntity GetRecSummary(int recSummaryId) { DataTable dt = DB.GetDataTable(new SQLBuilder("Select Id, Species, Scientific, Location, Method from RecSummary where Id = @0", recSummaryId.ToString())); if (dt.Rows.Count == 0) return null; RecSummaryEntity rs = new RecSummaryEntity(); Framework.EntityPopulate(rs, dt.Rows[0]); return rs; }
public IList<RecSummaryEntity> GetRecSummaries(string filter) { DataTable dt = DB.GetDataTable(new SQLBuilder("Select Id, Species, Scientific, Location, Method from RecSummary where IsSWAT = 1 and (species like @0 or scientific like @0 or location like @0 or Method like @0 or species + '(' + scientific + ')' like @0) order by Species, Location, Method", "%" + filter + "%")); IList<RecSummaryEntity> recs = new List<RecSummaryEntity>(); foreach (DataRow dr in dt.Rows) { RecSummaryEntity rs = new RecSummaryEntity(); Framework.EntityPopulate(rs, dr); recs.Add(rs); } return recs; }