protected void ImportDominoServers_Click(object sender, EventArgs e)
 {
     DevExpress.Web.ASPxMenu SubMenu = (DevExpress.Web.ASPxMenu) this.Master.FindControl("SubMenu");
     SubMenu.Items.Clear();
     Session["MenuID"] = null;
     Response.Redirect("~/Security/ImportServers.aspx", false);//Mukund,01Oct14
     Context.ApplicationInstance.CompleteRequest();
 }
Example #2
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;
            }
        }
Example #3
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;
            }
        }