Ejemplo n.º 1
0
    private MeshCollider CreatePolygonMeshCollider(GameObject polygonGameObject, Mesh mesh)
    {
        MeshCollider collider = polygonGameObject.AddComponent <MeshCollider>();

        collider.sharedMesh = mesh;

        if (_polygonalData.shouldDecomposeIntoConvexPolygons)
        {
            collider.convex = true;             //we're decomposing so we'll always have convex stuff
        }
        else
        {
            collider.convex = FPUtils.CheckIfConvex(_polygonalData.sourceVertices);
        }

        collider.smoothSphereCollisions = _polygonalData.shouldUseSmoothSphereCollisions;

        return(collider);
    }
Ejemplo n.º 2
0
        // Token: 0x06000065 RID: 101 RVA: 0x0000A910 File Offset: 0x00008B10
        protected string OptionInt(int ascount, int optiondisplay)
        {
            string text = "";

            for (int i = 0; i < ascount; i++)
            {
                if (text != "")
                {
                    text += ",";
                }
                text += i.ToString();
            }
            if (optiondisplay == 0)
            {
                string[] array = FPUtils.SplitString(text);
                text = QuestionBll.GetRandom(array, array.Length);
            }
            return(text);
        }
Ejemplo n.º 3
0
        // Token: 0x06000005 RID: 5 RVA: 0x000021E4 File Offset: 0x000003E4
        public static SMSConfig GetSMSConfig()
        {
            SMSConfig smsconfig = FPCache.Get <SMSConfig>("FP_SMSCONFIG");

            lock (SMSConfigs.lockHelper)
            {
                if (smsconfig == null)
                {
                    string mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "config/sms.config");
                    smsconfig = FPSerializer.Load <SMSConfig>(mapPath);
                    if (smsconfig.posturl == "")
                    {
                        smsconfig.posturl = "http://sms.106jiekou.com/utf8/sms.aspx";
                    }
                    FPCache.Insert("FP_SMSCONFIG", smsconfig, mapPath);
                }
            }
            return(smsconfig);
        }
Ejemplo n.º 4
0
        // Token: 0x0600004E RID: 78 RVA: 0x00006AA4 File Offset: 0x00004CA4
        protected override void View()
        {
            long sysSize = SysBll.GetSysSize();

            this.websize  = FPUtils.FormatBytesStr(sysSize);
            this.dbconfig = DbConfigs.GetDbConfig();
            this.dbsize   = FPUtils.FormatBytesStr(DbBll.GetDbSize());
            if (this.role.desktop == "")
            {
                this.role.desktop = "0";
            }
            SqlParam sqlParam = DbHelper.MakeAndWhere(string.Format("([hidden]=0 AND [uid]={0}) OR ([hidden]=0 AND [system]=1 AND [id] IN({1}))", this.userid, this.role.desktop), WhereType.Custom, "");

            this.desktoplist = DbHelper.ExecuteList <DesktopInfo>(OrderBy.ASC, new SqlParam[]
            {
                sqlParam
            });
            base.SaveRightURL(this.pagename);
        }
Ejemplo n.º 5
0
        // Token: 0x0600001B RID: 27 RVA: 0x00002B50 File Offset: 0x00000D50
        protected string UploadImg(HttpPostedFile postfile, string imgfile, bool isthumbnail, bool iswatermark, int imgmaxwidth, int imgmaxheight)
        {
            UpLoad   upLoad   = new UpLoad();
            string   json     = upLoad.FileSaveAs(postfile, "image", this.user, isthumbnail, iswatermark, imgmaxwidth, imgmaxheight);
            JsonData jsonData = JsonMapper.ToObject(json);

            if (jsonData["error"].ToString() == "")
            {
                if (imgfile != "")
                {
                    if (File.Exists(FPUtils.GetMapPath(imgfile)))
                    {
                        File.Delete(FPUtils.GetMapPath(imgfile));
                    }
                }
                imgfile = jsonData["filename"].ToString();
            }
            return(imgfile);
        }
Ejemplo n.º 6
0
 // Token: 0x0600005A RID: 90 RVA: 0x0000820C File Offset: 0x0000640C
 protected override void View()
 {
     if (this.id > 0)
     {
         this.channelinfo = DbHelper.ExecuteModel <ChannelInfo>(this.id);
     }
     else
     {
         this.channelinfo.display = FPUtils.StrToInt(DbHelper.ExecuteMax <ChannelInfo>("display").ToString()) + 1;
     }
     if (this.ispost)
     {
         this.link        = "channelmanage.aspx";
         this.channelinfo = FPRequest.GetModel <ChannelInfo>(this.channelinfo);
         if (this.channelinfo.id > 0)
         {
             DbHelper.ExecuteUpdate <ChannelInfo>(this.channelinfo);
             base.AddMsg("更新频道成功!");
         }
         else
         {
             this.channelinfo.id = DbHelper.ExecuteInsert <ChannelInfo>(this.channelinfo);
             if (this.channelinfo.id > 0 && FPRequest.GetInt("ismenu") == 1)
             {
                 MenuInfo menuInfo = new MenuInfo();
                 menuInfo.name = this.channelinfo.name;
                 SqlParam sqlParam = DbHelper.MakeAndWhere("parentid", menuInfo.parentid);
                 menuInfo.display = DbHelper.ExecuteCount <MenuInfo>(new SqlParam[]
                 {
                     sqlParam
                 }) + 1;
                 menuInfo.lefturl = "sorttree.aspx?channelid=" + this.channelinfo.id;
                 menuInfo.id      = DbHelper.ExecuteInsert <MenuInfo>(menuInfo);
                 RoleInfo roleInfo  = RoleBll.GetRoleInfo(1);
                 RoleInfo roleInfo2 = roleInfo;
                 roleInfo2.menus += ((roleInfo.menus == "") ? menuInfo.id.ToString() : ("," + menuInfo.id));
                 DbHelper.ExecuteUpdate <RoleInfo>(roleInfo);
             }
             base.AddMsg("添加频道成功!");
         }
     }
     base.SaveRightURL();
 }
Ejemplo n.º 7
0
        // Token: 0x060000A6 RID: 166 RVA: 0x00010440 File Offset: 0x0000E640
        private string OptionAnswer(string optionlist, string answer)
        {
            string[] array  = FPUtils.SplitString("A,B,C,D,E,F");
            int[]    array2 = FPUtils.SplitInt(optionlist);
            string   text   = "";

            for (int i = 0; i < array2.Length; i++)
            {
                if (FPUtils.InArray(array[array2[i]], answer))
                {
                    if (text != "")
                    {
                        text += ",";
                    }
                    text += array[i];
                }
            }
            return(text);
        }
Ejemplo n.º 8
0
        // Token: 0x06000025 RID: 37 RVA: 0x00003000 File Offset: 0x00001200
        public static string Send(string msgtos, string subject, string message)
        {
            string result;

            if (msgtos == "")
            {
                result = "发送地址不能为空。";
            }
            else
            {
                if (subject == "")
                {
                    subject = "无标题";
                }
                MailMessage mailMessage = new MailMessage();
                mailMessage.From = new MailAddress(Email.emailconfig.sysemail, Email.emailconfig.fromname, Encoding.UTF8);
                foreach (string addresses in FPUtils.SplitString(msgtos, ";"))
                {
                    mailMessage.To.Add(addresses);
                }
                mailMessage.Subject      = subject;
                mailMessage.Body         = message;
                mailMessage.Priority     = MailPriority.Normal;
                mailMessage.BodyEncoding = Encoding.UTF8;
                mailMessage.IsBodyHtml   = true;
                SmtpClient smtpClient = new SmtpClient();
                smtpClient.Host        = Email.emailconfig.smtp;
                smtpClient.Port        = Email.emailconfig.port;
                smtpClient.EnableSsl   = (Email.emailconfig.ssl == 1);
                smtpClient.Credentials = new NetworkCredential(Email.emailconfig.username, Email.emailconfig.password);
                try
                {
                    smtpClient.Send(mailMessage);
                    result = "";
                }
                catch (SmtpException ex)
                {
                    result = ex.Message;
                }
            }
            return(result);
        }
Ejemplo n.º 9
0
 // Token: 0x06000324 RID: 804 RVA: 0x0000E0D0 File Offset: 0x0000C2D0
 protected override void View()
 {
     this.fulluserinfo = DbHelper.ExecuteModel <FullUserInfo>(this.userid);
     if (this.fulluserinfo.id == 0)
     {
         this.ShowErr("对不起,该用户不存在或已被删除。");
     }
     else
     {
         this.bday = FPUtils.SplitString(this.fulluserinfo.bday, ",", 3);
         if (this.ispost)
         {
             this.fulluserinfo = FPRequest.GetModel <FullUserInfo>(this.fulluserinfo);
             DbHelper.ExecuteUpdate <FullUserInfo>(this.fulluserinfo);
             this.user = this.fulluserinfo;
             base.ResetUser();
             base.AddMsg("信息更新成功!");
         }
     }
 }
Ejemplo n.º 10
0
        // Token: 0x060002FB RID: 763 RVA: 0x0000BAD8 File Offset: 0x00009CD8
        public static UserGrade GetUserGradeByExpHigher(int expHigher)
        {
            if (expHigher < 0)
            {
                expHigher = 0;
            }
            List <SqlParam> list = new List <SqlParam>();

            list.Add(DbHelper.MakeAndWhere("explower", WhereType.LessThanEqual, expHigher));
            int num = FPUtils.StrToInt(DbHelper.ExecuteMax <UserGrade>("expupper"));

            if (expHigher >= num)
            {
                list.Add(DbHelper.MakeAndWhere("expupper", num));
            }
            else
            {
                list.Add(DbHelper.MakeAndWhere("expupper", WhereType.GreaterThan, expHigher));
            }
            return(DbHelper.ExecuteModel <UserGrade>(list.ToArray()));
        }
Ejemplo n.º 11
0
        // Token: 0x0600028C RID: 652 RVA: 0x00009834 File Offset: 0x00007A34
        public static void WriteFailedLog(string logContent)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            stringBuilder.Append("  ");
            stringBuilder.Append(logContent);
            stringBuilder.Append("\r\n");
            string mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "cache");

            if (!Directory.Exists(mapPath))
            {
                Directory.CreateDirectory(mapPath);
            }
            using (FileStream fileStream = new FileStream(mapPath + "\\tasklog.config", FileMode.Append, FileAccess.Write, FileShare.Write))
            {
                byte[] bytes = Encoding.UTF8.GetBytes(stringBuilder.ToString());
                fileStream.Write(bytes, 0, bytes.Length);
                fileStream.Close();
            }
        }
Ejemplo n.º 12
0
        // Token: 0x06000097 RID: 151 RVA: 0x0000EBC4 File Offset: 0x0000CDC4
        protected string FmAnswer(string content, int tid, string uanswer)
        {
            string[] array  = FPUtils.SplitString(content, "(#answer)");
            string[] array2 = FPUtils.SplitString(uanswer, ",", array.Length);
            content = "";
            int num = 0;

            foreach (string str in array)
            {
                if (num < array.Length - 1)
                {
                    content = content + str + string.Format("<input type=\"text\" id=\"answer_{0}\" name=\"answer_{0}\" value=\"{1}\" class=\"tkt\"/>", tid, array2[num]);
                }
                else
                {
                    content += str;
                }
                num++;
            }
            return(content);
        }
Ejemplo n.º 13
0
        // Token: 0x0600002D RID: 45 RVA: 0x000035C8 File Offset: 0x000017C8
        private bool CheckView(string viewpath, string aspxpath)
        {
            string mapPath = FPUtils.GetMapPath(this.webpath + aspxpath);
            bool   result;

            if (!File.Exists(mapPath))
            {
                result = false;
            }
            else
            {
                string   mapPath2       = FPUtils.GetMapPath(this.webpath + viewpath);
                DateTime lastWriteTime  = File.GetLastWriteTime(mapPath2);
                DateTime lastWriteTime2 = File.GetLastWriteTime(mapPath);
                if (lastWriteTime > lastWriteTime2)
                {
                    result = false;
                }
                else if (this.includedata[viewpath] == null)
                {
                    result = false;
                }
                else
                {
                    foreach (string str in this.includedata[viewpath].ToString().Split(new char[]
                    {
                        ','
                    }))
                    {
                        lastWriteTime = File.GetLastWriteTime(FPUtils.GetMapPath(this.webpath + str));
                        if (lastWriteTime > lastWriteTime2)
                        {
                            return(false);
                        }
                    }
                    result = true;
                }
            }
            return(result);
        }
Ejemplo n.º 14
0
        public ActionResult CheckLogin(UserLoginModel userinfomodel)
        {
            var password = FPUtils.MD5(userinfomodel.password);
            var userInfo = db.FP_WMS_UserInfo.SingleOrDefault(t => t.username == userinfomodel.username & t.password == password);

            if (userInfo == null)
            {
                return(Json(new { Status = 0, Content = "用户名或者密码错误" }));
            }
            else
            {
                if (userInfo.id > 0)
                {
                    if (userInfo.roleid == 4)
                    {
                        return(Json(new { Status = 0, Content = "对不起,该帐户已被禁止登录" }));
                    }
                    if (userInfo.roleid == 3)
                    {
                        return(Json(new { Status = 0, Content = "对不起,您的账号尚未被激活或者尚未被审核" }));
                    }
                    if (userInfo.state == 0)
                    {
                        return(Json(new { Status = 0, Content = "抱歉, 您的帐号已被禁止使用。" }));
                    }
                    Session.Add("FP_WAPLOGIN", userInfo);
                    //SysBll.InsertLog(userInfo.id, "用户登录", "登录成功,登录名:" + userInfo.username, true);
                    if (userinfomodel.callbackurl == "" || userinfomodel.callbackurl == null)
                    {
                        userinfomodel.callbackurl = HomeUrl;
                    }
                    return(Json(new { Status = 1, Content = "登录成功", backurl = userinfomodel.callbackurl }));
                }
                else
                {
                    //SysBll.InsertLog(userInfo.id, "用户登录", "登录失败,登录名:" + userinfomodel.username + ",密码:" + password, false);
                    return(Json(new { Status = 0, Content = "用户id异常" }));
                }
            }
        }
Ejemplo n.º 15
0
 // Token: 0x06000301 RID: 769 RVA: 0x0000BDE4 File Offset: 0x00009FE4
 protected override void View()
 {
     this.iuser = DbHelper.ExecuteModel <UserInfo>(this.userid);
     if (this.iuser.id == 0)
     {
         this.ShowErr("用户不存在。");
     }
     else if (this.ispost)
     {
         if (this.isfile)
         {
             HttpPostedFile postedFile = FPRequest.Files["uploadimg"];
             UpLoad         upLoad     = new UpLoad();
             string         json       = upLoad.FileSaveAs(postedFile, "image", this.user, false, false, 100, 100);
             JsonData       jsonData   = JsonMapper.ToObject(json);
             if (jsonData["error"].ToString() == "")
             {
                 if (this.iuser.avatar != "")
                 {
                     if (File.Exists(FPUtils.GetMapPath(this.iuser.avatar)))
                     {
                         File.Delete(FPUtils.GetMapPath(this.iuser.avatar));
                     }
                 }
                 this.iuser.avatar = jsonData["filename"].ToString();
                 DbHelper.ExecuteUpdate <UserInfo>(this.iuser);
                 base.ResetUser();
                 base.AddMsg("更新头像成功。");
             }
             else
             {
                 this.ShowErr(jsonData["error"].ToString());
             }
         }
         else
         {
             this.ShowErr("请选择要上传的头像文件");
         }
     }
 }
Ejemplo n.º 16
0
        // Token: 0x0600001F RID: 31 RVA: 0x00003A68 File Offset: 0x00001C68
        public static void CopyDirectory(string sourcePath, string targetPath)
        {
            DirectoryInfo directoryInfo = new DirectoryInfo(sourcePath);

            if (!Directory.Exists(targetPath))
            {
                Directory.CreateDirectory(targetPath);
            }
            foreach (FileInfo fileInfo in directoryInfo.GetFiles())
            {
                if (fileInfo.Extension == ".dll")
                {
                    fileInfo.CopyTo(FPUtils.GetMapPath(WebConfig.WebPath + "bin/" + fileInfo.Name), true);
                    fileInfo.CopyTo(targetPath + "\\" + fileInfo.Name, true);
                }
                else if (fileInfo.Extension == ".sql")
                {
                    fileInfo.CopyTo(targetPath + "\\" + fileInfo.Name, true);
                    if (fileInfo.Name.ToLower().EndsWith("access.sql") && DbConfigs.DbType == DbType.Access)
                    {
                        string sqlstring = FPFile.ReadFile(fileInfo.FullName);
                        DbHelper.ExecuteSql(sqlstring);
                    }
                    else if (fileInfo.Name.ToLower().EndsWith("sqlserver.sql") && DbConfigs.DbType == DbType.SqlServer)
                    {
                        string sqlstring = FPFile.ReadFile(fileInfo.FullName);
                        DbHelper.ExecuteSql(sqlstring);
                    }
                }
                else
                {
                    fileInfo.CopyTo(targetPath + "\\" + fileInfo.Name, true);
                }
            }
            foreach (DirectoryInfo directoryInfo2 in directoryInfo.GetDirectories())
            {
                pluginupdate.CopyDirectory(directoryInfo2.FullName, targetPath + "\\" + directoryInfo2.Name);
            }
        }
Ejemplo n.º 17
0
        // Token: 0x0600002F RID: 47 RVA: 0x00004F2C File Offset: 0x0000312C
        protected override void View()
        {
            this.m_path   = Path.GetDirectoryName(this.filepath).Replace("\\", "/");
            this.filename = Path.GetFileName(this.filepath);
            string mapPath = FPUtils.GetMapPath(this.webpath + this.filepath);

            if (!File.Exists(mapPath))
            {
                this.ShowErr("文件已被删除或不存在。");
            }
            else if (this.ispost)
            {
                if (!this.isperm)
                {
                    this.ShowErr("对不起,您没有权限操作。");
                }
                else
                {
                    this.content = HttpUtility.HtmlDecode(FPRequest.GetString("content"));
                    using (FileStream fileStream = new FileStream(mapPath, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite))
                    {
                        byte[] bytes = Encoding.UTF8.GetBytes(this.content);
                        fileStream.Write(bytes, 0, bytes.Length);
                        fileStream.Close();
                    }
                    base.Response.Redirect("sysfileedit.aspx?path=" + this.filepath);
                }
            }
            else
            {
                using (StreamReader streamReader = new StreamReader(mapPath, Encoding.UTF8))
                {
                    this.content = streamReader.ReadToEnd();
                    streamReader.Close();
                }
                this.content = HttpUtility.HtmlEncode(this.content);
                base.SaveRightURL();
            }
        }
Ejemplo n.º 18
0
        // Token: 0x06000025 RID: 37 RVA: 0x00003AE0 File Offset: 0x00001CE0
        public static ExpInfo GetExamExpByScore(double score, int examid)
        {
            if (score < 0.0)
            {
                score = 0.0;
            }
            List <SqlParam> list = new List <SqlParam>();

            list.Add(DbHelper.MakeAndWhere("examid", examid));
            list.Add(DbHelper.MakeAndWhere("scorelower", WhereType.LessThanEqual, score));
            int num = FPUtils.StrToInt(DbHelper.ExecuteMax <ExpInfo>("scoreupper"));

            if (score >= (double)num)
            {
                list.Add(DbHelper.MakeAndWhere("scoreupper", num));
            }
            else
            {
                list.Add(DbHelper.MakeAndWhere("scoreupper", WhereType.GreaterThan, score));
            }
            return(DbHelper.ExecuteModel <ExpInfo>(list.ToArray()));
        }
Ejemplo n.º 19
0
    private MeshCollider CreatePolygonMeshCollider(GameObject polygonGameObject, Mesh mesh)
    {
        MeshCollider collider = polygonGameObject.AddComponent <MeshCollider>();

        collider.sharedMesh = mesh;

        if (_polygonalData.hasBeenDecomposedIntoConvexPolygons)
        {
            collider.convex = true;             //we're decomposing so we'll always have convex stuff
        }
        else
        {
            collider.convex = FPUtils.CheckIfConvex(_polygonalData.sourceVertices);
        }

        //  warning CS0618: `UnityEngine.MeshCollider.smoothSphereCollisions' is obsolete: `Configuring smooth sphere collisions is no longer needed. PhysX3 has a better behaviour in place.'
        // http://docs.unity3d.com/ScriptReference/MeshCollider-smoothSphereCollisions.html
        // UNITY5: commented out
        // collider.smoothSphereCollisions = _polygonalData.shouldUseSmoothSphereCollisions;

        return(collider);
    }
Ejemplo n.º 20
0
        // Token: 0x06000280 RID: 640 RVA: 0x0000950C File Offset: 0x0000770C
        public static long GetDbSize()
        {
            DbConfigInfo dbConfig = DbConfigs.GetDbConfig();
            long         num      = 0L;

            if (dbConfig.dbtype == FangPage.Data.DbType.SqlServer)
            {
                string    commandText = "SELECT OBJECT_NAME(ID) AS TableName,SIZE = sum(reserved) * CONVERT(FLOAT, (SELECT LOW FROM MASTER.DBO.SPT_VALUES WHERE NUMBER = 1 AND TYPE = 'E')) FROM [sysindexes] WHERE [indid] IN (0,1,255) GROUP BY ID ORDER BY SIZE DESC";
                DataTable dataTable   = DbHelper.ExecuteDataset(CommandType.Text, commandText).Tables[0];
                foreach (object obj in dataTable.Rows)
                {
                    DataRow dataRow = (DataRow)obj;
                    num += long.Parse(dataRow["size"].ToString());
                }
            }
            else
            {
                FileInfo fileInfo = new FileInfo(FPUtils.GetMapPath(WebConfig.WebPath + dbConfig.dbpath));
                num = fileInfo.Length;
            }
            return(num);
        }
Ejemplo n.º 21
0
        // Token: 0x060002F5 RID: 757 RVA: 0x0000B958 File Offset: 0x00009B58
        public static void UpdateUserExp(int uid, int exp)
        {
            UserInfo userInfo = UserBll.GetUserInfo(uid);

            userInfo.exp += exp;
            int num = FPUtils.StrToInt(DbHelper.ExecuteMax <UserGrade>("expupper"));

            if (userInfo.exp > num)
            {
                userInfo.exp = num;
            }
            UserGrade userGradeByExpHigher = UserBll.GetUserGradeByExpHigher(userInfo.exp);
            string    sqlstring            = string.Format("UPDATE [{0}WMS_UserInfo] SET [gradeid]={1},[exp]=[exp]+{2} WHERE [id]={3}", new object[]
            {
                DbConfigs.Prefix,
                userGradeByExpHigher.id,
                exp,
                uid
            });

            DbHelper.ExecuteSql(sqlstring);
        }
Ejemplo n.º 22
0
 // 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;
     }
 }
Ejemplo n.º 23
0
        // Token: 0x06000062 RID: 98 RVA: 0x0000A734 File Offset: 0x00008934
        protected List <ExamQuestion> GetQuestionList(string questionids)
        {
            SqlParam            sqlParam = DbHelper.MakeAndWhere("id", WhereType.In, questionids);
            List <ExamQuestion> list     = DbHelper.ExecuteList <ExamQuestion>(new SqlParam[]
            {
                sqlParam
            });
            List <ExamQuestion> list2 = new List <ExamQuestion>();

            foreach (int num in FPUtils.SplitInt(questionids))
            {
                foreach (ExamQuestion examQuestion in list)
                {
                    if (examQuestion.id == num)
                    {
                        examQuestion.optionlist = this.OptionInt(examQuestion.ascount, this.examinfo.optiondisplay);
                        list2.Add(examQuestion);
                    }
                }
            }
            return(list2);
        }
Ejemplo n.º 24
0
 // Token: 0x0600002C RID: 44 RVA: 0x000034FC File Offset: 0x000016FC
 private void CreateTemplate(SiteConfig siteconfig, string viewpath, string aspxpath)
 {
     if (File.Exists(FPUtils.GetMapPath(this.webpath + viewpath)))
     {
         if (!this.CheckView(viewpath, aspxpath))
         {
             string text  = "";
             string text2 = "";
             FPViews.CreateView(siteconfig, this.webpath, viewpath, aspxpath, 1, "", out text, out text2);
             if (this.includedata[viewpath] == null)
             {
                 this.includedata.Add(viewpath, text);
                 FPViews.AddViewInclude(viewpath, text);
             }
             else if (text != this.includedata[viewpath].ToString())
             {
                 this.includedata[viewpath] = text;
                 FPViews.UpdateViewInclude(viewpath, text);
             }
         }
     }
 }
Ejemplo n.º 25
0
        // Token: 0x06000098 RID: 152 RVA: 0x0000EC64 File Offset: 0x0000CE64
        protected string Option(string[] opstr, int ascount, string optionlist)
        {
            string[] array  = FPUtils.SplitString("A,B,C,D,E,F");
            int[]    array2 = FPUtils.SplitInt(optionlist, ",", ascount);
            string   text   = "";

            if (ascount > opstr.Length)
            {
                ascount = opstr.Length;
            }
            for (int i = 0; i < ascount; i++)
            {
                if (optionlist != "")
                {
                    string text2 = text;
                    text = string.Concat(new string[]
                    {
                        text2,
                        array[i],
                        ".",
                        opstr[array2[i]],
                        "<br/>"
                    });
                }
                else
                {
                    string text2 = text;
                    text = string.Concat(new string[]
                    {
                        text2,
                        array[i],
                        ".",
                        opstr[i],
                        "<br/>"
                    });
                }
            }
            return(text);
        }
Ejemplo n.º 26
0
 // Token: 0x060000B2 RID: 178 RVA: 0x000117F4 File Offset: 0x0000F9F4
 protected override void View()
 {
     if (!this.isperm)
     {
         this.ShowErr("对不起,您没有权限阅卷。");
     }
     else
     {
         this.examresult = DbHelper.ExecuteModel <ExamResult>(this.resultid);
         if (this.examresult.id == 0)
         {
             this.ShowErr("该考生的试卷不存在或已被删除。");
         }
         else
         {
             this.examloglist = ExamBll.GetExamLogList(this.examresult.channelid, this.userid);
             string commandText = string.Format("SELECT MAX([score]) AS [maxscore] FROM [{0}Exam_ExamResult] WHERE [id]={1}", DbConfigs.Prefix, this.resultid);
             this.maxscore = Math.Round((double)FPUtils.StrToFloat(DbHelper.ExecuteScalar(commandText).ToString(), 0f), 1);
             if (this.maxscore > this.examresult.total)
             {
                 this.maxscore = this.examresult.total;
             }
             commandText   = string.Format("SELECT AVG([score]) AS [avgscore] FROM [{0}Exam_ExamResult] WHERE [id]={1}", DbConfigs.Prefix, this.resultid);
             this.avgscore = Math.Round((double)FPUtils.StrToFloat(DbHelper.ExecuteScalar(commandText).ToString(), 0f), 1);
             SqlParam sqlParam = DbHelper.MakeAndWhere("examid", this.examresult.examid);
             this.testers = DbHelper.ExecuteCount <ExamResult>(new SqlParam[]
             {
                 sqlParam
             });
             commandText = string.Format("SELECT COUNT(*) FROM [{0}Exam_ExamResult] WHERE [examid]={1} AND [score]>{2}", DbConfigs.Prefix, this.examresult.examid, this.examresult.score);
             if (this.examresult.score > 0.0)
             {
                 this.display = FPUtils.StrToInt(DbHelper.ExecuteScalar(commandText).ToString(), 0) + 1;
             }
             this.examtopicresultlist = ExamBll.GetExamResultTopicList(this.resultid);
         }
     }
 }
Ejemplo n.º 27
0
        // 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();
        }
Ejemplo n.º 28
0
        // Token: 0x06000064 RID: 100 RVA: 0x0000A848 File Offset: 0x00008A48
        protected string Option(AsposeWordApp wd, string[] opstr, int ascount, string optionlist)
        {
            string[] array  = FPUtils.SplitString("A,B,C,D,E,F");
            int[]    array2 = FPUtils.SplitInt(optionlist, ",", ascount);
            string   result = "";

            if (ascount > opstr.Length)
            {
                ascount = opstr.Length;
            }
            for (int i = 0; i < ascount; i++)
            {
                if (optionlist != "")
                {
                    wd.Writeln(array[i] + "." + opstr[array2[i]], 12.0, false, "left");
                }
                else
                {
                    wd.Writeln(array[i] + "." + opstr[i], 12.0, false, "left");
                }
            }
            return(result);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 30
0
        // Token: 0x06000050 RID: 80 RVA: 0x00008A80 File Offset: 0x00006C80
        protected string Option(string[] opstr, int ascount)
        {
            string[] array = FPUtils.SplitString("A,B,C,D,E,F");
            string   text  = "";

            if (ascount > opstr.Length)
            {
                ascount = opstr.Length;
            }
            for (int i = 0; i < ascount; i++)
            {
                string text2 = text;
                text = string.Concat(new string[]
                {
                    text2,
                    array[i],
                    ".",
                    opstr[i],
                    "<br/>"
                });
            }
            return(text);
        }