//View MainMenu #region ViewMainModules public DataTable ViewMainModules(string AdminName) { DataTable dataTable = new DataTable(); AdminBSO adminBSO = new AdminBSO(); Admin admin = adminBSO.GetAdminById(AdminName); RolesBSO rolesBSO = new RolesBSO(); IRoles roles = rolesBSO.GetRolesById(admin.RolesID); string strModules = roles.RolesModules; strModules = strModules.Replace(",", "','"); ModulesBSO modulesBSO = new ModulesBSO(); DataTable table = modulesBSO.MixModules(); if (AdminName.Equals("administrator")) { dataTable = table; } else { DataView dataView = new DataView(table); dataView.RowFilter = "Slug in ('" + strModules + "')"; dataView.Sort = "Modules_ID ASC"; dataTable = dataView.ToTable(); } return(dataTable); }
public DataTable ViewMainModulesByRoles(string AdminName) { DataTable dataTable = new DataTable(); AdminRolesBSO adminRolesBSO = new AdminRolesBSO(); string strRoles = adminRolesBSO.GetRoles(AdminName); RolesBSO rolesBSO = new RolesBSO(); DataTable table1 = rolesBSO.GetRolesbyStrRolesID(strRoles); string strModules = ""; if (table1.Rows.Count > 0) { foreach (DataRow row in table1.Rows) { strModules += row["Roles_Modules"].ToString(); } } // string strModules = roles.RolesModules; strModules = strModules.Replace(",", "','"); ModulesBSO modulesBSO = new ModulesBSO(); DataTable table = modulesBSO.MixModulesAdmin(); if (AdminName.Equals("administrator")) { dataTable = table; } else { DataView dataView = new DataView(table); dataView.RowFilter = "Slug in ('" + strModules + "')"; dataView.Sort = "Modules_ID ASC"; dataTable = dataView.ToTable(); } return(dataTable); }