public static Info FindByID(int id) { InfoGateway info_gtw = new InfoGateway(); DataTable dt = info_gtw.FindByID(id); if (dt.Rows.Count == 0) { return(new Info(-1, "ERROR", "ERROR", "ERROR", new DateTime(0, DateTimeKind.Local))); } DataRow dr = dt.Rows[0]; return(MapResultsetToObject(dr)); }
public static List <Info> Find() { List <Info> infoList = new List <Info>(); InfoGateway info_gtw = new InfoGateway(); DataTable dt = info_gtw.Find(); foreach (DataRow dr in dt.Rows) { infoList.Add(MapResultsetToObject(dr)); } return(infoList); }