Beispiel #1
0
 private void LoadUserMenuForAdminUser(Sec_Users _dbUser)
 {
     NewAppsCnn newAppsCnn = new NewAppsCnn(AppSettings.CrAppSettings.NewAppsConnectionString);
     var dbMenuItems = from m in newAppsCnn.Sec_MainMenu select m;
     foreach (var dbMenuItem in dbMenuItems)
     {
         MenuItem menuItem = new MenuItem();
         menuItem.FromDbMenuItem(dbMenuItem);
         this.UserMenuItems.Add(menuItem);
     }
 }
Beispiel #2
0
 private void LoadUserMenuForUser(Sec_Users _dbUser)
 {
     foreach (var dbGroup in _dbUser.Sec_Groups)
     {
         foreach (var dbGroupRight in dbGroup.Sec_GroupRights)
         {
             MenuItem menuItem = new MenuItem();
             menuItem.FromDbMenuItem(dbGroupRight.Sec_MainMenu);
             menuItem.FormAllowedFunctions = menuItem.FormAllowedFunctions & dbGroupRight.AllowedFunctions;
             var existMenuItem = this.UserMenuItems.Find(m => m.MenuID == menuItem.MenuID);
             if (existMenuItem == null)
                 this.UserMenuItems.Add(menuItem);
             else
             {
                 existMenuItem.FormAllowedFunctions = existMenuItem.FormAllowedFunctions & dbGroupRight.AllowedFunctions;
             }
         }
     }
 }
Beispiel #3
0
 public static List<MenuItem> LoadAllForms()
 {
     List<MenuItem> result = new List<MenuItem>();
     NewAppsCnn newAppsCnn = new NewAppsCnn(AppSettings.CrAppSettings.NewAppsConnectionString);
     var dbForms = from f in newAppsCnn.Sec_MainMenu orderby f.MenuID ascending select f;
     foreach (var dbForm in dbForms)
     {
         MenuItem menuItem = new MenuItem();
         menuItem.FromDbMenuItem(dbForm);
         result.Add(menuItem);
     }
     return result;
 }