public List <GBmessageInfo> GetDataByCategoryId(int gbc_id) { List <GBmessageInfo> infos = new List <GBmessageInfo>(); IDataReader reader = db.GetDataByCategoryId(gbc_id).CreateDataReader(); while (reader.Read()) { infos.Add(GBmessageInfo.Populate(reader)); } return(infos); }
public GBmessageInfo GetDataById(int gb_id) { GBmessageInfo info = new GBmessageInfo(); IDataReader reader = db.GetDataById(gb_id).CreateDataReader(); if (reader.Read()) { info = GBmessageInfo.Populate(reader); } return(info); }