Пример #1
0
 public static ASPxMenu MenuItem(this ASPxMenu menu,
                                 string name, string text, string iconFile,
                                 Action <DevExpress.Web.MenuItem> itemSet = null, int index = -1)
 {
     DevExpress.Web.MenuItem item = new DevExpress.Web.MenuItem()
     {
         Name = name,
         Text = text
     };
     item.ItemStyle.BackgroundImage.ImageUrl           = "~/images/" + iconFile;
     item.ItemStyle.BackgroundImage.Repeat             = BackgroundImageRepeat.NoRepeat;
     item.ItemStyle.BackgroundImage.VerticalPosition   = "center";
     item.ItemStyle.BackgroundImage.HorizontalPosition = "left";
     item.ItemStyle.CssClass            = "item";
     item.ItemStyle.HoverStyle.CssClass = "itemHover";
     if (itemSet != null)
     {
         itemSet(item);
     }
     if (index >= 0)
     {
         menu.Items.Insert(index, item);
     }
     menu.Items.Add(item);
     return(menu);
 }
Пример #2
0
        //3/26/2015 NS added for DevEx upgrade to 14.2
        public void CreateMenu1()
        {
            try
            {
                //menu.Items.Clear();
                ASPxMenu1.Items.Clear();

                DataTable NavigatorTree = VSWebBL.SecurityBL.AdminTabBL.Ins.GetNavigatorByUserID(int.Parse(Session["UserID"].ToString()), "<=3", "Configurator");
                DataView  dataView      = new DataView(NavigatorTree);
                //dataView.Sort = "ParentID";

                // Build Menu Items
                Dictionary <string, DevExpress.Web.MenuItem> menuItems =
                    new Dictionary <string, DevExpress.Web.MenuItem>();

                for (int i = 0; i < dataView.Count; i++)
                {
                    DataRow row = dataView[i].Row;
                    if (row["DisplayText"].ToString() == "Configurator" && Session["Isconfigurator"] == null)
                    {
                        //do nothing, to stop adding configurator menu
                    }
                    else if (row["DisplayText"].ToString() == "Configurator" && Session["Isconfigurator"].ToString() == "False")
                    {
                        //do nothing, to stop adding configurator menu
                    }
                    else
                    {
                        DevExpress.Web.MenuItem item = CreateMenuItem(row);
                        string itemID   = row["ID"].ToString();
                        string parentID = row["ParentID"].ToString();
                        string level    = row["Level"].ToString();
                        //Sowjanya for ticket VSPLUS-2519
                        if (item.Text.Equals("Documentation") || item.Text.Equals("Support Portal"))
                        {
                            item.Target = "_blank";
                        }
                        if (menuItems.ContainsKey(parentID))
                        {
                            menuItems[parentID].Items.Add(item);
                        }
                        else
                        {
                            if (parentID == "") // It's Root Item
                            //menu.Items.Add(item);
                            {
                                ASPxMenu1.Items.Add(item);
                            }
                        }
                        menuItems.Add(itemID, item);
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw;
            }
        }
Пример #3
0
 public static void RemoveMenuItem(ASPxSchedulerPopupMenu menu, string menuItemName)
 {
     DevExpress.Web.MenuItem item = menu.Items.FindByName(menuItemName);
     if (item != null)
     {
         menu.Items.Remove(item);
     }
 }
Пример #4
0
 public static ASPxMenu MenuItem <T>(
     this ASPxMenu menu, T templateItem) where T : TemplateItem.BaseItem
 {
     DevExpress.Web.MenuItem item = new DevExpress.Web.MenuItem();
     item.Template = templateItem;
     menu.Items.Add(item);
     return(menu);
 }
Пример #5
0
 public ASPxMenuItemChoiceActionItem(SingleChoiceAction action, ChoiceActionItem item)
     : base(item, action)
 {
     _currentAction  = action;
     CurrentMenuItem = new MenuItem {
         Name = item.GetIdPath()
     };
     SynchronizeWithItem();
 }
Пример #6
0
 protected void PrepareUserMenu()
 {
     if (!IsPostBack)
     {
         DevExpress.Web.MenuItem userItem = UserMenu.Items.FindByName("User");
         userItem.Text      = DocumentsApp.User.CurrentUser.Name;
         userItem.Image.Url = DocumentsApp.GetCurrentUserAvatarVirtPath();
     }
 }
Пример #7
0
 private DevExpress.Web.MenuItem CreateMenuItem(DataRow row)
 {
     DevExpress.Web.MenuItem ret = new DevExpress.Web.MenuItem();
     ret.Text        = row["DisplayText"].ToString();
     ret.NavigateUrl = row["PageLink"].ToString();
     ret.BeginGroup  = true;
     ret.Image.Url   = row["ImageUrl"].ToString();
     return(ret);
 }
Пример #8
0
        protected void menu_Init(object sender, EventArgs e)
        {
            DevExpress.Web.ASPxMenu menu = (DevExpress.Web.ASPxMenu)sender;
            try
            {
                //3/26/2015 NS modified for DevEx upgrade to 14.2
                //menu.Items.Clear();
                menu.Items.Clear();
                DataTable NavigatorTree = VSWebBL.SecurityBL.AdminTabBL.Ins.GetNavigatorByUserID(int.Parse(Session["UserID"].ToString()), "<=2", "Dashboard");
                DataView  dataView      = new DataView(NavigatorTree);
                //dataView.Sort = "ParentID";

                // Build Menu Items
                Dictionary <string, DevExpress.Web.MenuItem> menuItems =
                    new Dictionary <string, DevExpress.Web.MenuItem>();

                for (int i = 0; i < dataView.Count; i++)
                {
                    DataRow row = dataView[i].Row;
                    if (row["DisplayText"].ToString() == "Configurator" && Session["Isconfigurator"] == null)
                    {
                        //do nothing, to stop adding configurator menu
                    }
                    else if (row["DisplayText"].ToString() == "Configurator" && Session["Isconfigurator"].ToString() == "False")
                    {
                        //do nothing, to stop adding configurator menu
                    }
                    else
                    {
                        DevExpress.Web.MenuItem item = CreateMenuItem(row);
                        string itemID   = row["ID"].ToString();
                        string parentID = row["ParentID"].ToString();

                        if (menuItems.ContainsKey(parentID))
                        {
                            menuItems[parentID].Items.Add(item);
                        }
                        else
                        {
                            if (parentID == "") // It's Root Item
                            //3/26/2015 NS modified for DevEx upgrade to 14.2
                            //menu.Items.Add(item);
                            {
                                menu.Items.Add(item);
                            }
                        }
                        menuItems.Add(itemID, item);
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw;
            }
        }
Пример #9
0
        int INavigationControlTestable.GetSubGroupCount(ChoiceActionItem item)
        {
            DevExpress.Web.MenuItem group = FindMenuGroupControl(item);

            if (group != null && group.Items.Count > 0)
            {
                return(group.Items[0].Items.Count);
            }
            return(0);
        }
Пример #10
0
 public ASPxMenuItemChoiceActionItem(SingleChoiceAction action, ChoiceActionItem item)
     : base(item, action)
 {
     CurrentAction   = action;
     CurrentMenuItem = new DevExpress.Web.MenuItem {
         Name = item.GetIdPath()
     };
     //SyncronizeWithItem();
     SynchronizeWithItem();
 }
    protected void ASPxScheduler1_PopupMenuShowing(object sender, DevExpress.Web.ASPxScheduler.PopupMenuShowingEventArgs e)
    {
        ASPxSchedulerPopupMenu menu = e.Menu;

        if (menu.MenuId.Equals(SchedulerMenuItemId.AppointmentMenu))
        {
            DevExpress.Web.MenuItem item = new DevExpress.Web.MenuItem("Export", "ExportAppointment");
            e.Menu.Items.Insert(1, item);
            e.Menu.ClientSideEvents.ItemClick = "function(s, e) { OnMenuClick(s,e); }";
        }
    }
Пример #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string documentName = DocumentsApp.Document.CurrentDocument.Name;
         Page.Title      = documentName;
         TitleLabel.Text = documentName;
         DevExpress.Web.MenuItem userItem = UserMenu.Items.FindByName("User");
         userItem.Text      = DocumentsApp.User.CurrentUser.Name;
         userItem.Image.Url = DocumentsApp.GetCurrentUserAvatarVirtPath();
     }
 }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!IsPostBack)
                {
                    filllotusScanNowItems();
                    Session["myRow"] = null;
                }



                StatusListPopupMenu.Items.Clear();
                if (Session["Isconfigurator"] != null)
                {
                    if (Session["Isconfigurator"].ToString() == "True")
                    {
                        DevExpress.Web.MenuItem item = new DevExpress.Web.MenuItem();
                        item.Text = "Scan First";
                        item.Name = "ScanNow";
                        StatusListPopupMenu.Items.Add(item);
                        //DevExpress.Web.MenuItem item1 = new DevExpress.Web.MenuItem();
                        //item1.Text = "Edit in Configurator";
                        //item1.Name = "EditConfigurator";
                        //StatusListPopupMenu.Items.Add(item1);
                        //DevExpress.Web.MenuItem item2 = new DevExpress.Web.MenuItem();
                        //item2.Text = "Suspend Temporarily";
                        //item2.Name = "Suspend";
                        //StatusListPopupMenu.Items.Add(item2);
                    }
                    else
                    {
                        DevExpress.Web.MenuItem item = new DevExpress.Web.MenuItem();
                        item.Text = "Scan First";
                        item.Name = "ScanNow";
                        StatusListPopupMenu.Items.Add(item);
                    }
                }
                else
                {
                    DevExpress.Web.MenuItem item = new DevExpress.Web.MenuItem();
                    item.Text = "Scan First";
                    item.Name = "ScanNow";
                    StatusListPopupMenu.Items.Add(item);
                    filllotusScanNowItems();
                }
            }
            else
            {
                FilllotusScanNowItemsfromSession();
            }
        }
Пример #14
0
 private void UpdateSelection()
 {
     _asPxMenuControl.SelectedItem = null;
     if (SingleChoiceAction != null && SingleChoiceAction.SelectedItem != null)
     {
         ChoiceActionItem actionItem = SingleChoiceAction.SelectedItem;
         if (_actionItemToMenuItemMap.ContainsKey(actionItem))
         {
             MenuItem itemLink = _actionItemToMenuItemMap[actionItem];
             _asPxMenuControl.SelectedItem = itemLink;
         }
     }
 }
Пример #15
0
 private void UpdateSelection()
 {
     ASPxMenuControl.SelectedItem = null;
     if (SingleChoiceAction != null && SingleChoiceAction.SelectedItem != null)
     {
         ChoiceActionItem actionItem = SingleChoiceAction.SelectedItem;
         if (ActionItemToMenuItemMap.ContainsKey(actionItem))
         {
             DevExpress.Web.MenuItem itemLink = ActionItemToMenuItemMap[actionItem];
             ASPxMenuControl.SelectedItem = itemLink;
         }
     }
 }
Пример #16
0
        protected MenuItem InitNewItem(String text, String name, bool selected)
        {
            var selectedColor = Color.FromArgb(Convert.ToInt32("EDEDEB", 16));
            var defaultColor  = Color.White;

            var menuItem = new MenuItem(text, name);

            menuItem.Selected            = selected;
            menuItem.ItemStyle.Height    = 25;
            menuItem.ItemStyle.BackColor = (menuItem.Selected ? selectedColor : defaultColor);

            return(menuItem);
        }
Пример #17
0
 public ASPxMenuGroupChoiceActionItem(SingleChoiceAction action, ChoiceActionItem item)
     : base(item, action){
     _currentMenuGroup = new MenuItem();
     if (action.Items.IndexOf(item) == 0){
         //CurrentMenuGroup.HeaderStyle.CssClass += " FirstHeader";
         //CurrentMenuGroup.HeaderStyleCollapsed.CssClass = " FirstHeaderCollapsed";
     }
     if (action.Items.IndexOf(item) == action.Items.Count - 1){
         //CurrentMenuGroup.HeaderStyle.CssClass = " LastHeader";
         //CurrentMenuGroup.HeaderStyleCollapsed.CssClass = " LastHeaderCollapsed";
     }
     //CurrentMenuGroup.Expanded = false;
     SyncronizeWithItem();
 }
Пример #18
0
 private void FillMenuGroup(DevExpress.Web.MenuItem group, ChoiceActionItem groupValue)
 {
     foreach (ChoiceActionItem itemValue in groupValue.Items)
     {
         if (!itemValue.Active)
         {
             continue;
         }
         ASPxMenuItemChoiceActionItem itemWrapper = new ASPxMenuItemChoiceActionItem(SingleChoiceAction, itemValue);
         MenuItemToWrapperMap.Add(itemWrapper.CurrentMenuItem, itemWrapper);
         group.Items.Add(itemWrapper.CurrentMenuItem);
         ActionItemToMenuItemMap.Add(itemValue, itemWrapper.CurrentMenuItem);
     }
 }
Пример #19
0
    protected void Menu_DataBinding(object sender, EventArgs e)
    {
        ASPxMenu     menu = (ASPxMenu)sender;
        RepeaterItem item = menu.NamingContainer as RepeaterItem;

        if (item != null)
        {
            ThemeGroupModel group = item.DataItem as ThemeGroupModel;
            foreach (ThemeModel theme in group.Themes)
            {
                DevExpress.Web.MenuItem menuItem = menu.Items.Add(theme.Title, theme.Name);
                menuItem.ToolTip = theme.Title;
            }
        }
    }
Пример #20
0
        private DevExpress.Web.MenuItem CreateMenuItem(DataRow row)
        {
            DevExpress.Web.MenuItem ret = new DevExpress.Web.MenuItem();
            ret.Name = "mnu" + row[Constantes.ColumnaMenuNombre].ToString();
            ret.Text = row[Constantes.ColumnaMenuNombre].ToString();
            if (row[Constantes.ColumnaArbolUrl].ToString() != "")
            {
                ret.NavigateUrl = row[Constantes.ColumnaArbolUrl].ToString();
            }
            if (row[Constantes.ColumnaMenuIcoPath].ToString() != "")
            {
                ret.Image.Url = row[Constantes.ColumnaMenuIcoPath].ToString();
            }

            return(ret);
        }
Пример #21
0
        protected void LoadMenu(XmlElement PpItemNode, DevExpress.Web.MenuItemCollection MpTarget)
        {
            // In case of error - enable everything
            bool   bPermitted = true;
            string sItemFlags = PpItemNode.GetAttribute("Roles");

            if (User != null && sItemFlags.Length > 0)
            {
                int nItemFlags = Convert.ToInt32(sItemFlags, 16);
                if ((nItemFlags & MpUser.RoleBits) == 0)
                {
                    bPermitted = false;
                }
            }

            if (bPermitted)
            {
                DevExpress.Web.MenuItem pItem = new DevExpress.Web.MenuItem();

                String sName = PpItemNode.GetAttribute("Name");
                if (sName.Length > 0)
                {
                    pItem.Name = sName;
                }

                if (PpItemNode.GetAttribute("ClientEnabled") == "true")
                {
                    pItem.ClientEnabled = true;
                }

                pItem.Text        = PpItemNode.GetAttribute("Text");
                pItem.NavigateUrl = PpItemNode.GetAttribute("NavigateUrl");

                MpTarget.Add(pItem);

                // Recurse to load child nodes
                foreach (XmlElement pChild in PpItemNode.SelectNodes("Items/MenuItem"))
                {
                    LoadMenu(pChild, pItem.Items);
                }
            }
            else
            {
                CheckPageSpoof(PpItemNode);
            }
        }
Пример #22
0
 public ASPxMenuGroupChoiceActionItem(SingleChoiceAction action, ChoiceActionItem item)
     : base(item, action)
 {
     CurrentMenuGroup = new DevExpress.Web.MenuItem();
     if (action.Items.IndexOf(item) == 0)
     {
         //CurrentMenuGroup.HeaderStyle.CssClass += " FirstHeader";
         //CurrentMenuGroup.HeaderStyleCollapsed.CssClass = " FirstHeaderCollapsed";
     }
     if (action.Items.IndexOf(item) == action.Items.Count - 1)
     {
         //CurrentMenuGroup.HeaderStyle.CssClass = " LastHeader";
         //CurrentMenuGroup.HeaderStyleCollapsed.CssClass = " LastHeaderCollapsed";
     }
     //CurrentMenuGroup.Expanded = false;
     SyncronizeWithItem();
 }
Пример #23
0
        protected void ASPxMenu1_Init(object sender, EventArgs e)
        {
            string[][] arrOfMenuItems =
            {
                new string[] { "Dashboard",  "OverallHealth1.aspx"  },
                new string[] { "O365 Stats", "Office365Health.aspx" }
            };

            DevExpress.Web.MenuItem item;
            foreach (string[] arr in arrOfMenuItems)
            {
                item             = new DevExpress.Web.MenuItem();
                item.Text        = arr[0];
                item.NavigateUrl = arr[1];

                ASPxMenu1.Items[0].Items.Add(item);
            }
        }
    public ASPxMenu CreateASPxMenu()
    {
        ASPxMenu menu = new ASPxMenu();

        menu.ID = "menu";
        menu.AllowSelectItem     = true;
        menu.CustomJSProperties += Pass_CustomJSProperties;
        this.Controls.Add(menu);
        menu.EnableClientSideAPI = true;
        menu.ClientSideEvents.SetEventHandler("ItemClick", "OnItemClick");
        menu.ClientSideEvents.SetEventHandler("Init", "OnMenuInit");
        DevExpress.Web.MenuItem item = menu.Items.Add("Select a theme");
        for (int i = 0; i < Items.Count; i++)
        {
            item.Items.Add(Items[i].ToString(), Items[i].ToString());
        }
        return(menu);
    }
Пример #25
0
        int INavigationControlTestable.GetSubItemsCount(ChoiceActionItem item)
        {
            if (ActionItemToMenuItemMap.ContainsKey(item))
            {
                return(0);
            }

            if (ActionItemToMenuGroupMap.ContainsKey(item))
            {
                DevExpress.Web.MenuItem menuGroup = ActionItemToMenuGroupMap[item];
                if (menuGroup.Items.Count > 0)
                {
                    return(menuGroup.Items[0].Items.Count);
                }
                return(ActionItemToMenuGroupMap[item].Items.Count);
            }
            return(0);
        }
Пример #26
0
        protected void GenerarMenu(DevExpress.Web.ASPxMenu menu)
        {
            try
            {
                DataTable dtbMenu = (DataTable)Session["MenuEmpleado"];
                // Build Menu Items
                Dictionary <string, DevExpress.Web.MenuItem> menuItems =
                    new Dictionary <string, DevExpress.Web.MenuItem>();

                foreach (DataRow dtr in dtbMenu.Rows)
                {
                    DevExpress.Web.MenuItem item = CreateMenuItem(dtr);
                    string itemID   = dtr[Constantes.ColumnaMenuCodigo].ToString();
                    string parentID = dtr[Constantes.ColumnaMenuPadre].ToString();

                    if (dtr[Constantes.ColumnaMenuPadre].ToString() == "0")
                    {
                        item.ItemStyle.CssClass = "btn-menu-interno";
                    }

                    if (menuItems.ContainsKey(parentID))
                    {
                        menuItems[parentID].Items.Add(item);
                    }
                    else
                    {
                        if (parentID == "0") // It's Root Item
                        {
                            menu.Items.Add(item);
                        }
                    }
                    menuItems.Add(itemID, item);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        FileManager.SettingsFileList.View = CurrentViewMode;
        string viewModeClass = IsDetailsViewMode ? "DetailsView" : "ThumbnailsView";

        FileManager.CssClass = "FileManager " + viewModeClass;

        if (IsDetailsViewMode)
        {
            FileManager.Styles.File.Width  = Unit.Empty;
            FileManager.Styles.File.Height = Unit.Empty;
        }
        else
        {
            FileManager.Styles.File.Width  = Unit.Pixel(270);
            FileManager.Styles.File.Height = Unit.Pixel(270);
        }
        DevExpress.Web.MenuItem viewModeItem = ViewModeMenu.Items.FindByName(CurrentViewModeName);
        if (viewModeItem != null)
        {
            viewModeItem.Selected = true;
        }
    }
 protected void ASPxScheduler1_PopupMenuShowing(object sender, DevExpress.Web.ASPxScheduler.PopupMenuShowingEventArgs e) {
     ASPxSchedulerPopupMenu menu = e.Menu;
     DevExpress.Web.MenuItemCollection menuItems = menu.Items;
     if(menu.Id.Equals(SchedulerMenuItemId.DefaultMenu)) {
         ClearUnusedDefaultMenuItems(menu);
         AddScheduleNewEventSubMenu(menu, "Schedule New Event");
     } else if(menu.Id.Equals(SchedulerMenuItemId.AppointmentMenu)) {
         menu.ClientSideEvents.ItemClick = String.Format("function(s, e) {{ DefaultAppointmentMenuHandler({0}, s, e); }}", ASPxScheduler1.ClientID);
         menu.Items.Clear();
         AddScheduleNewEventSubMenu(menu, "Change Event");
         DevExpress.Web.MenuItem deleteItem = new DevExpress.Web.MenuItem("Delete", "DeleteId");
         deleteItem.BeginGroup = true;
         menuItems.Add(deleteItem);
     }
 }
 protected void AddScheduleNewEventSubMenu(ASPxSchedulerPopupMenu menu, string caption) {
     DevExpress.Web.MenuItem newWithTemplateItem = new DevExpress.Web.MenuItem(caption, "TemplateEvents");
     newWithTemplateItem.BeginGroup = true;
     menu.Items.Insert(0, newWithTemplateItem);
     AddTemplatesSubMenuItems(newWithTemplateItem);
 }
Пример #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Isconfigurator"] == null)
            {
                if (Session["UserFullName"] == null)
                {
                    Session["UserFullName"] = "Anonymous";
                    Session["IsDashboard"]  = "true";
                    Session["UserFullName"] = "Anonymous";
                }
                Response.Redirect("~/Dashboard/OverallHealth1.aspx", false);//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback
                Context.ApplicationInstance.CompleteRequest();
            }
            else if (Session["Isconfigurator"].ToString() == "False")
            {
                if (Session["UserFullName"] == null)
                {
                    Session["UserFullName"] = "Anonymous";
                    Session["IsDashboard"]  = "true";
                    Session["UserFullName"] = "Anonymous";
                }
                Response.Redirect("~/Dashboard/OverallHealth1.aspx", false);//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback
                Context.ApplicationInstance.CompleteRequest();
            }
            Session.Timeout = 60;
            Company cmpobj = new Company();

            cmpobj        = VSWebBL.ConfiguratorBL.CompanyBL.Ins.GetLogo();
            logo.ImageUrl = cmpobj.LogoPath;//"/images/logo.png";

            if (!IsPostBack)
            {            //1/21/2016 Durga modified for VSPLUS-2474
                ProcessPageSessions();
                CheckMasterService();

                if (Request.QueryString["hidesubmenu"] != null)
                {
                    SubMenu.Items.Clear();
                    SessionsKill();
                    SubMenu.Items.Clear();
                    Session["GroupIndex"] = null;
                    Session["ItemIndex"]  = null;
                    Session["Submenu"]    = null;
                    Session["MenuID"]     = "";
                    SubMenu.Visible       = false;
                }



                // Handle the session timeout
                Session["Masterpage"] = "~/Site1.Master";


                string        sessionExpiredUrl = Request.Url.GetLeftPart(UriPartial.Authority) + "/SessionExpired.aspx";
                StringBuilder script            = new StringBuilder();
                script.Append("function expireSession(){ \n");
                script.Append(string.Format(" window.location = '{0}';\n", sessionExpiredUrl));
                script.Append("} \n");
                script.Append(string.Format("setTimeout('expireSession()', {0}); \n", this.Session.Timeout * 60000)); // Convert minutes to milliseconds
                this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "expirescript", script.ToString(), true);


                if (Session["RestrictedMenus"] != null)
                {
                    if (Session["RestrictedMenus"].ToString() != "")
                    {
                        string    path = HttpContext.Current.Request.Url.AbsolutePath;
                        DataTable RestrictedDataTable = (DataTable)Session["RestrictedMenus"];
                        DataRow[] RestrictedRow       = RestrictedDataTable.Select("PageLink='" + path + "'");
                        if (RestrictedRow.Count() > 0)
                        {
                            SignOut();
                        }
                    }
                }

                CreateMenu();
                //Sowjanya ticket-1811
                bool success = VSWebBL.SecurityBL.UsersBL.Ins.GetIsFirstTimeLogin(Convert.ToInt32(Session["UserID"]));
                if (success == true)
                {
                    MainMenu.Visible  = false;
                    ASPxMenu1.Visible = false;
                }
            }

            if (Session["UserFullName"] != null)
            {
                UserFullNameLabel.Text = Session["UserFullName"].ToString();
            }

            //Submenus Level-3 from DB
            if (Session["MenuID"] != "" && Session["MenuID"] != null)
            {
                DataTable dtL3       = (DataTable)Session["Level3Menus"];
                DataTable dtl3Filter = dtL3.Clone();
                DataRow[] drL3       = dtL3.Select("ParentId=" + Session["MenuID"]);
                foreach (DataRow row in drL3)
                {
                    dtl3Filter.ImportRow(row);
                }
                if (dtl3Filter.Rows.Count > 0)
                {
                    //5/13/2014 NS added the line below per Mukund's email
                    SubMenu.Items.Clear();
                    SubMenu.Visible = true;
                    DataView dataView = new DataView(dtl3Filter);
                    dataView.Sort = "ParentID";
                    // Build SubMenu Items
                    Dictionary <string, DevExpress.Web.MenuItem> menuItems = new Dictionary <string, DevExpress.Web.MenuItem>();
                    for (int i = 0; i < dataView.Count; i++)
                    {
                        DataRow row = dataView[i].Row;
                        DevExpress.Web.MenuItem item = CreateMenuItem(row);
                        string itemID   = row["ID"].ToString();
                        string parentID = row["ParentID"].ToString();
                        SubMenu.Items.Add(item);
                        menuItems.Add(itemID, item);
                    }
                    //SubMenu.Items[0].Selected = true;
                }
            }

            if (Session["GroupIndex"] != null)
            {
                MainMenu.Groups[Convert.ToInt32(Session["GroupIndex"].ToString())].Items[Convert.ToInt32(Session["ItemIndex"].ToString())].Selected = true;
                MainMenu.Groups[Convert.ToInt32(Session["GroupIndex"].ToString())].Expanded = true;
            }


            //7/2/2013 NS added

            //if (Session["ViewBy"] == null) Session["ViewBy"] = "ServerType";
            //if (Session["FilterByValue"] == null) Session["FilterByValue"] = "null";

            if (Session["FilterByValue"] == null || Session["FilterByValue"].ToString() == "")
            {
                Session["FilterByValue"] = "null";
            }
            if (Session["ViewBy"] == null || Session["FilterByValue"].ToString() == "")
            {
                Session["ViewBy"] = "ServerType";
            }
            //10/3/2013 NS commented out the !IsPostBack condition since otherwise page refresh did not take place
            //when async postback was sent by the timer
            //if (!IsPostBack)
            //{
            AssignStatusbox();
            //}
            //10/3/2013 NS added timer refresh interval; set in milliseconds; refreshtime comes from the Users table and should be set in seconds
            //12/17/2013 NS uncommented out
            if (Session["Refreshtime"] != "" && Session["Refreshtime"] != null)
            {
                timer1.Interval = Convert.ToInt32(Session["Refreshtime"]) * 1000;
            }

            //Mukund 16Jul14, VSPLUS-741, VSPLUS-785 Disable/Enable Timer to update count in Header boxes
            //Check MenuItems table for new fields SessionNames & TimerEnable
            DisableTimer();

            //10/27/2014 NS added for VSPLUS-1039
            if (CultureInfo.CurrentCulture.Name.Contains("zh-"))
            {
                fontLink.Href = "http://fonts.useso.com/css?family=Francois One";
            }
            else
            {
                fontLink.Href = "http://fonts.googleapis.com/css?family=Francois One";
            }
            //3/26/2015 NS added for DevEx upgrade to 14.2

            CreateMenu1();

            //WS COMMENTED FOR SAFE COMMIT
            //SetUpCircles();
        }
Пример #31
0
        private void FillMenuContents(DevExpress.Web.MenuItemCollection holderMenuItems, ChoiceActionItemCollection actionItems)
        {
            foreach (ChoiceActionItem groupValue in actionItems)
            {
                if (!groupValue.Active)
                {
                    continue;
                }

                if (groupValue.Items.Count == 0)
                {
                    ASPxMenuItemChoiceActionItem itemWrapper = new ASPxMenuItemChoiceActionItem(SingleChoiceAction,
                                                                                                groupValue);
                    MenuItemToWrapperMap.Add(itemWrapper.CurrentMenuItem, itemWrapper);
                    holderMenuItems.Add(itemWrapper.CurrentMenuItem);
                    ActionItemToMenuItemMap.Add(groupValue, itemWrapper.CurrentMenuItem);
                }
                else
                {
                    ASPxMenuGroupChoiceActionItem groupItem = new ASPxMenuGroupChoiceActionItem(SingleChoiceAction,
                                                                                                groupValue);
                    GroupWrappers.Add(groupItem);
                    DevExpress.Web.MenuItem group = groupItem.MenuGroup;
                    ActionItemToMenuGroupMap.Add(groupValue, group);
                    holderMenuItems.Add(group);
                    ItemsDisplayStyle itemsDisplayStyle = ItemsDisplayStyle.LargeIcons;
                    if (groupValue.Model != null)
                    {
                        itemsDisplayStyle = ItemsDisplayStyle.List;
                        if (groupValue.Model is IModelChoiceActionItemChildItemsDisplayStyle)
                        {
                            itemsDisplayStyle =
                                ((IModelChoiceActionItemChildItemsDisplayStyle)groupValue.Model).ChildItemsDisplayStyle;
                        }
                    }
                    CreateCustomGroupControlEventArgs args = new CreateCustomGroupControlEventArgs(groupValue);
                    OnCreateCustomGroupControl(args);
                    if (args.Control != null)
                    {
                        var customControlItem = new ASPxMenuCustomControlItem(args.Control);
                        customControlItem.InitTemplate();
                        group.Items.Add(customControlItem);
                    }
                    else
                    {
                        switch (itemsDisplayStyle)
                        {
                        case ItemsDisplayStyle.LargeIcons:
                        case ItemsDisplayStyle.List:
                            if (groupValue.IsHierarchical())
                            {
                                FillMenuContents(group.Items, groupValue.Items);
                            }
                            else
                            {
                                FillMenuGroup(group, groupValue);
                            }
                            break;
                        }
                    }
                }
            }
        }
Пример #32
0
 public ASPxMenuItemChoiceActionItem(SingleChoiceAction action, ChoiceActionItem item)
     : base(item, action){
     _currentAction = action;
     CurrentMenuItem = new MenuItem{Name = item.GetIdPath()};
     SyncronizeWithItem();
 }
Пример #33
0
 private void FillMenuGroup(MenuItem group, ChoiceActionItem groupValue){
     foreach (ChoiceActionItem itemValue in groupValue.Items){
         if (!itemValue.Active){
             continue;
         }
         var itemWrapper = new ASPxMenuItemChoiceActionItem(SingleChoiceAction, itemValue);
         MenuItemToWrapperMap.Add(itemWrapper.CurrentMenuItem, itemWrapper);
         group.Items.Add(itemWrapper.CurrentMenuItem);
         ActionItemToMenuItemMap.Add(itemValue, itemWrapper.CurrentMenuItem);
     }
 }