internal static bool CheckAccessType(AccessType accessType, int userId)
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.Account.FirstOrDefault(a => a.ID == userId)
                .AccountAccess.Any(a => a.Accessright.Accessright_Right.Any(r => r.AccessType == (int)accessType)));
 }
 internal static List <Module> GetModules(int clubId)
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.Module.Where(m => m.ClubLinkModule.Any(c => c.ClubId == clubId)).ToList());
 }
 internal static List <Accessright> GetAccessrights(int clubId)
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.Accessright.Where(a => a.ClubId == clubId).ToList());
 }
Exemple #4
0
 internal static List <Account> GetAllUsers(int clubId)
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.Account.Include("Club").Where(a => a.ClubId == clubId).ToList());
 }
 internal static Accessright GetAccessright(int id, int clubId)
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.Accessright.Include("Accessright_Right").FirstOrDefault(a => a.ClubId == clubId && a.ID == id));
 }
Exemple #6
0
 internal static Account GetUserAccount(int userId)
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.Account.Include("Club").Include("Account_Information").FirstOrDefault(a => a.ID == userId));
 }
Exemple #7
0
 internal static bool UserNameExists(string username, int userId)
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.Account.Any(a => a.UserName == username && a.ID != userId));
 }
Exemple #8
0
 internal static Account_Information GetAccountSettings(int id)
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.Account_Information.FirstOrDefault(a => a.AccountId == id));
 }
Exemple #9
0
 internal static List <AccountAccess> GetAccountAccesses(int id)
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.AccountAccess.Where(a => a.AccountID == id).ToList());
 }
Exemple #10
0
 internal static Accessright GetAccessrightByName(string accessrightName, int clubId)
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.Accessright.FirstOrDefault(a => a.ClubId == clubId && a.Name == accessrightName));
 }
Exemple #11
0
 internal static List <Account> GetAllAccounts()
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.Account.ToList());
 }
Exemple #12
0
 internal static GenericFile GetGenericFile(GenericFileType fileType, GenericFileModuleType moduleType, int objectId)
 {
     using (CoreModel coreDAL = new CoreModel())
         return(coreDAL.GenericFile.FirstOrDefault(f => f.FileType == (int)fileType &&
                                                   f.ModuleType == (int)moduleType && f.ObjectId == objectId));
 }