public List <ArticleInfo> GetDataById(int id) { List <ArticleInfo> infos = new List <ArticleInfo>(); IDataReader reader = db.GetDataByA_Id(id).CreateDataReader(); while (reader.Read()) { infos.Add(ArticleInfo.Populate(reader)); } return(infos); }
public ArticleInfo GetDataByAid(int id) { ArticleInfo info = new ArticleInfo(); IDataReader reader = db.GetDataByA_Id(id).CreateDataReader(); if (reader.Read()) { info = ArticleInfo.Populate(reader); } return(info); }
public List <ArticleInfo> GetDataByCategoryOrderSort(int ac_id) { List <ArticleInfo> infos = new List <ArticleInfo>(); IDataReader reader = db.GetDataByCategoryOrderSort(ac_id).CreateDataReader(); while (reader.Read()) { infos.Add(ArticleInfo.Populate(reader)); } return(infos); }
public List <ArticleInfo> getAllByShow(bool show) { List <ArticleInfo> infos = new List <ArticleInfo>(); IDataReader reader = db.GetDataByShow(show).CreateDataReader(); while (reader.Read()) { infos.Add(ArticleInfo.Populate(reader)); } return(infos); }
public ArticleInfo GetDataOrderIdDESC() { ArticleInfo info = new ArticleInfo(); IDataReader reader = db.GetDataOrderIdDESC().CreateDataReader(); if (reader.Read()) { info = ArticleInfo.Populate(reader); } return(info); }
public int GetDataByCategoryOrderSortDESC(int ac_id) { ArticleInfo info = new ArticleInfo(); IDataReader reader = db.GetDataByCategoryOrderSortDESC(ac_id).CreateDataReader(); if (reader.Read()) { info = ArticleInfo.Populate(reader); return(info.a_sorting + 1); } return(1); }