public void BinderData()
        {
            //获取视图顶级
            var ParentData = _channelService.GetAllByParent(0);

            repParent.DataSource = ParentData;
            repParent.DataBind();
        }
Esempio n. 2
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        public void BinderData(bool First = false)
        {
            int sourceCount           = 0;
            List <PMSParameters> pars = new List <PMSParameters>();

            if (!string.IsNullOrEmpty(txtChannelName.Text))
            {
                pars.Add("ChannelName", txtChannelName.Text.Trim().ToString(), NSqlTypes.LIKE);
            }

            if (ddlAllParentSystem.SelectedValue.ToInt32() > 0)
            {
                int ChannelId = ddlAllParentSystem.SelectedValue.ToInt32();
                pars.Add("Parent,ChannelId", ChannelId, NSqlTypes.OrInt);
            }
            else if (ddlAllParentSystem.SelectedValue.ToInt32() == 0)
            {
                pars.Add("Parent", 0, NSqlTypes.Equal);
            }

            var DataList = _channelService.GetAllByPager(pars, orderByName, CtrPageIndex.CurrentPageIndex, CtrPageIndex.PageSize, out sourceCount);

            CtrPageIndex.RecordCount = sourceCount;

            if (First == true)
            {
                if (Request["page"] != null)
                {
                    int page = Request.QueryString["page"].ToString().ToInt32();
                    CtrPageIndex.CurrentPageIndex = page;
                }
            }

            SavePage(CtrPageIndex);
            repChannel.DataSource = DataList;
            repChannel.DataBind();

            //获取视图顶级
            var ParentData = _channelService.GetAllByParent(0);

            repParent.DataSource = ParentData;
            repParent.DataBind();

            JsReload();
        }