Exemplo n.º 1
0
        //绑定搜索到的教师数据
        protected void TeacherDataListBind()
        {
            DalOperationAboutUserAuth dalua = new DalOperationAboutUserAuth();
            UserAuth auth = dalua.GetUserAuth(pageName);
            if (auth != null)
            {
                string ids = auth.userIds;
                string[] _ids = ids.Split(',');
                for (int i = 0; i < _ids.Length; i++)
                {
                    authIds.Add(_ids[i]);
                }
            }
            DalOperationUsers dal = new DalOperationUsers();
            string termValue = Request["termTag"];
            string teacherName = Request["teacherName"];
            DataBindSearchTermTagList(searchTeacherTermTag.Items, termValue);
            if (termValue == "all")
            {
                termValue = "";
            }
            else if(termValue == null || termValue.Trim().Length == 0) {
                termValue = searchTeacherTermTag.SelectedValue;
            }

            if (teacherName != null) {
                teacherName = teacherName.Trim();
                this.txtKeyword.Text = teacherName;
            }

            DataView dv = dal.SearchTeacherByTermTagAndKeyword(termValue, teacherName).DefaultView;

            this.TeacherListPager.RecordCount = dv.Count;
            PagedDataSource pds = new PagedDataSource();    //定义一个PagedDataSource类来执行分页功
            pds.DataSource = dv;
            pds.AllowPaging = true;

            pds.CurrentPageIndex = pageIndex - 1;
            pds.PageSize = CommonUtility.pageSize;

            this.dlSearchTeacher.DataSource = pds;
            this.dlSearchTeacher.DataBind();

            if (pds.Count > 0)
            {
                dlSearchTeacher.ShowFooter = false;
            }
        }
Exemplo n.º 2
0
        //绑定搜索到的教师数据
        protected void TeacherDataListBind()
        {
            DalOperationAboutUserAuth dalua = new DalOperationAboutUserAuth();
            UserAuth auth = dalua.GetUserAuth(pageName);
            if (auth != null)
            {
                string ids = auth.userIds;
                string[] _ids = ids.Split(',');
                for (int i = 0; i < _ids.Length; i++)
                {
                    authIds.Add(_ids[i]);
                }
            }

            DalOperationUsers dal = new DalOperationUsers();

            string keyWord = "";

            if (Request["teacherName"] != null)
            {
                keyWord = Request["teacherName"].Trim();
                this.txtKeyword.Text = keyWord;
            }

            DataView dv = dal.SearchTeacherByTermTagAndKeyword(null, keyWord, 0).DefaultView;

            this.TeacherListPager.RecordCount = dv.Count;
            PagedDataSource pds = new PagedDataSource();    //定义一个PagedDataSource类来执行分页功
            pds.DataSource = dv;
            pds.AllowPaging = true;

            pds.CurrentPageIndex = pageIndex - 1;
            pds.PageSize = CommonUtility.pageSize;

            this.dlSearchTeacher.DataSource = pds;
            this.dlSearchTeacher.DataBind();

            if (pds.Count == 0)
            {
                dlSearchTeacher.ShowFooter = true;
            }
            else
            {
                dlSearchTeacher.ShowFooter = false;
            }
        }