Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        public ArticleInfo GetDataOrderIdDESC()
        {
            ArticleInfo info   = new ArticleInfo();
            IDataReader reader = db.GetDataOrderIdDESC().CreateDataReader();

            if (reader.Read())
            {
                info = ArticleInfo.Populate(reader);
            }
            return(info);
        }
Пример #6
0
        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);
        }