示例#1
0
        // Token: 0x0600025C RID: 604 RVA: 0x00007D3C File Offset: 0x00005F3C
        public static bool SaveConfig(RegConfig regconfig)
        {
            string mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "config/reg.config");

            FPCache.Remove("FP_REGCONFIG");
            return(FPSerializer.Save <RegConfig>(regconfig, mapPath));
        }
示例#2
0
        // Token: 0x06000006 RID: 6 RVA: 0x0000228C File Offset: 0x0000048C
        public static bool SaveConfig(SMSConfig smsconfig)
        {
            string mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "config/sms.config");

            FPCache.Remove("FP_SMSCONFIG");
            return(FPSerializer.Save <SMSConfig>(smsconfig, mapPath));
        }
示例#3
0
 // Token: 0x06000048 RID: 72 RVA: 0x00006580 File Offset: 0x00004780
 protected override void View()
 {
     if (this.ispost)
     {
         if (this.action == "delete")
         {
             string @string = FPRequest.GetString("chkid");
             DbHelper.ExecuteDelete <TaskInfo>(@string);
             TaskManager.Reset();
         }
         else if (this.action == "download")
         {
             int      @int     = FPRequest.GetInt("tid");
             TaskInfo taskInfo = DbHelper.ExecuteModel <TaskInfo>(@int);
             string   text     = FPUtils.SplitString(taskInfo.type, ",", 2)[1];
             if (text == "")
             {
                 this.ShowErr("任务类型不正确。");
                 return;
             }
             if (!File.Exists(FPUtils.GetMapPath(this.webpath + "bin/" + text + ".dll")))
             {
                 this.ShowErr("任务类库DLL不存在或已被删除。");
                 return;
             }
             using (FPZip fpzip = new FPZip())
             {
                 if (File.Exists(FPUtils.GetMapPath(this.webpath + "cache/task.config")))
                 {
                     File.Delete(FPUtils.GetMapPath(this.webpath + "cache/task.config"));
                 }
                 FPSerializer.Save <TaskInfo>(taskInfo, FPUtils.GetMapPath(this.webpath + "cache/task.config"));
                 fpzip.AddFile(FPUtils.GetMapPath(this.webpath + "cache/task.config"), "");
                 fpzip.AddFile(FPUtils.GetMapPath(this.webpath + "bin/" + text + ".dll"), "");
                 fpzip.ZipDown(FPUtils.UrlEncode(taskInfo.name + ".task"));
             }
         }
         else if (this.action == "run")
         {
             int      @int     = FPRequest.GetInt("tid");
             TaskInfo taskInfo = DbHelper.ExecuteModel <TaskInfo>(@int);
             if (taskInfo.id == 0)
             {
                 this.ShowErr("对不起,该任务不存在或已被删除。");
                 return;
             }
             try
             {
                 TaskManager.Execute(taskInfo);
             }
             catch (Exception ex)
             {
                 this.ShowErr("执行计划任务失败:" + ex.Message);
                 return;
             }
         }
     }
     this.tasklist = DbHelper.ExecuteList <TaskInfo>(OrderBy.ASC);
     base.SaveRightURL();
 }
示例#4
0
        // Token: 0x06000047 RID: 71 RVA: 0x00004A84 File Offset: 0x00002C84
        public static bool SaveConfig(EmailConfig emailconfig)
        {
            string mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "config/email.config");

            FPCache.Remove("FP_EMAILCONFIG");
            return(FPSerializer.Save <EmailConfig>(emailconfig, mapPath));
        }
示例#5
0
        // Token: 0x06000028 RID: 40 RVA: 0x00003C28 File Offset: 0x00001E28
        public static bool SaveConfig(ExamConfig examconfig)
        {
            string mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "config/exam.config");

            FPCache.Remove("ExamConfig");
            return(FPSerializer.Save <ExamConfig>(examconfig, mapPath));
        }
示例#6
0
        // Token: 0x06000027 RID: 39 RVA: 0x00003BA8 File Offset: 0x00001DA8
        public static ExamConfig GetExamConfig()
        {
            ExamConfig examConfig = FPCache.Get <ExamConfig>("ExamConfig");

            lock (ExamConifgs.lockHelper)
            {
                if (examConfig == null)
                {
                    string mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "config/exam.config");
                    examConfig = FPSerializer.Load <ExamConfig>(mapPath);
                    FPCache.Insert("ExamConfig", examConfig, mapPath);
                }
            }
            return(examConfig);
        }
示例#7
0
        // Token: 0x06000046 RID: 70 RVA: 0x00004A04 File Offset: 0x00002C04
        public static EmailConfig GetEmailConfig()
        {
            EmailConfig emailConfig = FPCache.Get <EmailConfig>("FP_EMAILCONFIG");

            lock (EmailConfigs.lockHelper)
            {
                if (emailConfig == null)
                {
                    string mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "config/email.config");
                    emailConfig = FPSerializer.Load <EmailConfig>(mapPath);
                    FPCache.Insert("FP_EMAILCONFIG", emailConfig, mapPath);
                }
            }
            return(emailConfig);
        }
示例#8
0
        // Token: 0x0600025B RID: 603 RVA: 0x00007CBC File Offset: 0x00005EBC
        public static RegConfig GetRegConfig()
        {
            RegConfig regConfig = FPCache.Get <RegConfig>("FP_REGCONFIG");

            lock (RegConfigs.lockHelper)
            {
                if (regConfig == null)
                {
                    string mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "config/reg.config");
                    regConfig = FPSerializer.Load <RegConfig>(mapPath);
                    FPCache.Insert("FP_REGCONFIG", regConfig, mapPath);
                }
            }
            return(regConfig);
        }
示例#9
0
        // Token: 0x06000259 RID: 601 RVA: 0x00007C14 File Offset: 0x00005E14
        public static List <PluginConfig> GetPluginList()
        {
            List <PluginConfig> list = new List <PluginConfig>();
            string mapPath           = FPUtils.GetMapPath(WebConfig.WebPath + "plugins");

            if (Directory.Exists(mapPath))
            {
                DirectoryInfo directoryInfo = new DirectoryInfo(mapPath);
                foreach (DirectoryInfo directoryInfo2 in directoryInfo.GetDirectories())
                {
                    PluginConfig pluginConfig = FPSerializer.Load <PluginConfig>(directoryInfo2.FullName + "\\plugin.config");
                    pluginConfig.installpath = directoryInfo2.Name;
                    list.Add(pluginConfig);
                }
            }
            return(list);
        }
示例#10
0
 // Token: 0x06000283 RID: 643 RVA: 0x00009610 File Offset: 0x00007810
 public static void ResetConfig()
 {
     SysConfigs.filename = FPUtils.GetMapPath(WebConfig.WebPath + "config/sys.config");
     if (!File.Exists(SysConfigs.filename))
     {
         if (!Directory.Exists(Path.GetDirectoryName(SysConfigs.filename)))
         {
             Directory.CreateDirectory(Path.GetDirectoryName(SysConfigs.filename));
         }
         SysConfigs.m_configinfo = new SysConfig();
         if (SysConfigs.m_configinfo.passwordkey == "")
         {
             SysConfigs.m_configinfo.passwordkey = WMSUtils.CreateAuthStr(10);
         }
         SysConfigs.SaveConfig(SysConfigs.m_configinfo);
     }
     SysConfigs.m_configinfo = FPSerializer.Load <SysConfig>(SysConfigs.filename);
 }
示例#11
0
 // Token: 0x0600001C RID: 28 RVA: 0x0000362C File Offset: 0x0000182C
 protected override void View()
 {
     if (this.pluname != "")
     {
         this.pluginconfig             = FPSerializer.Load <PluginConfig>(FPUtils.GetMapPath(this.webpath + "plugins/" + this.pluname + "/plugin.config"));
         this.pluginconfig.installpath = this.pluname;
     }
     if (this.ispost)
     {
         this.pluginconfig = FPRequest.GetModel <PluginConfig>(this.pluginconfig);
         if (this.pluginconfig.guid == "")
         {
             this.pluginconfig.guid = Guid.NewGuid().ToString();
         }
         FPSerializer.Save <PluginConfig>(this.pluginconfig, FPUtils.GetMapPath(this.webpath + "plugins/" + this.pluginconfig.installpath + "/plugin.config"));
         base.Response.Redirect("pluginmanage.aspx");
     }
 }
示例#12
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);
        }
示例#13
0
 // Token: 0x0600001E RID: 30 RVA: 0x00003758 File Offset: 0x00001958
 protected override void View()
 {
     if (this.pluname != "")
     {
         this.pluginconfig             = FPSerializer.Load <PluginConfig>(FPUtils.GetMapPath(this.webpath + "plugins/" + this.pluname + "/plugin.config"));
         this.pluginconfig.installpath = this.pluname;
     }
     if (this.ispost)
     {
         string mapPath  = FPUtils.GetMapPath(this.webpath + "cache");
         string fileName = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
         string a        = Path.GetExtension(fileName).ToLower();
         if (a != ".plu" && a != ".zip")
         {
             this.ShowErr("对不起,该文件不是方配系统插件更新文件类型。");
         }
         else
         {
             if (!Directory.Exists(mapPath))
             {
                 Directory.CreateDirectory(mapPath);
             }
             if (File.Exists(mapPath + "\\" + fileName))
             {
                 File.Delete(mapPath + "\\" + fileName);
             }
             FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + fileName);
             if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName)))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
             }
             FPZip.UnZipFile(mapPath + "\\" + fileName, "");
             File.Delete(mapPath + "\\" + fileName);
             if (!File.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\plugin.config"))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
                 this.ShowErr("插件配置文件不存在或有错误。");
             }
             else
             {
                 PluginConfig pluginConfig = FPSerializer.Load <PluginConfig>(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\plugin.config");
                 if (pluginConfig.guid == "")
                 {
                     this.ShowErr("对不起,该插件标识码错误,更新失败。");
                 }
                 else
                 {
                     Version v  = new Version(FPUtils.StrToDecimal(pluginConfig.version).ToString("0.0"));
                     Version v2 = new Version(FPUtils.StrToDecimal(this.pluginconfig.version).ToString("0.0"));
                     if (v < v2)
                     {
                         this.ShowErr("对不起,您更新的版本比安装版本还低,不能更新");
                     }
                     else
                     {
                         string mapPath2   = FPUtils.GetMapPath(this.webpath + "plugins/" + pluginConfig.installpath);
                         string sourcePath = mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName);
                         pluginupdate.CopyDirectory(sourcePath, mapPath2);
                         Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
                         base.Response.Redirect("pluginmanage.aspx");
                     }
                 }
             }
         }
     }
 }
示例#14
0
 // Token: 0x0600000D RID: 13 RVA: 0x000029C8 File Offset: 0x00000BC8
 protected override void View()
 {
     this.appinfo = DbHelper.ExecuteModel <AppInfo>(this.id);
     if (this.appinfo.id == 0)
     {
         this.ShowErr("对不起,该应用已被删除或不存在。");
     }
     else
     {
         string mapPath = FPUtils.GetMapPath(this.webpath + this.appinfo.installpath);
         if (this.ispost)
         {
             string @string = FPRequest.GetString("setpath");
             if (@string == "")
             {
                 this.ShowErr("对不起,应用默认安装目录名称不能为空。");
             }
             else
             {
                 string pattern = "^[a-zA-Z0-9_\\w]+$";
                 if (this.err == 0 && !Regex.IsMatch(@string.Trim(), pattern, RegexOptions.IgnoreCase))
                 {
                     base.AddErr("默认安装目录名称只能由数字、字母或下划线组成。");
                 }
                 this.appinfo.setpath = @string;
                 DbHelper.ExecuteUpdate <AppInfo>(this.appinfo);
                 FPSerializer.Save <AppInfo>(this.appinfo, FPUtils.GetMapPath(this.webpath + this.appinfo.installpath + "/app.config"));
                 string str = this.appinfo.name + ".fpk";
                 if (this.appinfo.files != "")
                 {
                     using (FPZip fpzip = new FPZip())
                     {
                         foreach (string text in FPUtils.SplitString(this.appinfo.files))
                         {
                             if (text.StartsWith("bin/"))
                             {
                                 fpzip.AddFile(FPUtils.GetMapPath(WebConfig.WebPath + text), text);
                             }
                             else
                             {
                                 fpzip.AddFile(mapPath + "/" + text, text);
                             }
                         }
                         fpzip.ZipDown(FPUtils.UrlEncode(str));
                     }
                 }
                 else
                 {
                     using (FPZip fpzip = new FPZip())
                     {
                         DirectoryInfo directoryInfo = new DirectoryInfo(mapPath);
                         foreach (DirectoryInfo directoryInfo2 in directoryInfo.GetDirectories())
                         {
                             fpzip.AddDirectory(directoryInfo2.FullName);
                         }
                         foreach (FileInfo fileInfo in directoryInfo.GetFiles())
                         {
                             if (fileInfo.Name != "site.config")
                             {
                                 fpzip.AddFile(fileInfo.FullName, "");
                             }
                         }
                         string mapPath2 = FPUtils.GetMapPath(this.webpath + "sites/" + this.appinfo.installpath + "/site.config");
                         if (File.Exists(mapPath2))
                         {
                             SiteConfig siteConfig = SiteConfigs.LoadConfig(mapPath2);
                             if (siteConfig.inherits != "")
                             {
                                 if (siteConfig.inherits.EndsWith(".Controller"))
                                 {
                                     fpzip.AddFile(FPUtils.GetMapPath(this.webpath + "bin/" + siteConfig.inherits.Replace(".Controller", "") + ".dll"), "bin/" + siteConfig.inherits.Replace(".Controller", "") + ".dll");
                                 }
                                 else
                                 {
                                     fpzip.AddFile(FPUtils.GetMapPath(this.webpath + "bin/" + siteConfig.inherits + ".dll"), "bin/" + siteConfig.inherits + ".dll");
                                 }
                             }
                             if (siteConfig.import != "")
                             {
                                 foreach (string text in siteConfig.import.Split(new string[]
                                 {
                                     "\r\n",
                                     ";",
                                     ",",
                                     "|"
                                 }, StringSplitOptions.RemoveEmptyEntries))
                                 {
                                     fpzip.AddFile(FPUtils.GetMapPath(this.webpath + "bin/" + text + ".dll"), "bin/" + text + ".dll");
                                 }
                             }
                         }
                         fpzip.ZipDown(FPUtils.UrlEncode(str));
                     }
                 }
             }
         }
     }
 }
示例#15
0
 // Token: 0x06000021 RID: 33 RVA: 0x00003C60 File Offset: 0x00001E60
 protected override void View()
 {
     if (this.ispost)
     {
         string mapPath  = FPUtils.GetMapPath(this.webpath + "cache");
         string fileName = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
         string a        = Path.GetExtension(fileName).ToLower();
         if (a != ".task")
         {
             this.ShowErr("对不起,该文件不是方配系统任务安装文件类型。");
         }
         else
         {
             if (!Directory.Exists(mapPath))
             {
                 Directory.CreateDirectory(mapPath);
             }
             if (File.Exists(mapPath + "\\" + fileName))
             {
                 File.Delete(mapPath + "\\" + fileName);
             }
             FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + fileName);
             if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName)))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
             }
             FPZip.UnZipFile(mapPath + "\\" + fileName, "");
             File.Delete(mapPath + "\\" + fileName);
             if (!File.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\task.config"))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
                 this.ShowErr("应用配置文件不存在或有错误。");
             }
             else
             {
                 TaskInfo taskInfo = FPSerializer.Load <TaskInfo>(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\task.config");
                 if (taskInfo.key == "")
                 {
                     taskInfo.key = Guid.NewGuid().ToString();
                 }
                 SqlParam sqlParam  = DbHelper.MakeAndWhere("key", taskInfo.key);
                 TaskInfo taskInfo2 = DbHelper.ExecuteModel <TaskInfo>(new SqlParam[]
                 {
                     sqlParam
                 });
                 if (taskInfo2.id > 0)
                 {
                     taskInfo2.type = taskInfo.type;
                     taskInfo2.name = taskInfo.name;
                     DbHelper.ExecuteUpdate <TaskInfo>(taskInfo2);
                 }
                 else
                 {
                     DbHelper.ExecuteInsert <TaskInfo>(taskInfo);
                 }
                 DirectoryInfo directoryInfo = new DirectoryInfo(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName));
                 foreach (FileInfo fileInfo in directoryInfo.GetFiles())
                 {
                     if (fileInfo.Extension == ".dll")
                     {
                         fileInfo.CopyTo(FPUtils.GetMapPath(WebConfig.WebPath + "bin/" + fileInfo.Name), true);
                     }
                 }
                 base.Response.Redirect("taskmanage.aspx");
             }
         }
     }
 }
示例#16
0
 // Token: 0x06000025 RID: 37 RVA: 0x00004088 File Offset: 0x00002288
 protected override void View()
 {
     if (this.ispost)
     {
         string mapPath = FPUtils.GetMapPath(this.webpath + "cache");
         if (this.step == "step1")
         {
             this.filename = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
             string a = Path.GetExtension(this.filename).ToLower();
             if (a != ".zip" && a != ".plu")
             {
                 this.ShowErr("该文件不是方配WMS系统插件安装文件类型");
                 return;
             }
             if (!Directory.Exists(mapPath))
             {
                 Directory.CreateDirectory(mapPath);
             }
             if (File.Exists(mapPath + "\\" + this.filename))
             {
                 File.Delete(mapPath + "\\" + this.filename);
             }
             FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + this.filename);
             if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename)))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
             }
             FPZip.UnZipFile(mapPath + "\\" + this.filename, "");
             File.Delete(mapPath + "\\" + this.filename);
             if (!File.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\plugin.config"))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
                 this.ShowErr("插件安装配置文件不存在。");
                 return;
             }
             this.plugininfo = FPSerializer.Load <PluginConfig>(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\plugin.config");
             if (this.plugininfo.guid == "")
             {
                 this.ShowErr("对不起,该插件安装标识码不能为空。");
                 return;
             }
         }
         else if (this.step == "step2")
         {
             string @string = FPRequest.GetString("installpath");
             if (@string == "")
             {
                 this.ShowErr("安装目录不能为空。");
                 return;
             }
             this.filename               = FPRequest.GetString("filename");
             this.plugininfo             = FPSerializer.Load <PluginConfig>(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\plugin.config");
             this.plugininfo.installpath = @string;
             string mapPath2   = FPUtils.GetMapPath(this.webpath + "plugins/" + this.plugininfo.installpath);
             string sourcePath = mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename);
             plugininstall.CopyDirectory(sourcePath, mapPath2);
             Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
             base.Response.Redirect("pluginmanage.aspx");
         }
     }
     base.SaveRightURL();
 }
示例#17
0
 // Token: 0x06000287 RID: 647 RVA: 0x00009728 File Offset: 0x00007928
 public static bool SaveConfig(SysConfig sysconfiginfo)
 {
     return(FPSerializer.Save <SysConfig>(sysconfiginfo, SysConfigs.filename));
 }
示例#18
0
 // Token: 0x06000055 RID: 85 RVA: 0x0000760C File Offset: 0x0000580C
 protected override void View()
 {
     if (this.id > 0)
     {
         this.appinfo = DbHelper.ExecuteModel <AppInfo>(this.id);
     }
     if (this.ispost)
     {
         this.appinfo.target = "";
         this.appinfo        = FPRequest.GetModel <AppInfo>(this.appinfo);
         if (this.appinfo.name == "")
         {
             this.ShowErr("应用名称不能为空");
             return;
         }
         if (this.appinfo.installpath == "")
         {
             this.ShowErr("安装目录不能为空");
             return;
         }
         string pattern = "^[a-zA-Z0-9_\\w]+$";
         if (this.err == 0 && !Regex.IsMatch(this.appinfo.installpath.Trim(), pattern, RegexOptions.IgnoreCase))
         {
             base.AddErr("应用安装目录名称只能由数字、字母或下划线组成。");
         }
         if (this.appinfo.guid == "")
         {
             this.appinfo.guid = Guid.NewGuid().ToString();
         }
         if (this.appinfo.target == "")
         {
             this.appinfo.target = "_self";
         }
         if (this.appinfo.setpath == "")
         {
             this.appinfo.setpath = this.appinfo.installpath;
         }
         this.appinfo.version = FPUtils.StrToDecimal(this.appinfo.version).ToString("0.0");
         SqlParam           sqlParam = DbHelper.MakeAndWhere("appid", this.id);
         List <SortAppInfo> list     = DbHelper.ExecuteList <SortAppInfo>(OrderBy.ASC, new SqlParam[]
         {
             sqlParam
         });
         string text = "";
         foreach (SortAppInfo sortAppInfo in list)
         {
             if (text != "")
             {
                 text += "|";
             }
             string text2 = text;
             text = string.Concat(new string[]
             {
                 text2,
                 sortAppInfo.name,
                 ",",
                 sortAppInfo.markup,
                 ",",
                 sortAppInfo.indexpage,
                 ",",
                 sortAppInfo.viewpage
             });
         }
         this.appinfo.sortapps = text;
         if (this.appinfo.id > 0)
         {
             DbHelper.ExecuteUpdate <AppInfo>(this.appinfo);
         }
         else
         {
             this.id = DbHelper.ExecuteInsert <AppInfo>(this.appinfo);
         }
         FPSerializer.Save <AppInfo>(this.appinfo, FPUtils.GetMapPath(this.webpath + this.appinfo.installpath + "/app.config"));
         base.Response.Redirect("appmanage.aspx");
     }
     base.SaveRightURL();
 }
示例#19
0
        // Token: 0x06000070 RID: 112 RVA: 0x0000A4AC File Offset: 0x000086AC
        protected override void View()
        {
            if (this.id > 0)
            {
                this.appinfo = DbHelper.ExecuteModel <AppInfo>(this.id);
            }
            SqlParam sqlParam = DbHelper.MakeAndWhere("appid", this.id);

            if (this.ispost)
            {
                if (this.action == "appupdate")
                {
                    SortAppInfo sortAppInfo = DbHelper.ExecuteModel <SortAppInfo>(this.sortappid);
                    sortAppInfo = FPRequest.GetModel <SortAppInfo>(sortAppInfo, "sort_");
                    if (sortAppInfo.name == "")
                    {
                        this.ShowErr("栏目应用名称不能为空。");
                        return;
                    }
                    DbHelper.ExecuteUpdate <SortAppInfo>(sortAppInfo);
                }
                else if (this.action == "appadd")
                {
                    SortAppInfo sortAppInfo = FPRequest.GetModel <SortAppInfo>(new SortAppInfo(), "sortadd_");
                    sortAppInfo.appid       = this.id;
                    sortAppInfo.installpath = this.appinfo.installpath;
                    if (sortAppInfo.name == "")
                    {
                        this.ShowErr("栏目应用名称不能为空。");
                        return;
                    }
                    DbHelper.ExecuteInsert <SortAppInfo>(sortAppInfo);
                }
                else if (this.action == "appdelete")
                {
                    DbHelper.ExecuteDelete <SortAppInfo>(FPRequest.GetInt("appid"));
                }
                this.sortapplist = DbHelper.ExecuteList <SortAppInfo>(OrderBy.ASC, new SqlParam[]
                {
                    sqlParam
                });
                string text = "";
                foreach (SortAppInfo sortAppInfo2 in this.sortapplist)
                {
                    if (text != "")
                    {
                        text += "|";
                    }
                    string text2 = text;
                    text = string.Concat(new string[]
                    {
                        text2,
                        sortAppInfo2.name,
                        ",",
                        sortAppInfo2.markup,
                        ",",
                        sortAppInfo2.indexpage,
                        ",",
                        sortAppInfo2.viewpage
                    });
                }
                this.appinfo.sortapps = text;
                FPSerializer.Save <AppInfo>(this.appinfo, FPUtils.GetMapPath(this.webpath + this.appinfo.installpath + "/app.config"));
                CacheBll.RemoveSortCache();
                base.Response.Redirect("appsortmanage.aspx?id=" + this.id);
            }
            this.sortapplist = DbHelper.ExecuteList <SortAppInfo>(OrderBy.ASC, new SqlParam[]
            {
                sqlParam
            });
            base.SaveRightURL();
        }
示例#20
0
 // Token: 0x06000057 RID: 87 RVA: 0x00007994 File Offset: 0x00005B94
 protected override void View()
 {
     this.appinfo = DbHelper.ExecuteModel <AppInfo>(this.appid);
     if (this.appinfo.id == 0)
     {
         this.ShowErr("该应用不存在或已被删除。");
     }
     else
     {
         if (this.ispost)
         {
             string mapPath  = FPUtils.GetMapPath(this.webpath + "cache");
             string fileName = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
             string a        = Path.GetExtension(fileName).ToLower();
             if (a != ".fpk" && a != ".zip")
             {
                 this.ShowErr("对不起,该文件不是方配系统应用更新文件类型。");
                 return;
             }
             if (!Directory.Exists(mapPath))
             {
                 Directory.CreateDirectory(mapPath);
             }
             if (File.Exists(mapPath + "\\" + fileName))
             {
                 File.Delete(mapPath + "\\" + fileName);
             }
             FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + fileName);
             if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName)))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
             }
             FPZip.UnZipFile(mapPath + "\\" + fileName, "");
             File.Delete(mapPath + "\\" + fileName);
             if (!File.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\app.config"))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
                 this.ShowErr("应用配置文件不存在或有错误。");
                 return;
             }
             AppInfo appInfo = FPSerializer.Load <AppInfo>(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\app.config");
             if (this.appinfo.guid == "")
             {
                 this.ShowErr("对不起,该应用标识码错误,更新失败。");
                 return;
             }
             SqlParam sqlParam = DbHelper.MakeAndWhere("guid", this.appinfo.guid);
             this.appinfo = DbHelper.ExecuteModel <AppInfo>(new SqlParam[]
             {
                 sqlParam
             });
             if (this.appinfo.id == 0)
             {
                 this.ShowErr("对不起,该应用不存在或已被删除。");
                 return;
             }
             Version v  = new Version(FPUtils.StrToDecimal(appInfo.version).ToString("0.0"));
             Version v2 = new Version(FPUtils.StrToDecimal(this.appinfo.version).ToString("0.0"));
             if (v < v2)
             {
                 this.ShowErr("对不起,您更新的版本比安装版本还低,不能更新");
                 return;
             }
             this.appinfo.name    = appInfo.name;
             this.appinfo.version = appInfo.version;
             this.appinfo.notes   = appInfo.notes;
             this.appinfo.author  = appInfo.author;
             string mapPath2   = FPUtils.GetMapPath(this.webpath + this.appinfo.installpath);
             string sourcePath = mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName);
             this.appinfo.files = appupdate.CopyDirectory(sourcePath, mapPath2, "", this.appinfo.files);
             if (DbHelper.ExecuteUpdate <AppInfo>(this.appinfo) > 0)
             {
                 foreach (string strContent in appInfo.sortapps.Split(new char[]
                 {
                     '|'
                 }))
                 {
                     string[] array2 = FPUtils.SplitString(strContent, ",", 4);
                     if (!(array2[0] == ""))
                     {
                         SqlParam[] sqlparams = new SqlParam[]
                         {
                             DbHelper.MakeAndWhere("appid", this.appinfo.id),
                             DbHelper.MakeAndWhere("name", array2[0])
                         };
                         SortAppInfo sortAppInfo = DbHelper.ExecuteModel <SortAppInfo>(sqlparams);
                         if (sortAppInfo.id > 0)
                         {
                             sortAppInfo.name      = array2[0];
                             sortAppInfo.markup    = array2[1];
                             sortAppInfo.indexpage = array2[2];
                             sortAppInfo.viewpage  = array2[3];
                             DbHelper.ExecuteUpdate <SortAppInfo>(sortAppInfo);
                         }
                         else
                         {
                             sortAppInfo.appid     = this.appinfo.id;
                             sortAppInfo.name      = array2[0];
                             sortAppInfo.markup    = array2[1];
                             sortAppInfo.indexpage = array2[2];
                             sortAppInfo.viewpage  = array2[3];
                             DbHelper.ExecuteInsert <SortAppInfo>(sortAppInfo);
                         }
                     }
                 }
             }
             Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
             CacheBll.RemoveSortCache();
             base.Response.Redirect("appmanage.aspx");
         }
         base.SaveRightURL();
     }
 }
示例#21
0
 // Token: 0x06000050 RID: 80 RVA: 0x00006B80 File Offset: 0x00004D80
 protected override void View()
 {
     if (this.ispost)
     {
         string mapPath = FPUtils.GetMapPath(this.webpath + "cache");
         if (this.step == "step1")
         {
             this.filename = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
             string a = Path.GetExtension(this.filename).ToLower();
             if (a != ".fpk" && a != ".zip")
             {
                 this.ShowErr("该文件不是方配站点应用安装文件类型");
                 return;
             }
             if (!Directory.Exists(mapPath))
             {
                 Directory.CreateDirectory(mapPath);
             }
             if (File.Exists(mapPath + "\\" + this.filename))
             {
                 File.Delete(mapPath + "\\" + this.filename);
             }
             FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + this.filename);
             if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename)))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
             }
             FPZip.UnZipFile(mapPath + "\\" + this.filename, "");
             File.Delete(mapPath + "\\" + this.filename);
             if (!File.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\app.config"))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
                 this.ShowErr("应用安装配置文件不存在。");
                 return;
             }
             this.appinfo = FPSerializer.Load <AppInfo>(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\app.config");
             if (this.appinfo.guid == "")
             {
                 this.ShowErr("对不起,该应用安装标识码不能为空。");
                 return;
             }
             SqlParam sqlParam = DbHelper.MakeAndWhere("guid", this.appinfo.guid);
             if (DbHelper.ExecuteCount <AppInfo>(new SqlParam[]
             {
                 sqlParam
             }) > 0)
             {
                 this.ShowErr("对不起,该应用已安装,不能重复安装。");
                 return;
             }
         }
         else if (this.step == "step2")
         {
             this.filename = FPRequest.GetString("filename");
             this.appinfo  = FPSerializer.Load <AppInfo>(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\app.config");
             if (this.appinfo.name == "")
             {
                 this.appinfo.name = "无应用名称";
             }
             if (FPRequest.GetString("installpath") == "")
             {
                 this.ShowErr("对不起,安装目录不能为空");
                 return;
             }
             this.appinfo.installpath = FPRequest.GetString("installpath");
             if (!Directory.Exists(FPUtils.GetMapPath(this.webpath + this.appinfo.installpath)))
             {
                 Directory.CreateDirectory(FPUtils.GetMapPath(this.webpath + this.appinfo.installpath));
             }
             string mapPath2   = FPUtils.GetMapPath(this.webpath + this.appinfo.installpath);
             string sourcePath = mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename);
             this.appinfo.files = this.CopyDirectory(sourcePath, mapPath2, "");
             this.appinfo.id    = DbHelper.ExecuteInsert <AppInfo>(this.appinfo);
             if (this.appinfo.id > 0)
             {
                 foreach (string strContent in this.appinfo.sortapps.Split(new char[]
                 {
                     '|'
                 }))
                 {
                     string[] array2 = FPUtils.SplitString(strContent, ",", 4);
                     if (!(array2[0] == ""))
                     {
                         DbHelper.ExecuteInsert <SortAppInfo>(new SortAppInfo
                         {
                             appid       = this.appinfo.id,
                             name        = array2[0],
                             markup      = array2[1],
                             indexpage   = array2[2],
                             viewpage    = array2[3],
                             installpath = this.appinfo.installpath
                         });
                     }
                 }
             }
             Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
             CacheBll.RemoveSortCache();
             base.Response.Redirect("appmanage.aspx");
         }
     }
     base.SaveRightURL();
 }