Пример #1
0
        private void LoadMenu()
        {
            //Get the theme name if it isn't Orchestrator so that it can be used to select the menu
            string themeName = Page.Theme;

            if (themeName.Equals("Orchestrator", StringComparison.CurrentCultureIgnoreCase))
            {
                themeName = string.Empty;
            }

            if (user.IsInRole(((int)eUserRole.ClientUser).ToString()))
            {
                RadMenu1.LoadContentFile(string.Format("~/UserControls/menu{0}Client.xml", themeName));

                Telerik.Web.UI.RadMenuItem knaufMenuItem = null;

                // The knauf menu item must be on the First Menu
                knaufMenuItem = RadMenu1.Items.FindItemByText("Knauf Shunt Loading Sheet");

                if (knaufMenuItem != null)
                {
                    if (user.IsInRole(((int)eUserRole.KnaufLoadingSheetInClientPortal).ToString()))
                    {
                        knaufMenuItem.Visible = true;
                    }
                    else
                    {
                        knaufMenuItem.Visible = false;
                    }
                }
            }
            else if (!Page.IsPostBack)
            {
                RadMenu1.LoadContentFile(string.Format("~/UserControls/menu{0}Default.xml", themeName));
            }

            WhiteLabelHeader();
        }
        private void LoadMenu()
        {
            //Get the theme name if it isn't Orchestrator so that it can be used to select the menu
            string themeName = Page.Theme;

            if (themeName.Equals("Orchestrator", StringComparison.CurrentCultureIgnoreCase))
            {
                themeName = string.Empty;
            }

            if (user.IsInRole(((int)eUserRole.MapViewer).ToString()))
            {
                // limit to map screen and no Menu;
                Response.Redirect("ng/fleet");
            }
            else if (user.IsInRole(((int)eUserRole.ClientUser).ToString()))
            {
                if (!Page.IsPostBack)
                {
                    RadMenu1.LoadContentFile(string.Format("~/UserControls/menu{0}Client.xml", themeName));
                }

                WhiteLabelHeader();
            }
            else if (Globals.Configuration.FleetMetrikInstance)
            {
                if (!Page.IsPostBack)
                {
                    RadMenu1.LoadContentFile("~/UserControls/menuFleetMetrikDefault.xml");
                }
            }
            else if (!Page.IsPostBack)
            {
                RadMenu1.LoadContentFile(string.Format("~/UserControls/menu{0}Default.xml", themeName));
            }
        }