Esempio n. 1
0
        protected void setViewContext(SecurityView view)
        {
            _panel_View.SuspendLayout();
            m_ignoreToolClick = true;

            if (m_selectedView != view)
            {
                _label_Msg.Visible                 =
                    _policySummary.Visible         =
                        _sqlServerSettings.Visible =
                            _policyUsers.Visible   = false;
                m_selectedView = view;
            }

            if (m_showMsg)
            {
                _label_Msg.Visible = true;
            }
            else
            {
                _label_Msg.Visible = false;
                switch (view)
                {
                case SecurityView.Summary:
                    if (m_server == null)
                    {
                        ((Interfaces.IView)_policySummary).SetContext(new Data.PolicySummary(m_policy, UseBaselineSnapshots, SelectionTime));
                    }
                    else
                    {
                        ((Interfaces.IView)_policySummary).SetContext(new Data.PolicySummary(m_policy, UseBaselineSnapshots, SelectionTime, m_server));
                    }
                    _policySummary.Visible = true;
                    break;

                case SecurityView.Settings:
                    if (m_server == null)
                    {
                        ((Interfaces.IView)_sqlServerSettings).SetContext(new Data.SqlServerSettings(m_policy, UseBaselineSnapshots, SelectionTime));
                    }
                    else
                    {
                        ((Interfaces.IView)_sqlServerSettings).SetContext(new Data.SqlServerSettings(m_policy, UseBaselineSnapshots, SelectionTime, m_server));
                    }
                    _sqlServerSettings.Visible = true;
                    break;

                case SecurityView.Users:
                    if (m_server == null)
                    {
                        ((Interfaces.IView)_policyUsers).SetContext(new Data.PolicyUsers(m_policy, UseBaselineSnapshots, SelectionTime));
                    }
                    else
                    {
                        ((Interfaces.IView)_policyUsers).SetContext(new Data.PolicyUsers(m_policy, UseBaselineSnapshots, SelectionTime, m_server));
                    }
                    _policyUsers.Visible = true;
                    break;
                }
            }

            m_ignoreToolClick = false;
            _panel_View.ResumeLayout();

            setMenuConfiguration();
        }
Esempio n. 2
0
        public static string GetPageView(string templateSuffix, string themeName, string pageTitle, string headerTitle, string helpUrl, string afterAction)
        {
            #region Variables

            bool enableMobileAddress = false;
            int  dataIndex           = 0;

            #endregion

            #region Get JQ Js/Css Resources

            string cssResourcesLink = "";
            string jsResourcesLink  = "";
            string currentThemeName = MobileTheme.Default.ToString();
            if (string.IsNullOrEmpty(themeName) == false)
            {
                currentThemeName = themeName;
            }
            MobileView.GetMobileHeaderResource(enableMobileAddress, currentThemeName, out cssResourcesLink, out jsResourcesLink);

            #endregion

            #region Set Mobile Page Header Html

            string htmlMobilePageHeader = "";  //"<h2>InfoList Manager</h2>";

            #endregion

            #region Get Mobile Page Security Html

            string htmlMobilePageSecure = "";

            htmlMobilePageSecure = SecurityView.GetView(dataIndex, templateSuffix, headerTitle, helpUrl, afterAction, "");

            #endregion

            #region Get Mobile Page Content Html

            string htmlMobilePageContent = "";

            if ((UtilsGeneric.ForceLogin == false) || (UtilsSecurity.IsAuthenticated() == true))
            {
                if (UtilsSecurity.HaveAdminRole() == true)
                {
                    string infoCategoryView = InfoCategoryView.GetView(dataIndex, templateSuffix);
                    htmlMobilePageContent += infoCategoryView;
                }

                string pageView = InfoPageView.GetView(dataIndex + 1, templateSuffix);
                htmlMobilePageContent += pageView;
            }

            #endregion

            #region Get Mobile Page Html

            string htmlMobilePage = MobileView.GetView(templateSuffix, htmlMobilePageHeader, htmlMobilePageSecure, htmlMobilePageContent, "");

            #endregion

            #region Get IndexPage Header Html

            string htmlPageHeader = "";

            #endregion

            #region Get IndexPage Content Html

            string htmlPageContent = htmlMobilePage;

            #endregion

            #region Get IndexPage Footer Html

            string htmlPageFooter = "";

            #endregion

            #region Get IndexPage Html

            string htmlText = GenericView.GetView(templateSuffix, pageTitle, cssResourcesLink, jsResourcesLink, htmlPageHeader, htmlPageContent, htmlPageFooter, enableMobileAddress, true);

            #endregion

            return(htmlText);
        }