예제 #1
0
        /// <summary>
        /// �����ݵ�GridViewPostList
        /// </summary>
        protected void BindData()
        {
            ExtendBLL.Post post = new ExtendBLL.Post();
            DataSet ds = new DataSet();

            if (DropDownListSections.SelectedValue == "-1") // ȫ��
            {
                ds = post.GetAllWithFullInfo();
            }
            else
            {
                if (DropDownListPlates.SelectedValue == "-1") // �����µ�ȫ��
                {
                    ds = post.GetAllWithFullInfoInSection(int.Parse(DropDownListSections.SelectedValue));
                }
                else // �ض����
                {
                    ds = post.GetAllWithFullInfo(int.Parse(DropDownListPlates.SelectedValue));
                }
            }

            ds = HandleData(ds);

            GridViewPostList.DataSource = ds.Tables[0].DefaultView;
            GridViewPostList.DataBind();
        }
예제 #2
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        protected void BindData()
        {
            if (!string.IsNullOrEmpty(Request.QueryString["plateID"]))
            {
                int id = 0;

                if (!int.TryParse(Request.QueryString["plateID"], out id))
                {
                    throw new Exception("你所访问的页面不存在!");
                }

                ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate();
                LabMS.Model.PostPlate ppInfo = pp.GetModel(id);

                if (ppInfo == null)
                {
                    throw new Exception("当前版块已经在另一处被删除!");
                }

                ExtendBLL.Post post = new ExtendBLL.Post();
                DataSet dsWholePosts = post.GetAllWithFullInfo(ppInfo.ID);

                AspNetPager.RecordCount = dsWholePosts.Tables[0].Rows.Count;

                HandleData(dsWholePosts);
            }
            else
            {
                throw new Exception("你所访问的页面不存在!");
            }
        }