protected void PopulateMenu() { MenuItem HomeItem = new MenuItem(); HomeItem.Text = "Home"; HomeItem.NavigateUrl = "Home.aspx"; MnuTopNav.Items.Add(HomeItem); if (role != null) { if (role.Contains <string>(clsEALRoles.GlobalApprover)) { MenuItem RepItem = new MenuItem(); RepItem.Text = "All Reports"; RepItem.NavigateUrl = "AllReports.aspx"; MnuTopNav.Items.Add(RepItem); } else { MenuItem ReportsItem = new MenuItem(); ReportsItem.Text = "Reports"; ReportsItem.NavigateUrl = "SelectApplication.aspx"; MnuTopNav.Items.Add(ReportsItem); } } if (role.Contains <string>(clsEALRoles.ControlOwner) || role.Contains <string>(clsEALRoles.ComplianceAdmin)) { SettingItem = new MenuItem(); SettingItem.Text = "Mappings"; SettingItem.Selectable = false; MnuTopNav.Items.Add(SettingItem); MenuItem ApproverMappItem = new MenuItem(); ApproverMappItem.Text = "Approver's Mapping"; ApproverMappItem.NavigateUrl = "ApproverMapping.aspx"; SettingItem.ChildItems.Add(ApproverMappItem); } if (role.Contains <string>(clsEALRoles.ComplianceAdmin)) { MenuItem AppMappItem = new MenuItem(); AppMappItem.Text = "Alpplication Mapping"; AppMappItem.NavigateUrl = "ApplicationMapping.aspx"; SettingItem.ChildItems.Add(AppMappItem); MenuItem AppDetailsItem = new MenuItem(); AppDetailsItem.Text = "Alpplication Details"; AppDetailsItem.NavigateUrl = "ApplicationDetail.aspx"; SettingItem.ChildItems.Add(AppDetailsItem); MenuItem InitiativeItem = new MenuItem(); InitiativeItem.Text = "Initiatives"; SettingItem.ChildItems.Add(InitiativeItem); MenuItem ServerListItem = new MenuItem(); ServerListItem.Text = "Server List"; SettingItem.ChildItems.Add(ServerListItem); MenuItem ShareListItem = new MenuItem(); ShareListItem.Text = "Share List"; SettingItem.ChildItems.Add(ShareListItem); MenuItem UserRolesItem = new MenuItem(); UserRolesItem.Text = "User Roles"; SettingItem.ChildItems.Add(UserRolesItem); } if (Session[clsEALSession.ValuePath] != null) { string strvaluepath = Convert.ToString(Session[clsEALSession.ValuePath]); MenuItem mnuitem = MnuTopNav.FindItem(strvaluepath); mnuitem.Selected = true; } }
public void PopulateMenu_GO() { MnuTopNav.Items.Clear(); if (role != null) { if (Session["RoleSelected"] != null) { role = (string[])Session["RoleSelected"]; MnuTopNav.Visible = true; } if (role.Contains <string>(clsEALRoles.GlobalApprover) && role.Contains <string>(clsEALRoles.ControlOwner)) { if (Session["RoleSelected"] == null) { MnuTopNav.Visible = false; role = (string[])Session[clsEALSession.UserRole]; } } else { MenuItem HomeItem = new MenuItem(); HomeItem.Text = "Home"; MnuTopNav.Items.Add(HomeItem); if (role.Contains <string>(clsEALRoles.GlobalApprover)) { MenuItem RepItem = new MenuItem(); RepItem.Text = "All Reports"; MnuTopNav.Items.Add(RepItem); } else { MenuItem ReportsItem = new MenuItem(); ReportsItem.Text = "Reports"; MnuTopNav.Items.Add(ReportsItem); } SettingItem = new MenuItem(); SettingItem.Text = "Mappings"; SettingItem.Selectable = false; MnuTopNav.Items.Add(SettingItem); if (role.Contains <string>(clsEALRoles.ControlOwner) || role.Contains <string>(clsEALRoles.ComplianceAdmin) || role.Contains <string>(clsEALRoles.GlobalApprover)) { if (role.Contains <string>(clsEALRoles.ComplianceAdmin) || role.Contains <string>(clsEALRoles.ControlOwner)) { MenuItem ApproverMappItem = new MenuItem(); ApproverMappItem.Text = "Approver's Mapping"; //ApproverMappItem.NavigateUrl = "ApproverMapping.aspx"; SettingItem.ChildItems.Add(ApproverMappItem); } } if (role.Contains <string>(clsEALRoles.GlobalApprover) || role.Contains <string>(clsEALRoles.ControlOwner)) { MenuItem SelectiveApprovalItem = new MenuItem(); SelectiveApprovalItem.Text = "Selective Approval"; SettingItem.ChildItems.Add(SelectiveApprovalItem); } if (role.Contains <string>(clsEALRoles.ComplianceAdmin)) { MenuItem ScheduleItem = new MenuItem(); ScheduleItem.Text = "Mail Schedule"; ScheduleItem.NavigateUrl = "wfrmScheduleEmail.aspx"; SettingItem.ChildItems.Add(ScheduleItem); MenuItem AppDetailsItem = new MenuItem(); AppDetailsItem.Text = "Application Details"; //AppDetailsItem.NavigateUrl = "ApplicationDetail.aspx"; SettingItem.ChildItems.Add(AppDetailsItem); MenuItem InitiativeItem = new MenuItem(); InitiativeItem.Text = "Initiatives"; //InitiativeItem.NavigateUrl = "Initiatives.aspx"; SettingItem.ChildItems.Add(InitiativeItem); MenuItem ServerListItem = new MenuItem(); ServerListItem.Text = "Server List"; //ServerListItem.NavigateUrl = "ServerList.aspx"; SettingItem.ChildItems.Add(ServerListItem); MenuItem ShareListItem = new MenuItem(); ShareListItem.Text = "Share List"; // ShareListItem.NavigateUrl = "ShareList.aspx"; SettingItem.ChildItems.Add(ShareListItem); MenuItem UserRolesItem = new MenuItem(); UserRolesItem.Text = "User Roles"; // UserRolesItem.NavigateUrl = "UserRoles.aspx"; SettingItem.ChildItems.Add(UserRolesItem); MenuItem DatabaseMapping = new MenuItem(); DatabaseMapping.Text = "Database Mappings"; SettingItem.ChildItems.Add(DatabaseMapping); //top menu Generate report MenuItem GenerateReport = new MenuItem(); GenerateReport.Text = "Generate Reports"; GenerateReport.Selectable = false; MnuTopNav.Items.Add(GenerateReport); MenuItem RecievedReports = new MenuItem(); RecievedReports.Text = "Received Reports"; // RecievedReports.NavigateUrl = "RecievedReports.aspx"; GenerateReport.ChildItems.Add(RecievedReports); MenuItem NewUserReport = new MenuItem(); NewUserReport.Text = "New User Report"; // NewUserReport.NavigateUrl = "NewUserReport.aspx"; GenerateReport.ChildItems.Add(NewUserReport); //if (Session[clsEALSession.ValuePath] != null) //{ // string strvaluepath = Convert.ToString(Session[clsEALSession.ValuePath]); // MenuItem mnuitem = MnuTopNav.FindItem(strvaluepath); // mnuitem.Selected = true; //} MenuItem RemovedByReport = new MenuItem(); RemovedByReport.Text = "To Be Removed"; GenerateReport.ChildItems.Add(RemovedByReport); } if (role.Contains <string>(clsEALRoles.ComplianceTester)) { MenuItem GenerateReport = new MenuItem(); GenerateReport.Text = "Generate Reports"; GenerateReport.Selectable = false; MnuTopNav.Items.Add(GenerateReport); MenuItem RemovedByReport = new MenuItem(); RemovedByReport.Text = "To Be Removed"; GenerateReport.ChildItems.Add(RemovedByReport); } MenuItem GroupMapping = new MenuItem(); GroupMapping.Text = "Security Groups Mappings"; SettingItem.ChildItems.Add(GroupMapping); /*Added by Nag*/ MenuItem GenerateReports = new MenuItem(); GenerateReports.Text = "Generate Reports"; GenerateReports.Selectable = false; MnuTopNav.Items.Add(GenerateReports); MenuItem PendingApprovalReport = new MenuItem(); PendingApprovalReport.Text = "Pending Recertification"; GenerateReports.ChildItems.Add(PendingApprovalReport); MenuItem UnmappedSecGrpReport = new MenuItem(); UnmappedSecGrpReport.Text = "Unmapped Security Group"; GenerateReports.ChildItems.Add(UnmappedSecGrpReport); if (Session[clsEALSession.ValuePath] != null) { string strvaluepath = Convert.ToString(Session[clsEALSession.ValuePath]); MenuItem mnuitem = MnuTopNav.FindItem(strvaluepath); mnuitem.Selected = true; } } } }