// Token: 0x06000078 RID: 120 RVA: 0x0000AAF4 File Offset: 0x00008CF4 protected override void View() { this.channellist = ChannelBll.GetChannelList(); if (this.channelid == 0 && this.channellist.Count > 0) { this.channelid = this.channellist[0].id; } if (this.ispost) { if (!this.isperm) { this.ShowErr("对不起,您没有权限操作。"); return; } int @int = FPRequest.GetInt("id"); if (this.action.Equals("delete")) { SortInfo sortInfo = DbHelper.ExecuteModel <SortInfo>(@int); if (DbHelper.ExecuteDelete <SortInfo>(@int) > 0) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendFormat("DELETE FROM [{0}WMS_SortInfo] WHERE [id] IN (SELECT [id] FROM [{0}WMS_SortInfo] WHERE [parentlist] LIKE '{1},%');", DbConfigs.Prefix, sortInfo.parentlist); stringBuilder.AppendFormat("UPDATE [{0}WMS_SortInfo] SET [subcounts]=[subcounts]-1 WHERE [id]={1};", DbConfigs.Prefix, sortInfo.parentid); DbHelper.ExecuteSql(stringBuilder.ToString()); } } FPCache.Remove("FP_SORTTREE" + this.channelid.ToString()); base.Response.Redirect("sortmanage.aspx?channelid=" + this.channelid); } this.sortlist = SortBll.GetSortList(this.channelid, 0); base.SaveRightURL(); }
// Token: 0x0600009F RID: 159 RVA: 0x0000F068 File Offset: 0x0000D268 protected override void View() { this.channelinfo = ChannelBll.GetChannelInfo(this.channelid); if (this.channelinfo.id == 0) { this.ShowErr("考试频道不存在或已被删除。"); } else { this.sortlist = SortBll.GetSortList(this.channelid, 0); List <SqlParam> list = new List <SqlParam>(); list.Add(DbHelper.MakeAndWhere("status", 1)); if (this.channelid > 0) { list.Add(DbHelper.MakeAndWhere("channelid", this.channelid)); } if (this.sortid > 0) { string childSorts = SortBll.GetChildSorts(this.sortid); list.Add(DbHelper.MakeAndWhere("sortid", WhereType.In, childSorts)); } if (FPUtils.IsNumericArray(this.typeid)) { StringBuilder stringBuilder = new StringBuilder(); foreach (int num in FPUtils.SplitInt(this.typeid)) { if (!string.IsNullOrEmpty(stringBuilder.ToString())) { stringBuilder.Append(" OR "); } stringBuilder.AppendFormat("(','+[typelist]+',') LIKE '%,{0},%'", num); } list.Add(DbHelper.MakeAndWhere("(" + stringBuilder.ToString() + ")", WhereType.Custom, "")); } list.Add(DbHelper.MakeAndWhere(string.Format("(([examroles]='' AND [examdeparts]='' AND [examuser]='') OR (','+[examroles]+',') LIKE '%,{0},%' OR (','+[examdeparts]+',') LIKE '%,{1},%' OR (','+[examuser]+',') LIKE '%,{2},%')", this.roleid, this.departid, this.userid), WhereType.Custom, "")); this._examlist = DbHelper.ExecuteList <ExamInfo>(this.pager, list.ToArray()); this.pagenav = this.channelinfo.name; } }
// Token: 0x06000055 RID: 85 RVA: 0x0000924C File Offset: 0x0000744C protected string ShowChildSort(int parentid, string tree) { List <SortInfo> sortList = SortBll.GetSortList(this.channelid, parentid); StringBuilder stringBuilder = new StringBuilder(); tree = "│ " + tree; foreach (SortInfo sortInfo in sortList) { if (base.ischecked(sortInfo.id, this.role.sorts) || this.roleid == 1) { stringBuilder.Append("<tr class=\"tlist\" onmouseover=\"curcolor=this.style.backgroundColor;this.style.backgroundColor='#cbe3f4'\" onmouseout=\"this.style.backgroundColor=curcolor\">"); stringBuilder.AppendLine("<td align=\"left\">" + tree); string text = ""; if (sortInfo.hidden == 1) { text = "_hidden"; } if (sortInfo.icon != "") { stringBuilder.AppendLine("<img src=\"" + sortInfo.icon + "\" width=\"16\" height=\"16\" />"); } else if (sortInfo.subcounts > 0) { stringBuilder.AppendLine(string.Concat(new string[] { "<img src=\"", this.adminpath, "images/folders", text, ".gif\" width=\"16\" height=\"16\" />" })); } else { stringBuilder.AppendLine(string.Concat(new string[] { "<img src=\"", this.adminpath, "images/folder", text, ".gif\" width=\"16\" height=\"16\" />" })); } stringBuilder.AppendLine(string.Concat(new object[] { sortInfo.name, "(", this.GetQuestionCount(sortInfo.id), ")</td>" })); stringBuilder.AppendLine("<td>" + this.GetCurCount(sortInfo.id) + "</td>"); stringBuilder.AppendLine(string.Concat(new object[] { "<td><input id=\"randomcount_", sortInfo.id, "\" name=\"randomcount_", sortInfo.id, "\" value=\"", this.GetRandomCount(sortInfo.id), "\" type=\"text\" /> </td>" })); stringBuilder.AppendLine("</tr>"); stringBuilder.Append(this.ShowChildSort(sortInfo.id, tree)); } } return(stringBuilder.ToString()); }
// Token: 0x06000052 RID: 82 RVA: 0x00008B8C File Offset: 0x00006D8C protected override void View() { this.examtopic = DbHelper.ExecuteModel <ExamTopic>(this.examtopicid); this.examinfo = DbHelper.ExecuteModel <ExamInfo>(this.examtopic.examid); this.sortinfo = SortBll.GetSortInfo(this.examinfo.sortid); this.channelinfo = ChannelBll.GetChannelInfo("exam_question"); this.channelid = this.channelinfo.id; this.sortlist = SortBll.GetSortList(this.channelid, 0); if (this.ispost) { string text = ""; string text2 = ""; SqlParam sqlParam = DbHelper.MakeAndWhere("channelid", this.channelid); List <SortInfo> list = DbHelper.ExecuteList <SortInfo>(new SqlParam[] { sqlParam }); int num = 0; foreach (SortInfo sortInfo in list) { int @int = FPRequest.GetInt("randomcount_" + sortInfo.id); if (@int > 0) { if (text != "") { text += ","; } text += sortInfo.id; if (text2 != "") { text2 += ","; } text2 += @int; num += @int; } } if (num > this.examtopic.questions - this.examtopic.curquestions) { this.ShowErr("设定的随机题数不能大于总随机题数。"); return; } if (this.action == "save") { SqlParam[] sqlparams = new SqlParam[] { DbHelper.MakeSet("randomsort", text), DbHelper.MakeSet("randomcount", text2), DbHelper.MakeSet("randoms", num), DbHelper.MakeAndWhere("id", this.examtopicid) }; DbHelper.ExecuteUpdate <ExamTopic>(sqlparams); base.AddMsg("随机题设置保存成功!"); this.examtopic.randomsort = text; this.examtopic.randomcount = text2; this.link = string.Concat(new object[] { "examtopicrandom.aspx?examtopicid=", this.examtopicid, "&paper=", this.paper }); } else if (this.action == "create") { string text3 = this.examtopic.questionlist; int[] array = FPUtils.SplitInt(text); int[] array2 = FPUtils.SplitInt(text2, ",", array.Length); for (int i = 0; i < array.Length; i++) { if (array2[i] > 0) { string questionRandom = QuestionBll.GetQuestionRandom(this.channelid, array2[i], this.examtopic.type.ToString(), array[i], text3); if (questionRandom != "") { text3 += ((text3 == "") ? questionRandom : ("," + questionRandom)); } } } this.examtopic.questionlist = text3; this.examtopic.curquestions = FPUtils.SplitInt(this.examtopic.questionlist).Length; SqlParam[] sqlparams = new SqlParam[] { DbHelper.MakeSet("questionlist", this.examtopic.questionlist), DbHelper.MakeSet("curquestions", this.examtopic.curquestions), DbHelper.MakeSet("randomsort", ""), DbHelper.MakeSet("randomcount", ""), DbHelper.MakeSet("randoms", 0), DbHelper.MakeAndWhere("id", this.examtopicid) }; DbHelper.ExecuteUpdate <ExamTopic>(sqlparams); base.AddMsg("生成随机题目成功!"); this.link = string.Concat(new object[] { "examtopicmanage.aspx?examid=", this.examtopic.examid, "&paper=", this.paper, "&examtopicid=", this.examtopicid }); } } int[] array3 = FPUtils.SplitInt(this.examtopic.randomsort); int[] array4 = FPUtils.SplitInt(this.examtopic.randomcount, ",", array3.Length); for (int i = 0; i < array3.Length; i++) { this.randomlist.Add(array3[i], array4[i]); } SqlParam sqlParam2 = DbHelper.MakeAndWhere("id", WhereType.In, this.examtopic.questionlist); this.questionlist = DbHelper.ExecuteList <ExamQuestion>(new SqlParam[] { sqlParam2 }); foreach (ExamQuestion examQuestion in this.questionlist) { if (this.curlist.ContainsKey(examQuestion.sortid)) { this.curlist[examQuestion.sortid] = this.curlist[examQuestion.sortid] + 1; } else { this.curlist.Add(examQuestion.sortid, 1); } } base.SaveRightURL(); }
// Token: 0x06000079 RID: 121 RVA: 0x0000AC4C File Offset: 0x00008E4C protected string ShowChildSort(int parentid, string tree) { List <SortInfo> sortList = SortBll.GetSortList(this.channelid, parentid); StringBuilder stringBuilder = new StringBuilder(); tree = "│ " + tree; foreach (SortInfo sortInfo in sortList) { stringBuilder.AppendLine("<tr class=\"tlist\" onmouseover=\"curcolor=this.style.backgroundColor;this.style.backgroundColor='#cbe3f4'\" onmouseout=\"this.style.backgroundColor=curcolor\">"); stringBuilder.AppendLine("<td align=\"center\">" + sortInfo.id + "</td>"); stringBuilder.AppendLine("<td align=\"left\">" + tree); string text = ""; if (sortInfo.hidden == 1) { text = "_hidden"; } if (sortInfo.icon == "") { if (sortInfo.subcounts > 0) { sortInfo.icon = string.Concat(new string[] { this.webpath, (this.sysconfig.adminpath == "") ? "" : (this.sysconfig.adminpath + "/"), "images/folders", text, ".gif" }); } else { sortInfo.icon = string.Concat(new string[] { this.webpath, (this.sysconfig.adminpath == "") ? "" : (this.sysconfig.adminpath + "/"), "images/folder", text, ".gif" }); } } stringBuilder.Append("<img src=\"" + sortInfo.icon + "\" width=\"16\" height=\"16\" />"); if (sortInfo.subcounts > 0) { stringBuilder.Append("<span style=\"font-weight:bold;\">" + sortInfo.name + "</span></td>"); } else { stringBuilder.Append(sortInfo.name + "</td>"); } stringBuilder.AppendLine("<td>" + sortInfo.markup + "</td>"); if (sortInfo.SortAppInfo.name != "") { stringBuilder.AppendLine("<td>" + sortInfo.SortAppInfo.name + "</td>"); } else { stringBuilder.AppendLine("<td>无</td>"); } stringBuilder.AppendLine(string.Concat(new object[] { "<td><a style=\"color: #1317fc\" href=\"sortadd.aspx?channelid=", this.channelid, "&parentid=", sortInfo.id, "\">添加子栏目</a></td>" })); stringBuilder.AppendLine(string.Concat(new object[] { "<td><a style=\"color: #1317fc\" href=\"sortadd.aspx?channelid=", this.channelid, "&id=", sortInfo.id, "\">编辑</a></td>" })); stringBuilder.AppendLine("<td><a id=\"submitdel\" onclick=\"DeleteSort(" + sortInfo.id + ")\" href=\"#\">删除</a></td>"); stringBuilder.AppendLine(string.Concat(new object[] { "<td><a style=\"color: #1317fc\" href=\"sortdisplay.aspx?channelid=", this.channelid, "&parentid=", sortInfo.parentid, "\">排序</a></td></tr>" })); stringBuilder.Append(this.ShowChildSort(sortInfo.id, tree)); } return(stringBuilder.ToString()); }
// Token: 0x06000080 RID: 128 RVA: 0x0000CD80 File Offset: 0x0000AF80 private string GetSortTree(int channelid, int parentid) { List <SortInfo> sortList = SortBll.GetSortList(channelid, parentid); string text = ""; foreach (SortInfo sortInfo in sortList) { if (base.ischecked(sortInfo.id, this.role.sorts) || this.roleid == 1) { string text2 = string.Format("examtopicselect.aspx?examtopicid={0}&sortid={1}&paper={2}", this.examtopicid, sortInfo.id, this.paper); string childSorts = SortBll.GetChildSorts(sortInfo.id); SqlParam[] sqlparams = new SqlParam[] { DbHelper.MakeAndWhere("sortid", WhereType.In, childSorts), DbHelper.MakeAndWhere("type", this.examtopic.type) }; int num = DbHelper.ExecuteCount <ExamQuestion>(sqlparams); if (text != "") { text += ","; } if (sortInfo.subcounts > 0) { object obj = text; text = string.Concat(new object[] { obj, "{ id: ", sortInfo.id, ", pId: ", parentid, ", name: \"", sortInfo.name, "(", num, ")\",open:true, url: \"", text2, "\", target: \"frmmaindetail\", icon: \"", this.webpath, (this.sysconfig.adminpath == "") ? "" : (this.sysconfig.adminpath + "/"), "images/folders.gif\" }" }); string sortTree = this.GetSortTree(channelid, sortInfo.id); if (sortTree != "") { text = text + "," + sortTree; } } else { object obj = text; text = string.Concat(new object[] { obj, "{ id: ", sortInfo.id, ", pId: ", parentid, ", name: \"", sortInfo.name, "(", num, ")\",open:true, url: \"", text2, "\", target: \"frmmaindetail\", icon: \"", this.webpath, (this.sysconfig.adminpath == "") ? "" : (this.sysconfig.adminpath + "/"), "images/folder.gif\" }" }); } } } return(text); }