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()); }
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)); }
internal static Account GetUserAccount(int userId) { using (CoreModel coreDAL = new CoreModel()) return(coreDAL.Account.Include("Club").Include("Account_Information").FirstOrDefault(a => a.ID == userId)); }
internal static bool UserNameExists(string username, int userId) { using (CoreModel coreDAL = new CoreModel()) return(coreDAL.Account.Any(a => a.UserName == username && a.ID != userId)); }
internal static Account_Information GetAccountSettings(int id) { using (CoreModel coreDAL = new CoreModel()) return(coreDAL.Account_Information.FirstOrDefault(a => a.AccountId == id)); }
internal static List <AccountAccess> GetAccountAccesses(int id) { using (CoreModel coreDAL = new CoreModel()) return(coreDAL.AccountAccess.Where(a => a.AccountID == id).ToList()); }
internal static Accessright GetAccessrightByName(string accessrightName, int clubId) { using (CoreModel coreDAL = new CoreModel()) return(coreDAL.Accessright.FirstOrDefault(a => a.ClubId == clubId && a.Name == accessrightName)); }
internal static List <Account> GetAllAccounts() { using (CoreModel coreDAL = new CoreModel()) return(coreDAL.Account.ToList()); }
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)); }