Esempio n. 1
0
        public static string GetPageContent(ManagementPage page)
        {
            initialize();

            string cacheKey = String.Concat("$MP_", ((int)page).ToString());

            return(CacheFactory.Sington.GetResult <String>(
                       cacheKey,
                       () =>
            {
                string pageContent = null;
                string pagePath = null;
                pageSrcs.TryGetValue(page, out pagePath);

                if (pagePath == null || pagePath.Trim() == String.Empty)
                {
                    throw new Exception("页面不存在,PAGE:" + page.ToString());
                }

                pagePath = Cms.PyhicPath + pagePath;
                pageContent = File.ReadAllText(pagePath);

                HttpRuntime.Cache.Insert(
                    cacheKey,
                    pageContent,
                    new CacheDependency(pagePath),
                    DateTime.Now.AddHours(1),
                    TimeSpan.Zero
                    );

                return pageContent;
            }
                       ));
        }
Esempio n. 2
0
        public static string GetPageUrl(ManagementPage page)
        {
            initialize();
            string pagePath = null;

            pageSrcs.TryGetValue(page, out pagePath);
            return(pagePath);
        }
Esempio n. 3
0
 private void Main_FormClosing(object sender, FormClosingEventArgs e)
 {
     MainPage.Dispose();
     BayPage1.Dispose();
     BayPage2.Dispose();
     ManagementPage.Dispose();
     RegisterationPage.Dispose();
     PatientPage.Dispose();
 }
Esempio n. 4
0
            public void EI_Login()
            {
                _browser.Navigate(_config.Url + "/management");
                Auth0LoginPage loginPage      = new Auth0LoginPage(_browser);
                ManagementPage managementPage = loginPage.LoginEI(_config.ConfigObject.Users.AdminUser);
                string         url            = _browser.GetUrl();

                Assert.True(url == _config.Url + "/management", $"User was not login to the management page. Expected:{_config.Url}/management. but actual:{url}");
            }
Esempio n. 5
0
        public static string GetPageContent(ManagementPage page)
        {
            var pagePath = GetPageUrl(page);

            if (pagePath == null || pagePath.Trim() == string.Empty)
            {
                throw new Exception("页面不存在,PAGE:" + page.ToString());
            }
            pagePath = Cms.PhysicPath + pagePath;
            return(File.ReadAllText(pagePath));
        }
Esempio n. 6
0
        //初始化资源
        private static void initialize()
        {
            if (pageSrcs == null)
            {
                //IsOuterLink=System.IO.File.Exists(String.Concat(Cms.PyhicPath,"//frameworkadmin/lock"));

                pageSrcs = new Dictionary <ManagementPage, String>();

                String xmlPath = Cms.BuildOEM.SelectNodeValuePath("/keys/item[@key='manager_set']");

                if (xmlPath == null)
                {
                    return;
                }

                XmlDocument xd = new XmlDocument();
                xd.Load(xmlPath);

                Type   type = typeof(ManagementPage);
                string _for;
                string baseDir;

                baseDir  = xd.SelectSingleNode("/keys/direction").Attributes["path"].Value;
                BasePath = baseDir.StartsWith("/") ? baseDir : "/" + baseDir;
                if (BasePath.EndsWith("/"))
                {
                    BasePath = BasePath.Substring(0, BasePath.Length - 1);
                }

                XmlNodeList nodes = xd.SelectNodes("/keys/group[@name='pages']/item");
                foreach (XmlNode node in nodes)
                {
                    _for = node.Attributes["key"].Value;
                    if (Enum.IsDefined(type, _for))
                    {
                        try
                        {
                            ManagementPage pg = (ManagementPage)Enum.Parse(type, _for);
                            if (!pageSrcs.ContainsKey(pg))
                            {
                                pageSrcs.Add(pg, String.Concat(baseDir, node.Attributes["value"].Value));
                            }
                        }
                        catch (ArgumentException exc)
                        {
                            throw new ArgumentException(exc.Message + ";" + ((ManagementPage)Enum.Parse(type, _for)).ToString());
                        }
                    }
                }
            }
        }
 private int createExportTemplate(string templateName, string stateName, string managePageName, IConcentratorPrincipal user)
 {
     using (var work = GetUnitOfWork())
     {
         ExportTemplate temp = new ExportTemplate();
         ManagementPage mp   = getManagementPage(managePageName);
         temp.ManagementPage   = mp;
         temp.ManagementPageID = mp.PageID;
         temp.TemplateName     = templateName;
         temp.UserID           = user.UserID;
         work.Service <ExportTemplate>().Create(temp);
         work.Save();
         return(temp.ExportTemplateID);
     }
 }
Esempio n. 8
0
            public void EI_Article_FullFlow()
            {
                _browser.Navigate(_config.Url + "/management");
                Auth0LoginPage loginPage      = new Auth0LoginPage(_browser);
                ManagementPage managementPage = loginPage.LoginEI(_config.ConfigObject.Users.AdminUser);

                managementPage.ClickOnEditorButton();
                EditorPage editorPage = new EditorPage(_browser);

                editorPage.ClickOnArticle();
                ArticleBase articleBase = new ArticleBase(_browser);

                articleBase.FillArticleTemplate();
                PostPage postPage = new PostPage(_browser);

                postPage.ValidateComponents(new BsonArray {
                    ".logo-img", ".post-cover__media img", ".post-article__post-title__title", ".post-content", ".post-side-content", "transfer-news--container", ".post-side-content__external-widget.external-widget.external-widget--taboola", ".post-metadata", ".reactions__list", ".share-component--post-cover", ".share-component--post-bottom", ".trc_rbox.thumbnails-b.trc-content-sponsored", ".post-after .trc-content-sponsored", ".user-menu__link", ".edition-component.has-dropdown", ".new-article", ".main-sidenav-toggle", "#site-header"
                });
            }
Esempio n. 9
0
        private void InitalizePages()
        {
            MainPage = new CentralStation(SetPatientPage)
            {
                BayPageCall           = SetPageToBay,
                ManagementPageCall    = CallManagementPage,
                RegisterationPageCall = CallRegisterationPage
            };



            BayPage1 = new BayPage(ref bay1, GoToMainpage)
            {
                PatientPageCall = SetPatientPage
            };
            BayPage2 = new BayPage(ref bay2, GoToMainpage)
            {
                PatientPageCall = SetPatientPage
            };
            ManagementPage = new ManagementPage()
            {
                pageCall0 = GoToMainpage
            };
            RegisterationPage = new RegistrationPage()
            {
                goBackToParentPage = GoToMainpage
            };
            PatientPage         = new BedsidePage(GoToMainpage);
            PatientPage.NavBack = PatientPage.NavForward = NavigatePatientPage;

            pages.Add(0, MainPage);
            pages.Add(1, BayPage1);
            pages.Add(2, BayPage2);
            pages.Add(3, ManagementPage);
            pages.Add(4, RegisterationPage);
            pages.Add(5, PatientPage);
        }
    void OnGUI()
    {
        GUILayout.BeginArea(new Rect(10, 10, Screen.width - 10, Screen.height - 10));

        // ------------ BUTTONS ------------------

        // Prompt to Download Info from the Database
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Download Account Info", GUILayout.Width(200)))
        {
            guiMessage = "Downloading your info..";
            accountInfo.TryToDownload(accountId, AccountInfoDownloaded);
        }

        // Prompt to Upload Info to the Database
        if (GUILayout.Button("Upload Account Info", GUILayout.Width(200)))
        {
            string errorMessage = "";
            if (!accountInfo.fields.CheckMySQLFields(ref errorMessage))
            {
                Debug.LogError("AccountSystem: Invalid MySQL Field Value:\n" + errorMessage);
                guiMessage = errorMessage;
            }
            else
            {
                // If the user set a new password
                if (tempPasswordVal != "")
                {
                    Debug.Log("AccountSystem: Updated Password!");
                    accountInfo.fields.SetFieldValue("password", tempPasswordVal.Hash());
                }
                guiMessage = "Uploading your info..";
                accountInfo.TryToUpload(accountId, AccountInfoUploaded);
            }
        }

        GUILayout.EndHorizontal();


        GUILayout.Label(" ", GUILayout.Width(100));

        if (currentPage == ManagementPage.AccountInfo)
        {
            GUILayout.Label("~~~==== Account Management ====~~~", GUILayout.Width(300));
            if (GUILayout.Button("Go to Custom Info", GUILayout.Width(200)))
            {
                currentPage = ManagementPage.CustomInfo;
            }

            // ------------ ACCOUNT INFO ------------------
            accountInfo = AccountInfoOnGUI(accountInfo);
        }
        else if (currentPage == ManagementPage.CustomInfo)
        {
            // ------------ CUSTOM INFO ------------------
            // Note that upon altering the CustomInfo class,
            // this part will seize to work -
            // Although don't worry, you will still
            // be able to upload / download and see the custom
            // Info class in the default inspector

            GUILayout.Label("~~~==== Custom Info ====~~~", GUILayout.Width(300));
            if (GUILayout.Button("Go to Account Management", GUILayout.Width(200)))
            {
                currentPage = ManagementPage.AccountInfo;
            }

            accountInfo.customInfo = accountInfo.customInfo.CustomInfoOnGUI();
        }


        GUILayout.Label("", GUILayout.Height(10));

        GUILayout.Label(guiMessage);

        // Tutorial
#if UNITY_EDITOR
        GUILayout.Label("", GUILayout.Height(10));
        GUILayout.Label("\bHow To Manage your Account:" +
                        "\n1) Alter your Account Info" +
                        "\n2) Alter your Custom Info" +
                        "\n3) Hit Upload" +
                        "\n\nThis message was printed from AS_AccountManagementGUI.cs", GUILayout.Width(500));
#endif

        GUILayout.EndArea();
    }
Esempio n. 11
0
 public static string GetPageUrl(ManagementPage page)
 {
     initialize();
     pageSources.TryGetValue(page, out var pagePath);
     return(pagePath);
 }
Esempio n. 12
0
        public static string GetPageUrl(ManagementPage page)
        {
            initialize();

            string pagePath = null;
            pageSrcs.TryGetValue(page, out pagePath);
            return pagePath;
        }
Esempio n. 13
0
        public static string GetPageContent(ManagementPage page)
        {
            initialize();

            string cacheKey = String.Concat("$MP_", ((int)page).ToString());
            return CacheFactory.Sington.GetResult<String>(
                cacheKey,
                () =>
                {
                    string pageContent = null;
                    string pagePath = null;
                    pageSrcs.TryGetValue(page, out pagePath);

                    if (pagePath == null || pagePath.Trim() == String.Empty)
                    {
                        throw new Exception("页面不存在,PAGE:" + page.ToString());
                    }

                    pagePath = Cms.PyhicPath + pagePath;
                    pageContent = File.ReadAllText( pagePath);

                    HttpRuntime.Cache.Insert(
                        cacheKey,
                        pageContent,
                        new CacheDependency(pagePath),
                         DateTime.Now.AddHours(1),
                         TimeSpan.Zero
                        );

                    return pageContent;
                }
                );
        }