Ejemplo n.º 1
0
        private void MyBind()
        {
            M_AdminInfo adminMod = B_Admin.GetLogin();

            Grade_Radio.DataSource = B_GradeOption.GetGradeList(6, 0);
            Grade_Radio.DataBind();
            if (Grade_Radio.Items.Count > 0)
            {
                Grade_Radio.SelectedIndex = 0;
            }
            NodeTree.DataSource = nodeBll.Select_All();
            NodeTree.MyBind();
            if (Mid > 0)
            {
                verMod                    = verBll.SelReturnModel(Mid);
                VName_T.Text              = verMod.VersionName;
                Inputer_T.Text            = verMod.Inputer;
                VTime_T.Text              = verMod.VersionTime;
                Grade_Radio.SelectedValue = verMod.Grade.ToString();
                Node_Hid.Value            = verMod.NodeID.ToString();
                Volume_T.Text             = verMod.Volume;
                SectionName_T.Text        = verMod.SectionName;
                CourseName_T.Text         = verMod.CourseName;
                Price_T.Text              = verMod.Price.ToString("f2");
                if (!string.IsNullOrEmpty(verMod.Knows))
                {
                    TagKey_T.Value = knowBll.GetNamesByIDS(verMod.Knows);
                }
            }
            else
            {
                Inputer_T.Text = adminMod.AdminName;
            }
        }
Ejemplo n.º 2
0
        //分类大全
        public ActionResult Classification()
        {
            AskAuth();
            //string type = "0";
            //if (!string.IsNullOrEmpty(Request.QueryString["type"]))
            //{
            //    type = Server.HtmlEncode(Request.QueryString["type"]);
            //}
            //if (!string.IsNullOrEmpty(Request.QueryString["ParentID"]))  //点击的是小类
            //{
            //    cateid = Server.HtmlEncode(Request.QueryString["ParentID"]);
            //    M_Grade grademod = B_GradeOption.GetGradeOption(DataConvert.CLng(Request.QueryString["ParentID"]));
            //    catename = grademod.GradeName;
            //    DataTable dt2 = B_GradeOption.GetGradeList(2, DataConvert.CLng(Request.QueryString["ParentID"]));
            //    Repeater1.DataSource = dt2;
            //    Repeater1.DataBind();
            //    if (!string.IsNullOrEmpty(Request.QueryString["GradeID"]))
            //    {
            //        gradeid = Server.HtmlEncode(Request.QueryString["GradeID"]);
            //    }

            //    SqlParameter[] sp = new SqlParameter[]
            //    {
            //    new SqlParameter("@gradeid",gradeid)
            //    };
            //    //dt3 = b_Ask.SelPage(type, pageSize, pageIndex, out itemCount, QueType: gradeid);
            //}
            //else if (!string.IsNullOrEmpty(Request.QueryString["GradeID"]))   //点击的是大类
            //{
            //    cateid = Server.HtmlEncode(Request.QueryString["GradeID"]);
            //    M_Grade grademod = B_GradeOption.GetGradeOption(DataConvert.CLng(Request.QueryString["GradeID"]));
            //    catename = grademod.GradeName;
            //    DataTable dt2 = B_GradeOption.GetGradeList(2, DataConvert.CLng(Request.QueryString["GradeID"]));
            //    Repeater1.DataSource = dt2;
            //    Repeater1.DataBind();
            //    DataTable dtChild = B_GradeOption.GetGradeList(2, DataConvert.CLng(cateid));
            //    List<int> cateids = new List<int>();
            //    cateids.Add(DataConvert.CLng(cateid));
            //    foreach (DataRow dr in dtChild.Rows)
            //    {
            //        cateids.Add(DataConvert.CLng(dr["GradeID"]));
            //    }
            //    //dt3 = b_Ask.Sel(strWhere + " and " + str, " AddTime desc", sp);//str与strwhere未污染
            //    //dt3 = b_Ask.SelPage(type, pageSize, pageIndex, out itemCount,Cateids:cateids);
            //}
            //else
            //{
            //    catename = "全部分类";
            //    DataTable dt = B_GradeOption.GetGradeList(2, 0);
            //    Repeater1.DataSource = dt;
            //    Repeater1.DataBind();
            //    //dt3 = b_Ask.Sel(str, " AddTime desc", null);
            //    //dt3 = b_Ask.SelPage(type, pageSize, pageIndex, out itemCount);
            //}
            ViewBag.askDt = B_GradeOption.GetGradeList(2, DataConverter.CLng(Request.QueryString["ParentID"]));
            return(View(new PageSetting()
            {
                itemCount = 0
            }));
        }
Ejemplo n.º 3
0
    protected void bindType()
    {
        DataTable dt = B_GradeOption.GetGradeList(2, 0);

        Repeater1.DataSource = dt;
        Repeater1.DataBind();
    }
        private void BindClass3(int gid, int pid)
        {
            classification3_D.Items.Clear();
            DataTable dt = B_GradeOption.GetGradeList(gid, pid);

            classification3_D.DataSource = dt;
            classification3_D.DataBind();
            classification3_D.Items.Insert(0, new ListItem("请选择分类", ""));
        }
Ejemplo n.º 5
0
 //在线提问
 public ActionResult Add()
 {
     AskAuth();
     ViewBag.title     = Server.HtmlEncode(Request["strWhere"]);
     ViewBag.typeDt    = B_GradeOption.GetGradeList(2, 0);
     ViewBag.islogin   = buser.CheckLogin();
     ViewBag.needlogin = GuestConfig.GuestOption.WDOption.IsLogin;
     return(View());
 }
Ejemplo n.º 6
0
        public IActionResult QuestList()
        {
            if (!B_ARoleAuth.AuthCheckEx(ZLEnum.Auth.exam, "paper"))
            {
                return(null);
            }
            int         NodeID  = DataConverter.CLng(RequestEx["nodeid"]);
            int         QType   = DataConverter.CLng(RequestEx["qtype"], 99);
            int         Diff    = DataConverter.CLng(RequestEx["diff"]);
            int         Version = DataConverter.CLng(RequestEx["version"]);
            string      KeyWord = RequestEx["keyWord"] ?? "";
            int         Grade   = DataConverter.CLng(RequestEx["grade"]);
            PageSetting setting = questBll.SelPageByFilter(CPage, PSize, NodeID, QType, Grade, Diff, Version, KeyWord, 0);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("QuestList_List", setting));
            }
            if (NodeID > 0)
            {
                ViewBag.nodename = classBll.GetSelect(NodeID).C_ClassName;
            }
            else if (Grade > 0)
            {
                ViewBag.nodename = new B_GradeOption().GetGradeOption(Grade).GradeName;
            }
            else
            {
                ViewBag.nodename = "全部试题";
            }
            ViewBag.nodeid = NodeID;
            ViewBag.grade  = Grade;
            ViewBag.qtype  = QType;
            DataTable gradeDt = gradeBll.GetGradeList(6, 0);
            DataRow   dr      = gradeDt.NewRow();

            dr["GradeName"] = "全部"; dr["GradeID"] = 0;
            gradeDt.Rows.InsertAt(dr, 0);
            ViewBag.gradelist = MVCHelper.ToSelectList(gradeDt, "GradeName", "GradeID");
            return(View(setting));
        }
Ejemplo n.º 7
0
        private void dBind()
        {
            int ParentID = DataConverter.CLng(this.HdnParentID.Value);

            this.Gdv.DataSource = B_GradeOption.GetGradeList(CateID, ParentID);
            if (CateID == 3)
            {
                Gdv.Columns[2].HeaderText = "分类";
            }                                                     //百科分类
            this.Gdv.DataKeyNames = new string[] { "GradeID" };
            this.Gdv.DataBind();
        }
 private void BindClass2(int gid)
 {
     classification2_D.Items.Clear();
     classification3_D.Items.Clear();
     if (!string.IsNullOrEmpty(classification_D.SelectedValue))
     {
         DataTable dt = B_GradeOption.GetGradeList(gid, 0);
         classification2_D.DataSource = dt;
         classification2_D.DataBind();
         classification2_D.Items.Insert(0, new ListItem("请选择分类", ""));
     }
 }
Ejemplo n.º 9
0
 protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) //指触发的类型为DadaList中的基本行或内容行
     {
         Repeater    rep  = e.Item.FindControl("Repeater2") as Repeater;                          //找到里层的repeater对象
         DataRowView rowv = (DataRowView)e.Item.DataItem;                                         //找到分类Repeater关联的数据项
         int         Gid  = DataConvert.CLng(rowv["GradeID"]);
         DataTable   dt   = B_GradeOption.GetGradeList(2, Gid);
         rep.DataSource = dt;
         rep.DataBind();
     }
 }
Ejemplo n.º 10
0
 public VM_Question(M_UserInfo mu)
 {
     gradeDT = B_GradeOption.GetGradeList(6, 0);
     verDT   = verBll.Sel();
     if (Mid > 0)
     {
         questMod = questBll.GetSelect(Mid);
         if (questMod.UserID != mu.UserID)
         {
             function.WriteErrMsg("你无权修改该试题");
         }
     }
 }
Ejemplo n.º 11
0
 private void BindGradeDrop(int CateID, int ParentID, ListItem item, int type)
 {
     if (type == 1)
     {
         this.DDLGrade1.DataSource     = B_GradeOption.GetGradeList(CateID, ParentID);
         this.DDLGrade1.DataTextField  = "GradeName";
         this.DDLGrade1.DataValueField = "GradeID";
         this.DDLGrade1.DataBind();
         this.DDLGrade1.Items.Insert(0, item);
     }
     else if (type == 2)
     {
         this.DDLGrade2.DataSource     = B_GradeOption.GetGradeList(CateID, ParentID);
         this.DDLGrade2.DataTextField  = "GradeName";
         this.DDLGrade2.DataValueField = "GradeID";
         this.DDLGrade2.DataBind();
         this.DDLGrade2.Items.Insert(0, item);
     }
     else if (type == 3)
     {
         this.DDLGrade3.DataSource     = B_GradeOption.GetGradeList(CateID, ParentID);
         this.DDLGrade3.DataTextField  = "GradeName";
         this.DDLGrade3.DataValueField = "GradeID";
         this.DDLGrade3.DataBind();
         this.DDLGrade3.Items.Insert(0, item);
     }
     else if (type == 4)
     {
         this.DDLGrade4.DataSource     = B_GradeOption.GetGradeList(CateID, ParentID);
         this.DDLGrade4.DataTextField  = "GradeName";
         this.DDLGrade4.DataValueField = "GradeID";
         this.DDLGrade4.DataBind();
         this.DDLGrade4.Items.Insert(0, item);
     }
     else if (type == 5)
     {
         this.DDLGrade5.DataSource     = B_GradeOption.GetGradeList(CateID, ParentID);
         this.DDLGrade5.DataTextField  = "GradeName";
         this.DDLGrade5.DataValueField = "GradeID";
         this.DDLGrade5.DataBind();
         this.DDLGrade5.Items.Insert(0, item);
     }
     else
     {
         this.DDLGrade6.DataSource     = B_GradeOption.GetGradeList(CateID, ParentID);
         this.DDLGrade6.DataTextField  = "GradeName";
         this.DDLGrade6.DataValueField = "GradeID";
         this.DDLGrade6.DataBind();
         this.DDLGrade6.Items.Insert(0, item);
     }
 }
Ejemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //根据不同的类型,传入不同的参数
            string    hasChild = "<a href='" + path + "QuestList.aspx?grade={0}' target='main_right' id='a{0}' class='list1' >{2}<span class='list_span'>{1}</span></a>";
            string    noChild  = "<a href='" + path + "QuestList.aspx?grade={0}' target='main_right'>{2}{1}</a>";
            DataTable nodeDT   = B_GradeOption.GetGradeList(6, 0);

            nodeDT.Columns["GradeID"].ColumnName   = "ID";
            nodeDT.Columns["GradeName"].ColumnName = "Name";
            string head = "<ul class='tvNav'><li class='menu_tit'><span class='fa fa-chevron-down'></span>试题管理</li>";

            head         += "<li><a class='list1' id='a0' href='" + path + "QuestList.aspx' target='main_right' ><span class='list_span'>全部试题</span><span class='fa fa-list'></span></a>";
            nodeHtml.Text = head + B_Node.GetLI(nodeDT, hasChild, noChild) + "</li></ul>";
        }
Ejemplo n.º 13
0
        public IActionResult AddVersion()
        {
            M_Exam_Version verMod = new M_Exam_Version();

            if (Mid > 0)
            {
                verMod = verBll.SelReturnModel(Mid);
            }
            C_TreeTlpDP treeMod = GetTreeMod();

            ViewBag.treeMod = treeMod;
            ViewBag.gradeDT = gradeBll.GetGradeList(6, 0);
            return(View(verMod));
        }
        public VM_QuestManage(HttpRequestBase Request)
        {
            this.mu = tubll.GetLogin();
            M_Temp tempMod = tempBll.SelModelByUid(mu.UserID, 10);

            if (tempMod == null)
            {
                tempMod = new M_Temp();
            }
            gradeDT    = B_GradeOption.GetGradeList(6, 0);
            verDT      = verBll.Sel();
            QListCount = questBll.GetCountByIDS(tempMod.Str1);
            //function.Script(this, "RenderQList(" + list + ");");
            QuestType_Lit = GetTreeStr(FillQuest(nodeBll.SelectQuesClasses()), 0, "quest");
        }
Ejemplo n.º 15
0
        public ActionResult AddClassRoom()
        {
            M_ClassRoom croomMod = croomBll.SelReturnModel(Mid);

            if (croomMod == null)
            {
                croomMod = new M_ClassRoom();
            }
            ViewBag.gradelist = MVCHelper.ToSelectList(B_GradeOption.GetGradeList(6, 0), "GradeName", "GradeID", croomMod.Grade.ToString());
            int      sid    = croomMod.RoomID > 0 ? croomMod.SchoolID : DataConverter.CLng(Request.QueryString["sid"]);
            M_School schMod = schBll.SelReturnModel(sid);

            ViewBag.schName = schMod == null ? "" : schMod.SchoolName;
            ViewBag.teaName = buser.SelReturnModel(croomMod.CreateUser).UserName;
            return(View(croomMod));
        }
Ejemplo n.º 16
0
        public ActionResult AddKnowledge()
        {
            int NodeID = DataConverter.CLng(Request.QueryString["nid"]);

            if (NodeID > 0)
            {
                ViewBag.cname = classBll.GetSelect(NodeID).C_ClassName;
            }
            M_Questions_Knowledge knowMod = knowBll.SelReturnModel(Mid);

            if (knowMod == null)
            {
                knowMod = new M_Questions_Knowledge();
            }
            ViewBag.gradelist = MVCHelper.ToSelectList(B_GradeOption.GetGradeList(6, 0), "GradeName", "GradeID", knowMod.Grade.ToString());
            return(View(knowMod));
        }
 //从字典获取相关试题类型
 public void InitQuestGrade()
 {
     //难度
     //rblDiff.DataSource = B_GradeOption.GetGradeList(5, 0);
     //rblDiff.DataBind();
     //if (rblDiff.Items.Count > 0) { rblDiff.Items[0].Selected = true; }
     //年级
     Grade_Radio.DataSource = B_GradeOption.GetGradeList(6, 0);
     Grade_Radio.DataBind();
     if (Grade_Radio.Items.Count > 0)
     {
         Grade_Radio.Items[0].Selected = true;
     }
     Version_Rad.DataSource = verBll.Sel();
     Version_Rad.DataBind();
     if (Version_Rad.Items.Count > 0)
     {
         Version_Rad.Items[0].Selected = true;
     }
 }
Ejemplo n.º 18
0
        public ActionResult AddVersion()
        {
            int Pid    = DataConverter.CLng(Request.QueryString["pid"]);
            int action = 0;

            if (Mid > 0)//修改
            {
                M_Exam_Version Mod = verBll.SelReturnModel(Mid);
                if (Mod.Pid > 0)
                {
                    M_Exam_Version pverMod = verBll.SelReturnModel(Mod.Pid);
                    if (pverMod.Pid > 0)
                    {
                        action = -3;
                    }                                    //修改课程、知识点
                    else
                    {
                        action = -2;
                    }                    //修改章节
                }
                else
                {
                    action = -1;
                }                    //修改版本
            }
            else//添加
            {
                if (Pid > 0)
                {
                    M_Exam_Version pverMod = verBll.SelReturnModel(Pid);
                    if (pverMod.Pid > 0)
                    {
                        action = 3;
                    }                                    //添加课程,知识点
                    else
                    {
                        action = 2;
                    }                   //添加章节
                }
                else
                {
                    action = 1;
                }                   //添加版本
            }
            M_Exam_Version verMod = verBll.SelReturnModel(Mid);

            if (verMod == null)
            {
                verMod = new M_Exam_Version();
            }
            switch (action)
            {
            case 2:
            case 3:
                LoadParent(Pid, verMod, action);
                break;

            case -2:
            case -3:
                LoadParent(verMod.Pid, verMod, action);
                break;
            }

            ViewBag.action  = action;
            ViewBag.tagkey  = string.IsNullOrEmpty(verMod.Knows) ? "" : knowBll.GetNamesByIDS(verMod.Knows);
            ViewBag.inputer = verMod.ID > 0 ? verMod.Inputer : badmin.GetAdminLogin().UserName;
            C_TreeTlpDP treeMod = GetTreeMod();

            if (verMod.ID <= 0 && Pid > 0)
            {
                treeMod.seled = verBll.SelReturnModel(Pid).NodeID.ToString();
            }
            else if (verMod.NodeID > 0)
            {
                treeMod.seled = verMod.NodeID.ToString();
            }
            ViewBag.treeMod = treeMod;//TreeTlp_Hid
            ViewBag.gradedt = B_GradeOption.GetGradeList(6, 0);
            return(View(verMod));
        }
Ejemplo n.º 19
0
        public string GetGrade(string value)
        {
            DataTable dt = B_GradeOption.GetGradeList(2, DataConvert.CLng(value));

            return(JsonConvert.SerializeObject(dt));
        }
Ejemplo n.º 20
0
 public void GradeBind()
 {
     GradeList_Drop.DataSource = B_GradeOption.GetGradeList(6, 0);
     GradeList_Drop.DataBind();
 }
Ejemplo n.º 21
0
 public void MyBind()
 {
     RPT.DataSource = B_GradeOption.GetGradeList(CateID, 0);
     RPT.DataBind();
 }
Ejemplo n.º 22
0
        private void MyBind()
        {
            M_UserInfo mu = buser.GetLogin();

            Grade_Radio.DataSource = B_GradeOption.GetGradeList(6, 0);
            Grade_Radio.DataBind();
            if (Grade_Radio.Items.Count > 0)
            {
                Grade_Radio.SelectedIndex = 0;
            }
            NodeTree.DataSource = nodeBll.Select_All();
            NodeTree.MyBind();
            if (Mid > 0)
            {
                verMod                    = verBll.SelReturnModel(Mid);
                VName_T.Text              = verMod.VersionName;
                Inputer_L.Text            = verMod.Inputer;
                VTime_T.Text              = verMod.VersionTime;
                Grade_Radio.SelectedValue = verMod.Grade.ToString();
                NodeID_Hid.Value          = verMod.NodeID.ToString();
                Volume_T.Text             = verMod.Volume;
                Chapter_T.Text            = verMod.Chapter;
                SectionName_T.Text        = verMod.SectionName;
                CourseName_T.Text         = verMod.CourseName;
                Price_T.Text              = verMod.Price.ToString("f2");
                if (!string.IsNullOrEmpty(verMod.Knows))
                {
                    TagKey_T.Value = knowBll.GetNamesByIDS(verMod.Knows);
                }
                if (mu.UserID != verMod.UserID)
                {
                    function.WriteErrMsg("你无权修改该信息");
                }
            }
            else
            {
                Inputer_L.Text = mu.UserName;
            }
            switch (WorkStatus)
            {
            case 1:    //添加版本教材
            case -1:   //修改版本教材
            {
                //Chapter_Tr.Visible = false;
                //Section_Body.Visible = false;
            }
            break;

            case 2:    //添加章节
            {
                LoadParent(Pid);
                //Section_Body.Visible = false;
            }
            break;

            case 3:    //添加知识点
            {
                LoadParent(Pid);
            }
            break;

            case -2:
            {
                verMod = verBll.SelReturnModel(Mid);
                LoadParent(verMod.Pid);
                //Section_Body.Visible = false;
            }
            break;

            case -3:
            {
                verMod = verBll.SelReturnModel(Mid);
                LoadParent(verMod.Pid);
            }
            break;
            }
        }