예제 #1
0
        public List <ArticleCategoryEntity> GetArticleCategoryEntitiesByPId(int PId, string orderBy)
        {
            List <SqlDbParameter> parmsCategory = new List <SqlDbParameter>();
            SqlDbParameter        parm          = new SqlDbParameter();

            parm.ColumnName        = "PId";
            parm.ParameterName     = "PId";
            parm.ColumnType        = DbType.Int32;
            parm.QualificationType = SqlDbParameter.QualificationSymbol.Equal;
            parm.ParameterValue    = PId; //3表示业务类别
            parmsCategory.Add(parm);

            ArticleCategoryDAL dal = new ArticleCategoryDAL();

            return(dal.GetAll(parmsCategory, orderBy));
        }
예제 #2
0
        public DataTable GetArticleDataTablePage(List <SqlDbParameter> parms, string OrderBy, int PageSize, int PageIndex, out int RecordCount)
        {
            ArticleDAL articleDAL = new ArticleDAL();
            DataTable  dataTable  = articleDAL.GetArticleDataTablePage(parms, OrderBy, PageSize, PageIndex, out RecordCount);
            //TO DO Cache
            ArticleCategoryDAL articleCategoryDAL = new ArticleCategoryDAL();

            parms = new List <SqlDbParameter>();
            List <ArticleCategoryEntity> articleCategory = articleCategoryDAL.GetAll(parms, "Id");

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                int _categoryId = 0;
                if (int.TryParse(dataTable.Rows[i]["CategoryId"].ToString(), out _categoryId))
                {
                    ArticleCategoryEntity articleCategoryEntity = articleCategory.Find(t => t.Id == _categoryId);
                    dataTable.Rows[i]["CategoryName"] = articleCategoryEntity == null ? "" : articleCategoryEntity.CategoryName;
                }
            }
            return(dataTable);
        }
예제 #3
0
        public List <ArticleCategoryEntity> GetArticleCategoryPaged(List <SqlDbParameter> parms, string OrderBy, int PageSize, int PageIndex, out int RecordCount)
        {
            ArticleCategoryDAL dal = new ArticleCategoryDAL();

            return(dal.GetAll(parms, OrderBy, PageSize, PageIndex, out RecordCount));
        }
예제 #4
0
        public List <ArticleCategoryEntity> GetAllArticleCategory(List <SqlDbParameter> parms, string orderBy)
        {
            ArticleCategoryDAL dal = new ArticleCategoryDAL();

            return(dal.GetAll(parms, orderBy));
        }