コード例 #1
0
        private void SetHeaders(int id)
        {
            Settings setting = null;
            var      org     = DbUtil.Db.LoadOrganizationById(id);

            if (org != null && org.UseBootstrap == true)
            {
                SetHeaders2(id);
                return;
            }
            var shell = "";

            if ((settings == null || !settings.ContainsKey(id)) && org != null)
            {
                setting = OnlineRegModel.ParseSetting(org.RegSetting, id);
                shell   = DbUtil.Content(setting.Shell, null);
            }
            if (!shell.HasValue() && settings != null && settings.ContainsKey(id))
            {
                shell = DbUtil.Content(settings[id].Shell, null);
            }
            if (!shell.HasValue())
            {
                shell = DbUtil.Content("ShellDiv-" + id, DbUtil.Content("ShellDefault", ""));
            }

            var s = shell;

            if (s.HasValue())
            {
                var re = new Regex(@"(.*<!--FORM START-->\s*).*(<!--FORM END-->.*)", RegexOptions.Singleline);
                var t  = re.Match(s).Groups[1].Value.Replace("<!--FORM CSS-->",
                                                             ViewExtensions2.jQueryUICss() +
                                                             "\r\n<link href=\"/Content/styles/onlinereg.css?v=8\" rel=\"stylesheet\" type=\"text/css\" />\r\n");
                ViewBag.hasshell = true;
                ViewBag.top      = t;
                var b = re.Match(s).Groups[2].Value;
                ViewBag.bottom = b;
            }
            else
            {
                ViewBag.hasshell = false;
                ViewBag.header   = DbUtil.Content("OnlineRegHeader-" + id,
                                                  DbUtil.Content("OnlineRegHeader", ""));
                ViewBag.top = DbUtil.Content("OnlineRegTop-" + id,
                                             DbUtil.Content("OnlineRegTop", ""));
                ViewBag.bottom = DbUtil.Content("OnlineRegBottom-" + id,
                                                DbUtil.Content("OnlineRegBottom", ""));
            }
        }
コード例 #2
0
        private void SetHeaders(int id)
        {
            Settings setting = null;
            var      org     = DbUtil.Db.LoadOrganizationById(id);
            var      shell   = "";

            if ((settings == null || !settings.ContainsKey(id)) && org != null)
            {
                setting = OnlineRegModel.ParseSetting(org.RegSetting, id);
                shell   = DbUtil.Content(setting.Shell, null);
            }
            if (!shell.HasValue() && settings != null && settings.ContainsKey(id))
            {
                shell = DbUtil.Content(settings[id].Shell, null);
            }
            if (!shell.HasValue())
            {
                shell = DbUtil.Content("ShellDiv-" + id, DbUtil.Content("ShellDefault", ""));
            }

            var s = shell;

            if (s.HasValue())
            {
                var re = new Regex(@"(.*<!--FORM START-->\s*).*(<!--FORM END-->.*)", RegexOptions.Singleline);
                var t  = re.Match(s).Groups[1].Value.Replace("<!--FORM CSS-->",
                                                             @"
<link href=""/Content/styles/jquery-ui-1.10.0.custom.css"" rel=""stylesheet"" type=""text/css"" />
<link href=""/Content/styles/onlinereg.css?v=8"" rel=""stylesheet"" type=""text/css"" />
");
                ViewData["hasshell"] = true;
                ViewData["top"]      = t;
                var b = re.Match(s).Groups[2].Value;
                ViewData["bottom"] = b;
            }
            else
            {
                ViewData["hasshell"] = false;
                ViewData["header"]   = DbUtil.Content("OnlineRegHeader-" + id,
                                                      DbUtil.Content("OnlineRegHeader", ""));
                ViewData["top"] = DbUtil.Content("OnlineRegTop-" + id,
                                                 DbUtil.Content("OnlineRegTop", ""));
                ViewData["bottom"] = DbUtil.Content("OnlineRegBottom-" + id,
                                                    DbUtil.Content("OnlineRegBottom", ""));
            }
        }
コード例 #3
0
        private void SetHeaders2(int id)
        {
            var org   = DbUtil.Db.LoadOrganizationById(id);
            var shell = "";

            if ((settings == null || !settings.ContainsKey(id)) && org != null)
            {
                var setting = OnlineRegModel.ParseSetting(org.RegSetting, id);
                shell = DbUtil.Content(setting.ShellBs, null);
            }
            if (!shell.HasValue() && settings != null && settings.ContainsKey(id))
            {
                shell = DbUtil.Content(settings[id].ShellBs, null);
            }
            if (!shell.HasValue())
            {
                shell = DbUtil.Content("ShellDefaultBs", "");
                if (!shell.HasValue())
                {
                    shell = DbUtil.Content("DefaultShellBs", "");
                }
            }


            if (shell.HasValue())
            {
                var re = new Regex(@"(.*<!--FORM START-->\s*).*(<!--FORM END-->.*)", RegexOptions.Singleline);
                var t  = re.Match(shell).Groups[1].Value.Replace("<!--FORM CSS-->", ViewExtensions2.OnlineReg2Css());
                ViewBag.hasshell = true;
                ViewBag.top      = t;
                var b = re.Match(shell).Groups[2].Value;
                ViewBag.bottom = b;
            }
            else
            {
                ViewBag.hasshell = false;
            }
        }