/// <summary>
        /// 获取子节点数据
        /// </summary>
        /// <param name="pParentNodeID">父节点ID</param>
        /// <returns></returns>
        protected override TreeNodes GetNodes(string pParentNodeID)
        {
            TreeNodes nodes = new TreeNodes();

            var service = new ZCourseBLL(new SessionManager().CurrentUserLoginInfo);
            IList <ZCourseEntity> data = new List <ZCourseEntity>();
            string content             = string.Empty;

            string key = string.Empty;

            if (Request("node") != null && Request("node") != string.Empty)
            {
                key = Request("node").ToString().Trim();
            }
            if (key == "root")
            {
                key = "";
            }

            var queryEntity = new ZCourseEntity();

            queryEntity.ParentId = key;
            //queryEntity.ApplicationId = Request("ApplicationId");
            queryEntity.OrderBy = "CourseName asc";

            data = service.GetCourses(queryEntity, 0, 1000);

            var jsonData = new JsonData();

            jsonData.totalCount = data.Count.ToString();
            jsonData.data       = data;

            var parentCode = string.Empty;

            if (data.Count > 0)
            {
                foreach (var item in data)
                {
                    nodes.Add(item.CourseId, item.CourseName,
                              item.ParentId,
                              item.CourseLevel == 2 ? true : false);
                }
            }
            //
            //var root = new TreeNodes();
            //root.Add(new TreeNode() { ID = "1", IsLeaf = false, Text = "1" });
            //root.Add(new TreeNode() { ID = "1_1", ParentID = "1", IsLeaf = false, Text = "1_1" });
            //root.Add(new TreeNode() { ID = "1_1_1", ParentID = "1_1", IsLeaf = false, Text = "1_1_1`" });
            return(nodes);
        }
示例#2
0
        /// <summary>
        /// 列表获取
        /// </summary>
        public IList <ZCourseEntity> GetCourses(ZCourseEntity entity, int Page, int PageSize)
        {
            var zCourseReflectionsBLL = new ZCourseReflectionsBLL(CurrentUserInfo);
            var zCourseNewsMappingBLL = new ZCourseNewsMappingBLL(CurrentUserInfo);
            var lNewsBLL        = new LNewsBLL(CurrentUserInfo);
            var objectImagesBLL = new ObjectImagesBLL(CurrentUserInfo);

            if (PageSize <= 0)
            {
                PageSize = 15;
            }

            IList <ZCourseEntity> eventsList = new List <ZCourseEntity>();
            DataSet ds = new DataSet();

            ds = _currentDAO.GetCourses(entity, Page, PageSize);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                eventsList = DataTableToObject.ConvertToList <ZCourseEntity>(ds.Tables[0]);

                if (eventsList != null)
                {
                    foreach (var item in eventsList)
                    {
                        item.CourseReflectionsList = zCourseReflectionsBLL.GetList(new ZCourseReflectionsEntity()
                        {
                            CourseId = item.CourseId
                        }, 0, 10000);
                        var mapList = zCourseNewsMappingBLL.QueryByEntity(new ZCourseNewsMappingEntity()
                        {
                            CourseId = item.CourseId
                        }, null);
                        if (mapList != null)
                        {
                            item.NewsList = new List <LNewsEntity>();
                            foreach (var mapItem in mapList)
                            {
                                var newsObj = lNewsBLL.GetByID(mapItem.NewsId);
                                if (newsObj == null)
                                {
                                    continue;
                                }
                                item.NewsList.Add(new LNewsEntity()
                                {
                                    NewsId       = newsObj.NewsId,
                                    NewsTitle    = newsObj.NewsTitle,
                                    PublishTime  = newsObj.PublishTime,
                                    displayIndex = newsObj.displayIndex,
                                });
                            }
                        }
                        item.ImageList = objectImagesBLL.QueryByEntity(new ObjectImagesEntity()
                        {
                            ObjectId = item.CourseId
                        }, null).ToList();
                        if (item.ImageList.Count > 0)
                        {
                            item.ImageUrl = item.ImageList[0].ImageURL;
                        }
                    }
                }
            }
            return(eventsList);
        }
示例#3
0
 /// <summary>
 /// 列表数量获取
 /// </summary>
 public int GetCoursesCount(ZCourseEntity entity)
 {
     return(_currentDAO.GetCoursesCount(entity));
 }
示例#4
0
 public void Update(ZCourseEntity pEntity, bool pIsUpdateNullField, IDbTransaction pTran)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField, pTran);
 }
示例#5
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Update(ZCourseEntity pEntity, IDbTransaction pTran)
 {
     Update(pEntity, true, pTran);
 }
示例#6
0
 /// <summary>
 /// 在事务内创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Create(ZCourseEntity pEntity, IDbTransaction pTran)
 {
     _currentDAO.Create(pEntity, pTran);
 }
示例#7
0
 /// <summary>
 /// 创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Create(ZCourseEntity pEntity)
 {
     _currentDAO.Create(pEntity);
 }
示例#8
0
 /// <summary>
 /// 分页根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public PagedQueryResult <ZCourseEntity> PagedQueryByEntity(ZCourseEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex)
 {
     return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex));
 }
示例#9
0
 /// <summary>
 /// 根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public ZCourseEntity[] QueryByEntity(ZCourseEntity pQueryEntity, OrderBy[] pOrderBys)
 {
     return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys));
 }
示例#10
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Delete(ZCourseEntity pEntity, IDbTransaction pTran)
 {
     _currentDAO.Delete(pEntity, pTran);
 }
示例#11
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="pEntity"></param>
 public void Delete(ZCourseEntity pEntity)
 {
     _currentDAO.Delete(pEntity);
 }
示例#12
0
 public void Update(ZCourseEntity pEntity, bool pIsUpdateNullField)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField);
 }
示例#13
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Update(ZCourseEntity pEntity)
 {
     Update(pEntity, true);
 }