Ejemplo n.º 1
0
        private void BindData()
        {
            this.page = RequestHelper.GetQueryInt("page", 1);

            DataTable dtids = new BLL.examination_question().GetViewList("View_ExaminationQuestion", " group_id = " + group + " and exa_id = " + exaid);
            string    ids   = string.Empty;

            foreach (DataRow item in dtids.Rows)
            {
                ids += Convert.ToInt32(item["id"]) + ",";
            }

            ids = Utils.DelLastComma(ids);

            string where = " group_id = " + this.group + " and data_id = " + this.chapter;
            if (!string.IsNullOrEmpty(ids))
            {
                where += " and id not in (" + ids + ") ";
            }

            BLL.common_questions bLL = new BLL.common_questions();
            DataTable            dt  = bLL.GetListByPage(where, "id", this.page, this.pageSize);

            this.rptList.DataSource = dt;
            this.rptList.DataBind();

            this.totalCount = bLL.GetRecordCount(where);

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("unselected_question.aspx", "exaid={0}&page={1}&group={2}", this.exaid + "", "__id__", this.group + "");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 2
0
        private void BindData()
        {
            #region 组装查询条件
            string whereStr  = " 1 = 1 ";
            string _keywords = keywords.Replace("'", "");

            if (!string.IsNullOrEmpty(_keywords))
            {
                if (Utils.IsSafeSqlString(_keywords))
                {
                    whereStr += " and (Title like  '%" + _keywords + "%')";
                }
                else
                {
                    JscriptMsg("搜索关键词中包含危险字符,检索终止!", Utils.CombUrlTxt("Manage.aspx", "keywords={0}", ""));
                    return;
                }
            }
            #endregion

            this.page        = RequestHelper.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            BLL.common_questions bll = new BLL.common_questions();
            this.rptList.DataSource = bll.GetListByPage(whereStr, "ID DESC", this.page, this.pageSize);
            this.rptList.DataBind();

            this.totalCount = bll.GetRecordCount(whereStr);
            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("Manage.aspx", "keywords={0}&page={1}", this.keywords, "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
        private void BindData()
        {
            #region 组装查询条件
            string whereStr  = " data_id = " + this.chapter;
            string _keywords = keywords.Replace("'", "");

            if (!string.IsNullOrEmpty(_keywords))
            {
                if (Utils.IsSafeSqlString(_keywords))
                {
                    whereStr += " and (Title like  '%" + _keywords + "%')";
                }
                else
                {
                    JscriptMsg("搜索关键词中包含危险字符,检索终止!", Utils.CombUrlTxt("questions_list.aspx", "keywords={0}&chapter={1}", "", this.chapter + ""));
                    return;
                }
            }

            if (this.group > 0)
            {
                this.ddlGroup.SelectedValue = this.group + "";
                whereStr += " and group_id = " + this.group;
            }

            if (this.type > 0)
            {
                this.ddlType.SelectedValue = this.type + "";
                whereStr += " and type = " + this.type;
            }
            #endregion

            this.page        = RequestHelper.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            BLL.common_questions bll = new BLL.common_questions();
            this.rptList.DataSource = bll.GetListByPage(whereStr, "ID DESC", this.page, this.pageSize);
            this.rptList.DataBind();

            this.totalCount = bll.GetRecordCount(whereStr);
            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("questions_list.aspx", "keywords={0}&page={1}&type={2}&group={3}&chapter={4}", this.keywords, "__id__", this.type + "", this.group + "", this.chapter + "");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 4
0
        private void BindData()
        {
            BLL.course_chapter   ccBll   = new BLL.course_chapter();
            Model.course_chapter chapter = ccBll.GetModel(this.chapter);
            if (chapter == null)
            {
                JscriptMsg("没有此节", "back");
                return;
            }

            this.chapter_name = chapter.name;
            Model.course_chapter pModel = ccBll.GetModel(chapter.parent_id);
            if (pModel == null)
            {
                JscriptMsg("没有此章", "back");
                return;
            }

            this.parent_name = pModel.name;
            Model.classroom_info ciModel = new BLL.classroom_info().GetModel(pModel.course_id);
            if (ciModel == null)
            {
                JscriptMsg("没有此课堂", "back");
                return;
            }

            this.class_name = ciModel.name;
            Model.user_info user = new BLL.user_info().GetModel(" phone = '" + adminInfo.user_name + "' ");
            if (user == null)
            {
                JscriptMsg("没有此教师", "back");
                return;
            }

            if (ciModel.user_id != user.id)
            {
                JscriptMsg("此课堂不属于你", "back");
                return;
            }

            Model.common_examination exaModel = new BLL.common_examination().GetModel(this.exa_id);
            if (exaModel == null)
            {
                JscriptMsg("没有此作业", "back");
                return;
            }

            this.examination = exaModel.name;
            #region 组装查询条件
            string whereStr = " 1 = 1 ";

            DataTable dtids = new BLL.examination_question().GetList(" exa_id = " + this.exa_id);
            string    ids   = string.Empty;
            foreach (DataRow item in dtids.Rows)
            {
                ids += Convert.ToInt32(item["q_id"]) + ",";
            }

            ids = Utils.DelLastComma(ids);

            if (!string.IsNullOrEmpty(ids))
            {
                whereStr += " and id in (" + ids + ") ";
            }


            string _keywords = keywords.Replace("'", "");

            if (!string.IsNullOrEmpty(_keywords))
            {
                if (Utils.IsSafeSqlString(_keywords))
                {
                    whereStr += " and (Title like  '%" + _keywords + "%')";
                }
                else
                {
                    JscriptMsg("搜索关键词中包含危险字符,检索终止!", Utils.CombUrlTxt("currect_question_list.aspx", "keywords={0}", ""));
                    return;
                }
            }

            if (this.type > 0)
            {
                this.ddlType.SelectedValue = this.type + "";
                whereStr += " and type = " + this.type;
            }
            #endregion

            this.page        = RequestHelper.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            BLL.common_questions bll = new BLL.common_questions();
            this.rptList.DataSource = bll.GetListByPage(whereStr, "ID", this.page, this.pageSize);
            this.rptList.DataBind();

            this.totalCount = bll.GetRecordCount(whereStr);
            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("currect_question_list.aspx", "keywords={0}&page={1}&type={2}", this.keywords, "__id__", this.type + "");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }