コード例 #1
0
ファイル: typedisplay.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x0600007D RID: 125 RVA: 0x0000B2D8 File Offset: 0x000094D8
        protected override void View()
        {
            if (this.channelid > 0)
            {
                this.reurl = this.reurl + "?channelid=" + this.channelid;
            }
            SqlParam     sqlParam = DbHelper.MakeAndWhere("parentid", this.parentid);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.typelist = DbHelper.ExecuteList <TypeInfo>(orderby, new SqlParam[]
            {
                sqlParam
            });
            if (this.ispost)
            {
                int num = 0;
                foreach (TypeInfo typeInfo in this.typelist)
                {
                    this.typelist[num].display = FPRequest.GetInt("display_" + typeInfo.id);
                    DbHelper.ExecuteUpdate <TypeInfo>(this.typelist[num]);
                    num++;
                }
                CacheBll.RemoveSortCache();
                base.Response.Redirect("typedisplay.aspx?parentid=" + this.parentid);
            }
            base.SaveRightURL();
        }
コード例 #2
0
        // Token: 0x06000095 RID: 149 RVA: 0x0000C8B4 File Offset: 0x0000AAB4
        protected override void View()
        {
            if (this.ispost)
            {
                if (this.action == "delete")
                {
                    int        @int       = FPRequest.GetInt("id");
                    Department department = DbHelper.ExecuteModel <Department>(@int);
                    if (DbHelper.ExecuteDelete <Department>(@int) > 0)
                    {
                        StringBuilder stringBuilder = new StringBuilder();
                        stringBuilder.AppendFormat("DELETE FROM [{0}WMS_Department] WHERE [id] IN (SELECT [id] FROM [{0}WMS_Department] WHERE [parentlist] LIKE '{1},%')", DbConfigs.Prefix, department.parentlist);
                        stringBuilder.AppendFormat("UPDATE [{0}WMS_Department] SET [subcounts] = [subcounts]-1 WHERE [id]={1}", DbConfigs.Prefix, department.parentid);
                        DbHelper.ExecuteSql(stringBuilder.ToString());
                    }
                }
                base.Response.Redirect("departmentmanage.aspx");
            }
            SqlParam     sqlParam = DbHelper.MakeAndWhere("parentid", 0);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.departmentlist = DbHelper.ExecuteList <Department>(orderby, new SqlParam[]
            {
                sqlParam
            });
            base.SaveRightURL();
        }
コード例 #3
0
        // Token: 0x06000014 RID: 20 RVA: 0x0000307C File Offset: 0x0000127C
        protected override void View()
        {
            if (this.ispost)
            {
                if (this.action == "delete")
                {
                    DbHelper.ExecuteDelete <AttachType>(FPRequest.GetString("chkdel"));
                    FPCache.Remove("FP_ATTACHTYPE", "image,flash,media,file");
                }
                else if (this.action == "add")
                {
                    AttachType attachType = FPRequest.GetModel <AttachType>();
                    DbHelper.ExecuteInsert <AttachType>(attachType);
                    FPCache.Remove("FP_ATTACHTYPE" + attachType.type);
                }
                else if (this.action == "edit")
                {
                    AttachType attachType = DbHelper.ExecuteModel <AttachType>(this.id);
                    attachType = FPRequest.GetModel <AttachType>(attachType, "edit_");
                    DbHelper.ExecuteUpdate <AttachType>(attachType);
                    FPCache.Remove("FP_ATTACHTYPE" + attachType.type);
                }
                base.Response.Redirect(this.pagename);
            }
            OrderByParam orderby = DbHelper.MakeOrderBy("type", OrderBy.ASC);

            this.attachlist = DbHelper.ExecuteList <AttachType>(orderby, new SqlParam[0]);
            base.SaveRightURL();
        }
コード例 #4
0
        // Token: 0x06000076 RID: 118 RVA: 0x0000A94C File Offset: 0x00008B4C
        protected override void View()
        {
            SqlParam[] sqlparams = new SqlParam[]
            {
                DbHelper.MakeAndWhere("channelid", this.channelid),
                DbHelper.MakeAndWhere("parentid", this.parentid)
            };
            OrderByParam orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.sortlist = DbHelper.ExecuteList <SortInfo>(orderby, sqlparams);
            if (this.ispost)
            {
                int num = 0;
                foreach (SortInfo sortInfo in this.sortlist)
                {
                    this.sortlist[num].display = FPRequest.GetInt("display_" + sortInfo.id);
                    DbHelper.ExecuteUpdate <SortInfo>(this.sortlist[num]);
                    FPCache.Remove("FP_SORTTREE" + sortInfo.channelid);
                    num++;
                }
                base.Response.Redirect(string.Concat(new object[]
                {
                    "sortdisplay.aspx?channelid=",
                    this.channelid,
                    "&parentid=",
                    this.parentid
                }));
            }
            base.SaveRightURL();
        }
コード例 #5
0
ファイル: typemanage.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x0600007F RID: 127 RVA: 0x0000B47C File Offset: 0x0000967C
        protected override void View()
        {
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);
            SqlParam     sqlParam = DbHelper.MakeAndWhere("parentid", 0);

            if (this.ispost)
            {
                if (!this.isperm)
                {
                    this.ShowErr("对不起,您没有权限操作。");
                    return;
                }
                int @int = FPRequest.GetInt("id");
                if (this.action.Equals("delete"))
                {
                    TypeInfo typeInfo = DbHelper.ExecuteModel <TypeInfo>(@int);
                    if (DbHelper.ExecuteDelete <TypeInfo>(@int) > 0)
                    {
                        StringBuilder stringBuilder = new StringBuilder();
                        stringBuilder.AppendFormat("DELETE FROM [{0}WMS_TypeInfo] WHERE [id] IN (SELECT [id] FROM [{0}WMS_TypeInfo]  WHERE [parentid]={1};", DbConfigs.Prefix, typeInfo.id);
                        stringBuilder.AppendFormat("UPDATE [{0}WMS_TypeInfo] SET [subcounts]=[subcounts]-1 WHERE [id]={1};", DbConfigs.Prefix, typeInfo.parentid);
                        stringBuilder.AppendFormat("UPDATE [{0}WMS_TypeInfo] SET [subcounts]=0 WHERE [subcounts]<0", DbConfigs.Prefix);
                        DbHelper.ExecuteSql(stringBuilder.ToString());
                    }
                }
            }
            this.typelist = DbHelper.ExecuteList <TypeInfo>(orderby, new SqlParam[]
            {
                sqlParam
            });
            base.SaveRightURL();
        }
コード例 #6
0
ファイル: sortadd.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x0600006E RID: 110 RVA: 0x0000A2EC File Offset: 0x000084EC
        protected string GetChildSort(int parentid, string tree)
        {
            SqlParam[] sqlparams = new SqlParam[]
            {
                DbHelper.MakeAndWhere("parentid", parentid),
                DbHelper.MakeAndWhere("channelid", this.channelid),
                DbHelper.MakeAndWhere("id", WhereType.NotEqual, this.id)
            };
            OrderByParam    orderby       = DbHelper.MakeOrderBy("display", OrderBy.ASC);
            List <SortInfo> list          = DbHelper.ExecuteList <SortInfo>(orderby, sqlparams);
            StringBuilder   stringBuilder = new StringBuilder();

            tree = "│  " + tree;
            foreach (SortInfo sortInfo in list)
            {
                string arg = "";
                if (sortInfo.id == this.parentid)
                {
                    arg = "selected=\"selected\"";
                }
                stringBuilder.AppendFormat("<option value=\"{0}\" {1}>{2}</option>", sortInfo.id, arg, tree + sortInfo.name);
                stringBuilder.Append(this.GetChildSort(sortInfo.id, tree));
            }
            return(stringBuilder.ToString());
        }
コード例 #7
0
ファイル: top.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x06000088 RID: 136 RVA: 0x0000BCCC File Offset: 0x00009ECC
        protected override void View()
        {
            SqlParam     sqlParam = DbHelper.MakeAndWhere("parentid", 0);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.menulist = DbHelper.ExecuteList <MenuInfo>(orderby, new SqlParam[]
            {
                sqlParam
            });
            if (this.Session["FP_ADMIN_TOPMENU"] != null)
            {
                this.topmenuid = FPUtils.StrToInt(this.Session["FP_ADMIN_TOPMENU"].ToString(), 0);
            }
            if (this.topmenuid == 0)
            {
                if (this.roleid == 1)
                {
                    this.topmenuid = 1;
                }
                else if (this.role.menus != "")
                {
                    this.topmenuid = FPUtils.SplitInt(this.role.menus)[0];
                }
            }
        }
コード例 #8
0
        // Token: 0x06000096 RID: 150 RVA: 0x0000C9B0 File Offset: 0x0000ABB0
        protected string ShowChildDepartment(int parentid, string tree)
        {
            SqlParam          sqlParam = DbHelper.MakeAndWhere("parentid", parentid);
            OrderByParam      orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);
            List <Department> list     = DbHelper.ExecuteList <Department>(orderby, new SqlParam[]
            {
                sqlParam
            });
            StringBuilder stringBuilder = new StringBuilder();

            tree = "│  " + tree;
            foreach (Department department in list)
            {
                stringBuilder.Append("<tr class=\"tlist\" onmouseover=\"curcolor=this.style.backgroundColor;this.style.backgroundColor='#cbe3f4'\" onmouseout=\"this.style.backgroundColor=curcolor\">");
                stringBuilder.AppendLine("<td align=\"center\">" + department.id + "</td>");
                stringBuilder.AppendLine("<td align=\"left\">" + tree);
                if (department.subcounts > 0)
                {
                    stringBuilder.AppendLine("<img src=\"../images/usergroups.gif\" width=\"16\" height=\"16\"  />");
                }
                else
                {
                    stringBuilder.AppendLine("<img src=\"../images/users.gif\" width=\"16\" height=\"16\"  />");
                }
                stringBuilder.AppendLine(department.name + "</td>");
                stringBuilder.AppendLine("<td>" + department.description + "</td>");
                stringBuilder.AppendLine("<td><a style=\"color: #1317fc\"  href=\"departmentadd.aspx?parentid=" + department.id + "\">添加子部门</a></td>");
                stringBuilder.AppendLine("<td><a style=\"color: #1317fc\"  href=\"departmentadd.aspx?id=" + department.id + "\">编辑</a></td>");
                stringBuilder.AppendLine("<td><a style=\"color: #1317fc\"  onclick=\"DeleteDepertment(" + department.id + ")\" href=\"#\">删除</a></td>");
                stringBuilder.AppendLine("<td><a style=\"color: #1317fc\"  href=\"departmentdisplay.aspx?parentid=" + department.parentid + "\">排序</a></td></tr>");
                stringBuilder.Append(this.ShowChildDepartment(department.id, tree));
            }
            return(stringBuilder.ToString());
        }
コード例 #9
0
ファイル: ExamBll.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x06000023 RID: 35 RVA: 0x00003458 File Offset: 0x00001658
        public static List <ExamResultTopic> GetExamResultTopicList(int resultid)
        {
            SqlParam     sqlParam = DbHelper.MakeAndWhere("resultid", resultid);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            return(DbHelper.ExecuteList <ExamResultTopic>(orderby, new SqlParam[]
            {
                sqlParam
            }));
        }
コード例 #10
0
ファイル: DepartmentBll.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x060001C1 RID: 449 RVA: 0x00006F28 File Offset: 0x00005128
        public static List <Department> GetDepartList(int parentid)
        {
            SqlParam     sqlParam = DbHelper.MakeAndWhere("parentid", parentid);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            return(DbHelper.ExecuteList <Department>(orderby, new SqlParam[]
            {
                sqlParam
            }));
        }
コード例 #11
0
ファイル: SortBll.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x06000271 RID: 625 RVA: 0x000086AC File Offset: 0x000068AC
        public static List <SortInfo> GetChannelSortList(int channelid)
        {
            SqlParam     sqlParam = DbHelper.MakeAndWhere("channelid", channelid);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            return(DbHelper.ExecuteList <SortInfo>(orderby, new SqlParam[]
            {
                sqlParam
            }));
        }
コード例 #12
0
ファイル: sysmenumanage.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x0600003F RID: 63 RVA: 0x00005FB4 File Offset: 0x000041B4
        protected List <MenuInfo> GetChildMenu(int parentid)
        {
            SqlParam     sqlParam = DbHelper.MakeAndWhere("parentid", parentid);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            return(DbHelper.ExecuteList <MenuInfo>(orderby, new SqlParam[]
            {
                sqlParam
            }));
        }
コード例 #13
0
ファイル: TypeBll.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x060002E1 RID: 737 RVA: 0x0000B380 File Offset: 0x00009580
        public static List <TypeInfo> GetTypeListByMarkup(string markup)
        {
            SqlParam     sqlParam = DbHelper.MakeAndWhere("markup", markup);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            return(DbHelper.ExecuteList <TypeInfo>(orderby, new SqlParam[]
            {
                sqlParam
            }));
        }
コード例 #14
0
ファイル: TypeBll.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x060002DF RID: 735 RVA: 0x0000B2FC File Offset: 0x000094FC
        public static List <TypeInfo> GetTypeList(string types)
        {
            SqlParam     sqlParam = DbHelper.MakeAndWhere("id", WhereType.In, types);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            return(DbHelper.ExecuteList <TypeInfo>(orderby, new SqlParam[]
            {
                sqlParam
            }));
        }
コード例 #15
0
ファイル: _examresult.cs プロジェクト: Run2948/FangPageExam
 // Token: 0x060000C2 RID: 194 RVA: 0x000130BC File Offset: 0x000112BC
 protected override void View()
 {
     this.examresult = DbHelper.ExecuteModel <ExamResult>(this.resultid);
     if (this.examresult.id == 0)
     {
         this.ShowErr("该考生的试卷不存在或已被删除。");
     }
     else if (this.examresult.status == 0)
     {
         this.ShowErr("对不起,该考试尚未完成。");
     }
     else
     {
         this.examresult.passmark = this.examresult.passmark * this.examresult.total / 100.0;
         string commandText = string.Format("SELECT MAX([score]) AS [maxscore] FROM [{0}Exam_ExamResult] WHERE [examid]={1} AND [status]>0", DbConfigs.Prefix, this.examresult.examid);
         this.maxscore = Math.Round((double)FPUtils.StrToFloat(DbHelper.ExecuteScalar(commandText).ToString(), 0f), 1);
         commandText   = string.Format("SELECT AVG([score]) AS [avgscore] FROM [{0}Exam_ExamResult] WHERE [examid]={1} AND [status]>0", DbConfigs.Prefix, this.examresult.examid);
         this.avgscore = Math.Round((double)FPUtils.StrToFloat(DbHelper.ExecuteScalar(commandText).ToString(), 0f));
         SqlParam[] sqlparams = new SqlParam[]
         {
             DbHelper.MakeAndWhere("examid", this.examresult.examid),
             DbHelper.MakeAndWhere("status", WhereType.GreaterThan, 0)
         };
         this.testers = DbHelper.ExecuteCount <ExamResult>(sqlparams);
         commandText  = string.Format("SELECT COUNT(*) FROM [{0}Exam_ExamResult] WHERE [examid]={1} AND [score]>{2} AND [status]>0", DbConfigs.Prefix, this.examresult.examid, this.examresult.score);
         if (this.examresult.score > 0.0)
         {
             this.display = FPUtils.StrToInt(DbHelper.ExecuteScalar(commandText).ToString(), 0) + 1;
         }
         SqlParam     sqlParam = DbHelper.MakeAndWhere("resultid", this.resultid);
         OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);
         this.examtopiclist = DbHelper.ExecuteList <ExamResultTopic>(orderby, new SqlParam[]
         {
             sqlParam
         });
         int num  = Convert.ToInt32(this.examresult.total) / 5;
         int num2 = num / 2;
         if (num % 2 != 0)
         {
             num2++;
         }
         for (int i = 1; i < 10; i++)
         {
             if (i % 2 == 0)
             {
                 this.bcklist.Add(i / 2 * num);
             }
             else
             {
                 this.bcklist.Add(i * num2);
             }
         }
     }
 }
コード例 #16
0
ファイル: SortBll.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x06000270 RID: 624 RVA: 0x00008658 File Offset: 0x00006858
        public static List <SortInfo> GetSortList(int channelid, int parentid)
        {
            SqlParam[] sqlparams = new SqlParam[]
            {
                DbHelper.MakeAndWhere("channelid", channelid),
                DbHelper.MakeAndWhere("parentid", parentid)
            };
            OrderByParam orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            return(DbHelper.ExecuteList <SortInfo>(orderby, sqlparams));
        }
コード例 #17
0
ファイル: ExamBll.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x0600001E RID: 30 RVA: 0x00003298 File Offset: 0x00001498
        public static List <ExamTopic> GetExamTopicList(int examid, int paper)
        {
            SqlParam[] sqlparams = new SqlParam[]
            {
                DbHelper.MakeAndWhere("examid", examid),
                DbHelper.MakeAndWhere("paper", paper)
            };
            OrderByParam orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            return(DbHelper.ExecuteList <ExamTopic>(orderby, sqlparams));
        }
コード例 #18
0
        // Token: 0x060000BE RID: 190 RVA: 0x00012D18 File Offset: 0x00010F18
        protected string GetChildSort(int channelid, int parentid, int level)
        {
            SqlParam[] sqlparams = new SqlParam[]
            {
                DbHelper.MakeAndWhere("parentid", parentid),
                DbHelper.MakeAndWhere("channelid", channelid),
                DbHelper.MakeAndWhere("appid", WhereType.In, this.sortappidlist),
                DbHelper.MakeAndWhere("hidden", 0)
            };
            OrderByParam    orderby       = DbHelper.MakeOrderBy("display", OrderBy.ASC);
            List <SortInfo> list          = DbHelper.ExecuteList <SortInfo>(orderby, sqlparams);
            StringBuilder   stringBuilder = new StringBuilder();

            foreach (SortInfo sortInfo in list)
            {
                ExamLogInfo examLogInfo;
                if (this.userexamlog.ContainsKey(sortInfo.id))
                {
                    examLogInfo = this.userexamlog[sortInfo.id];
                }
                else
                {
                    examLogInfo        = new ExamLogInfo();
                    examLogInfo.sortid = sortInfo.id;
                }
                stringBuilder.AppendFormat("<tr class=\"keypoint keypoint-level-{0} child_row_{1}\">\r\n", level, sortInfo.parentid);
                if (sortInfo.subcounts > 0)
                {
                    stringBuilder.AppendFormat("<td class=\"name-col\"><span class=\"text toggle-expand\"><span  id=\"row_{1}\" class=\"sprite sprite-expand sprite-expand\"></span>{0}</span></td>\r\n", sortInfo.name, sortInfo.id);
                }
                else
                {
                    stringBuilder.AppendFormat("<td class=\"name-col\"><span class=\"text\"><span class=\"sprite sprite-expand sprite-noexpand\"></span>{0}</span></td>\r\n", sortInfo.name);
                }
                stringBuilder.AppendFormat("<td class=\"count-col\">{0}道/{1}道</td>\r\n", examLogInfo.answers, sortInfo.posts);
                stringBuilder.AppendFormat("<td class=\"count-col\">{0}道</td>\r\n", examLogInfo.answers - examLogInfo.wrongs);
                if (examLogInfo.answers > 0)
                {
                    stringBuilder.AppendFormat("<td class=\"capacity-col\"><span class=\"progressBar\">{0}%</span></td>\r\n", examLogInfo.accuracy);
                }
                else
                {
                    stringBuilder.AppendFormat("<td class=\"capacity-col\"><span class=\"progressBar\">{0}%</span></td>\r\n", 0);
                }
                stringBuilder.Append("</tr>\r\n");
                if (sortInfo.subcounts > 0)
                {
                    stringBuilder.Append(this.GetChildSort(channelid, sortInfo.id, level + 1));
                }
            }
            return(stringBuilder.ToString());
        }
コード例 #19
0
ファイル: adminmenu.cs プロジェクト: Run2948/FangPageExam
 // Token: 0x06000303 RID: 771 RVA: 0x0000BF84 File Offset: 0x0000A184
 protected override void View()
 {
     if (this.parentid > 0)
     {
         SqlParam     sqlParam = DbHelper.MakeAndWhere("parentid", this.parentid);
         OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);
         this.menulist = DbHelper.ExecuteList <MenuInfo>(orderby, new SqlParam[]
         {
             sqlParam
         });
     }
     base.SaveLeftURL(this.rawurl);
 }
コード例 #20
0
ファイル: sysmenu.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x06000086 RID: 134 RVA: 0x0000BC34 File Offset: 0x00009E34
        protected List <MenuInfo> GetChildMenu(int parentid)
        {
            List <SqlParam> list = new List <SqlParam>();

            list.Add(DbHelper.MakeAndWhere("parentid", parentid));
            if (this.roleid != 1)
            {
                list.Add(DbHelper.MakeAndWhere("id", WhereType.In, this.role.menus));
            }
            OrderByParam orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            return(DbHelper.ExecuteList <MenuInfo>(orderby, list.ToArray()));
        }
コード例 #21
0
 // Token: 0x060000CE RID: 206 RVA: 0x0001462C File Offset: 0x0001282C
 protected override void View()
 {
     this.channelinfo = ChannelBll.GetChannelInfo("exam_question");
     if (this.channelinfo.id == 0)
     {
         this.ShowErr("对不起,目前系统尚未创建题目库频道。");
     }
     else
     {
         string commandText = string.Format("SELECT SUM([curfavs]) AS [total] FROM [{0}Exam_ExamLogInfo] WHERE [channelid]={1} AND [uid]={2}", DbConfigs.Prefix, this.channelinfo.id, this.userid);
         this.total       = FPUtils.StrToInt(DbHelper.ExecuteScalar(commandText));
         this.userexamlog = ExamBll.GetExamLogList(this.channelinfo.id, this.userid);
         List <SortAppInfo> sortAppList = SortBll.GetSortAppList("exam_");
         foreach (SortAppInfo sortAppInfo in sortAppList)
         {
             if (this.sortappidlist != "")
             {
                 this.sortappidlist += ",";
             }
             this.sortappidlist += sortAppInfo.id;
         }
         SqlParam[] sqlparams = new SqlParam[]
         {
             DbHelper.MakeAndWhere("parentid", 0),
             DbHelper.MakeAndWhere("channelid", this.channelinfo.id),
             DbHelper.MakeAndWhere("appid", WhereType.In, this.sortappidlist),
             DbHelper.MakeAndWhere("hidden", 0)
         };
         OrderByParam    orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);
         List <SortInfo> list    = DbHelper.ExecuteList <SortInfo>(orderby, sqlparams);
         foreach (SortInfo sortInfo in list)
         {
             ExamLogInfo examLogInfo;
             if (this.userexamlog.ContainsKey(sortInfo.id))
             {
                 examLogInfo = this.userexamlog[sortInfo.id];
             }
             else
             {
                 examLogInfo = new ExamLogInfo();
             }
             examLogInfo.sortid    = sortInfo.id;
             examLogInfo.sortname  = sortInfo.name;
             examLogInfo.questions = sortInfo.posts;
             examLogInfo.subcounts = sortInfo.subcounts;
             this.examloglist.Add(examLogInfo);
         }
     }
 }
コード例 #22
0
        // Token: 0x0600007B RID: 123 RVA: 0x0000B078 File Offset: 0x00009278
        protected override void View()
        {
            this.link = "typemanage.aspx";
            if (this.id > 0)
            {
                this.typeinfo = DbHelper.ExecuteModel <TypeInfo>(this.id);
                this.parentid = this.typeinfo.parentid;
            }
            if (this.ispost)
            {
                this.typeinfo = FPRequest.GetModel <TypeInfo>(this.typeinfo);
                if (this.typeinfo.id > 0)
                {
                    if (DbHelper.ExecuteUpdate <TypeInfo>(this.typeinfo) > 0)
                    {
                        StringBuilder stringBuilder = new StringBuilder();
                        if (this.typeinfo.parentid != this.parentid)
                        {
                            stringBuilder.AppendFormat("UPDATE [{0}WMS_TypeInfo] SET [subcounts]=[subcounts]-1 WHERE [id]={1};", DbConfigs.Prefix, this.parentid);
                            stringBuilder.AppendFormat("UPDATE [{0}WMS_TypeInfo] SET [subcounts]=[subcounts]+1 WHERE [id]={1};", DbConfigs.Prefix, this.typeinfo.parentid);
                            stringBuilder.AppendFormat("UPDATE [{0}WMS_TypeInfo] SET [subcounts]=0 WHERE [subcounts]<0", DbConfigs.Prefix);
                            DbHelper.ExecuteSql(stringBuilder.ToString());
                        }
                    }
                    base.AddMsg("更新分类成功!");
                }
                else
                {
                    this.typeinfo.display = FPUtils.StrToInt(DbHelper.ExecuteMax <TypeInfo>("display").ToString()) + 1;
                    if (DbHelper.ExecuteInsert <TypeInfo>(this.typeinfo) > 0)
                    {
                        string sqlstring = string.Format("UPDATE [{0}WMS_TypeInfo] SET [subcounts]=[subcounts]+1 WHERE [id]={1}", DbConfigs.Prefix, this.typeinfo.parentid);
                        DbHelper.ExecuteSql(sqlstring);
                    }
                    base.AddMsg("添加分类成功!");
                }
                CacheBll.RemoveSortCache();
            }
            SqlParam[] sqlparams = new SqlParam[]
            {
                DbHelper.MakeAndWhere("id", WhereType.NotEqual, this.id),
                DbHelper.MakeAndWhere("parentid", 0)
            };
            OrderByParam orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.parenttypelist = DbHelper.ExecuteList <TypeInfo>(orderby, sqlparams);
            base.SaveRightURL();
        }
コード例 #23
0
 // Token: 0x06000040 RID: 64 RVA: 0x000062DC File Offset: 0x000044DC
 protected override void View()
 {
     this.examinfo = DbHelper.ExecuteModel <ExamInfo>(this.examid);
     if (this.examinfo.id == 0)
     {
         this.ShowErr("对不起,该试卷不存在或已被删除。");
     }
     else
     {
         this.sortid   = this.examinfo.sortid;
         this.sortinfo = SortBll.GetSortInfo(this.sortid);
         if (this.ispost)
         {
             string a       = FPRequest.GetString("action").ToLower();
             string @string = FPRequest.GetString("chkid");
             if (a == "delete")
             {
                 if (DbHelper.ExecuteDelete <ExamResult>(@string) > 0)
                 {
                     SqlParam sqlParam = DbHelper.MakeAndWhere("resultid", WhereType.In, @string);
                     DbHelper.ExecuteDelete <ExamResultTopic>(new SqlParam[]
                     {
                         sqlParam
                     });
                 }
             }
             else if (a == "change")
             {
                 SqlParam[] sqlparams = new SqlParam[]
                 {
                     DbHelper.MakeSet("ip", ""),
                     DbHelper.MakeSet("mac", ""),
                     DbHelper.MakeAndWhere("id", WhereType.In, @string)
                 };
                 DbHelper.ExecuteUpdate <ExamResult>(sqlparams);
             }
         }
         SqlParam[] sqlparams2 = new SqlParam[]
         {
             DbHelper.MakeAndWhere("examid", this.examid),
             DbHelper.MakeAndWhere("status", 0)
         };
         OrderByParam orderby = DbHelper.MakeOrderBy("id", OrderBy.DESC);
         this.examresultlist = DbHelper.ExecuteList <ExamResult>(orderby, sqlparams2);
         base.SaveRightURL();
     }
 }
コード例 #24
0
        // Token: 0x0600009B RID: 155 RVA: 0x0000CDB0 File Offset: 0x0000AFB0
        private string GetMenuTree(int parentid)
        {
            SqlParam[] sqlparams = new SqlParam[]
            {
                DbHelper.MakeAndWhere("parentid", parentid)
            };
            OrderByParam    orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);
            List <MenuInfo> list    = DbHelper.ExecuteList <MenuInfo>(orderby, sqlparams);
            string          text    = "";

            foreach (MenuInfo menuInfo in list)
            {
                if (text != "")
                {
                    text += ",";
                }
                string text2 = "";
                if (base.ischecked(menuInfo.id, this.roleinfo.menus) || (this.roleinfo.id == 1 && menuInfo.system == 1))
                {
                    text2 = "checked:true,";
                }
                object obj = text;
                text = string.Concat(new object[]
                {
                    obj,
                    "{ id: ",
                    menuInfo.id,
                    ", pId: ",
                    parentid,
                    ", name: \"",
                    menuInfo.name,
                    "\",",
                    text2,
                    "open:true, icon: \"",
                    this.webpath,
                    (this.sysconfig.adminpath == "") ? "" : (this.sysconfig.adminpath + "/"),
                    "images/sysmenu2.gif\" }"
                });
                string menuTree = this.GetMenuTree(menuInfo.id);
                if (menuTree != "")
                {
                    text = text + "," + menuTree;
                }
            }
            return(text);
        }
コード例 #25
0
        // Token: 0x06000093 RID: 147 RVA: 0x0000C774 File Offset: 0x0000A974
        protected override void View()
        {
            SqlParam     sqlParam = DbHelper.MakeAndWhere("parentid", this.parentid);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.departmentlist = DbHelper.ExecuteList <Department>(orderby, new SqlParam[]
            {
                sqlParam
            });
            if (this.ispost)
            {
                int num = 0;
                foreach (Department department in this.departmentlist)
                {
                    this.departmentlist[num].display = FPRequest.GetInt("display_" + department.id);
                    DbHelper.ExecuteUpdate <Department>(this.departmentlist[num]);
                    num++;
                }
                base.Response.Redirect(this.cururl + "?parentid=" + this.parentid);
            }
            base.SaveRightURL();
        }
コード例 #26
0
ファイル: sysmenuadd.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x06000039 RID: 57 RVA: 0x00005AE8 File Offset: 0x00003CE8
        protected override void View()
        {
            if (this.id > 0)
            {
                this.menuinfo = DbHelper.ExecuteModel <MenuInfo>(this.id);
                this.parentid = this.menuinfo.parentid;
            }
            if (this.ispost)
            {
                this.menuinfo = FPRequest.GetModel <MenuInfo>(this.menuinfo);
                if (this.menuinfo.id > 0)
                {
                    DbHelper.ExecuteUpdate <MenuInfo>(this.menuinfo);
                }
                else
                {
                    SqlParam sqlParam = DbHelper.MakeAndWhere("parentid", this.menuinfo.parentid);
                    this.menuinfo.display = DbHelper.ExecuteCount <MenuInfo>(new SqlParam[]
                    {
                        sqlParam
                    }) + 1;
                    this.menuinfo.id = DbHelper.ExecuteInsert <MenuInfo>(this.menuinfo);
                    RoleInfo roleInfo  = RoleBll.GetRoleInfo(1);
                    RoleInfo roleInfo2 = roleInfo;
                    roleInfo2.menus += ((roleInfo.menus == "") ? this.menuinfo.id.ToString() : ("," + this.menuinfo.id));
                    DbHelper.ExecuteUpdate <RoleInfo>(roleInfo);
                    base.ResetUser();
                }
                base.Response.Redirect("sysmenumanage.aspx");
            }
            SqlParam     sqlParam2 = DbHelper.MakeAndWhere("parentid", 0);
            OrderByParam orderby   = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.menulist = DbHelper.ExecuteList <MenuInfo>(orderby, new SqlParam[]
            {
                sqlParam2
            });
            base.SaveRightURL();
        }
コード例 #27
0
ファイル: sysmenumanage.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x0600003E RID: 62 RVA: 0x00005E4C File Offset: 0x0000404C
        protected override void View()
        {
            if (this.ispost)
            {
                if (this.action == "delete")
                {
                    SqlParam[] sqlparams = new SqlParam[]
                    {
                        DbHelper.MakeAndWhere("system", WhereType.NotEqual, 1),
                        DbHelper.MakeAndWhere("id", WhereType.In, FPRequest.GetString("chkdel"))
                    };
                    DbHelper.ExecuteDelete <MenuInfo>(sqlparams);
                }
                else if (this.action == "desk")
                {
                    int[] array = FPUtils.SplitInt(FPRequest.GetString("chkdel"));
                    foreach (int id in array)
                    {
                        MenuInfo menuInfo = DbHelper.ExecuteModel <MenuInfo>(id);
                        DbHelper.ExecuteInsert <DesktopInfo>(new DesktopInfo
                        {
                            name     = menuInfo.name,
                            lefturl  = menuInfo.lefturl,
                            righturl = menuInfo.righturl
                        });
                    }
                }
                base.Response.Redirect("sysmenumanage.aspx");
            }
            SqlParam     sqlParam = DbHelper.MakeAndWhere("parentid", 0);
            OrderByParam orderby  = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.menulist = DbHelper.ExecuteList <MenuInfo>(orderby, new SqlParam[]
            {
                sqlParam
            });
            base.SaveRightURL();
        }
コード例 #28
0
ファイル: questionmove.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x0600007C RID: 124 RVA: 0x0000C9F0 File Offset: 0x0000ABF0
        protected override void View()
        {
            this.sortinfo = SortBll.GetSortInfo(this.sortid);
            if (this.ispost)
            {
                if (this.targetid == 0)
                {
                    this.ShowErr("对不起,您没有选择移动至目标题库。");
                    return;
                }
                SqlParam[] sqlparams = new SqlParam[]
                {
                    DbHelper.MakeSet("sortid", this.targetid),
                    DbHelper.MakeAndWhere("id", WhereType.In, this.idlist)
                };
                DbHelper.ExecuteUpdate <ExamQuestion>(sqlparams);
                SortBll.UpdateSortPosts(this.sortid, -1);
                SortBll.UpdateSortPosts(this.targetid, 1);
                base.Response.Redirect(string.Concat(new object[]
                {
                    "questionmanage.aspx?channelid=",
                    this.channelid,
                    "&sortid=",
                    this.sortid,
                    "&pageindex=",
                    this.pageindex
                }));
            }
            SqlParam[] sqlparams2 = new SqlParam[]
            {
                DbHelper.MakeAndWhere("parentid", 0),
                DbHelper.MakeAndWhere("channelid", this.channelid),
                DbHelper.MakeAndWhere("id", WhereType.NotEqual, this.sortid)
            };
            OrderByParam orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.sortlist = DbHelper.ExecuteList <SortInfo>(orderby, sqlparams2);
        }
コード例 #29
0
        // Token: 0x06000053 RID: 83 RVA: 0x00004E70 File Offset: 0x00003070
        public static List <ChannelInfo> GetChannelList(string idmarkup)
        {
            OrderByParam       orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);
            List <ChannelInfo> result;

            if (FPUtils.IsNumericArray(idmarkup))
            {
                SqlParam sqlParam = DbHelper.MakeAndWhere("id", WhereType.In, idmarkup);
                result = DbHelper.ExecuteList <ChannelInfo>(orderby, new SqlParam[]
                {
                    sqlParam
                });
            }
            else
            {
                SqlParam sqlParam = DbHelper.MakeAndWhere("markup", WhereType.Like, idmarkup);
                result = DbHelper.ExecuteList <ChannelInfo>(orderby, new SqlParam[]
                {
                    sqlParam
                });
            }
            return(result);
        }
コード例 #30
0
ファイル: channelmanage.cs プロジェクト: Run2948/FangPageExam
        // Token: 0x0600005C RID: 92 RVA: 0x00008414 File Offset: 0x00006614
        protected override void View()
        {
            if (this.ispost)
            {
                if (!this.isperm)
                {
                    this.ShowErr("对不起,您没有权限操作。");
                    return;
                }
                string @string = FPRequest.GetString("chkdel");
                if (DbHelper.ExecuteDelete <ChannelInfo>(@string) > 0)
                {
                    SqlParam sqlParam = DbHelper.MakeAndWhere("channelid", WhereType.In, @string);
                    DbHelper.ExecuteDelete <SortInfo>(new SqlParam[]
                    {
                        sqlParam
                    });
                }
            }
            OrderByParam orderby = DbHelper.MakeOrderBy("display", OrderBy.ASC);

            this.channellist = DbHelper.ExecuteList <ChannelInfo>(orderby, new SqlParam[0]);
            base.SaveRightURL();
        }