public UserAuthorize GetAuthorizeByProgramID(string programId) { UserAuthorize authorize = null; if (Authorizations != null) { authorize = Authorizations.Where(a => a.ProgramId.Equals(programId)).FirstOrDefault(); } return(authorize); }
/// <summary> /// Get all of the non-BCBA Authorizations that were active at the specified reference date /// </summary> public List <Authorizations.Authorization> GetActiveNonBCBAAuthorizations(DateTime refDate) { var auths = Authorizations .Where(x => x.EndDate >= refDate && x.StartDate <= refDate && x.AuthorizationCode.Code == "GENERAL") .ToList(); return(auths); }
/// <summary> /// Get all of the Authorizations that were active at the specified reference date /// </summary> public List <Authorizations.Authorization> GetActiveAuthorizations(DateTime refDate) { if (Authorizations == null || Authorizations.Count == 0) { return(new List <Authorizations.Authorization>()); } var auths = Authorizations .Where(x => x.EndDate >= refDate.Date && x.StartDate <= refDate.Date) .ToList(); return(auths); }
public CaseAuthorization GetCaseAuthForService(Service service, int authClassID) { // service will have a pre-mapped authClassID, we need to match that up with // whatever's on file for the cases authorizations var classedAuths = Authorizations.Where(x => x.AuthClass.ID == authClassID).ToList(); if (classedAuths == null || classedAuths.Count == 0) { return(null); } if (classedAuths.Count == 1) { return(classedAuths[0]); } // there's more than one auth matching the required class // let's grab the latest ending one... return(classedAuths.OrderByDescending(x => x.EndDate).FirstOrDefault()); }
public IEnumerable <Authorization> HoursEntryEligibleAuthorizationsWithoutMatchRules() { var authIDs = Database.SqlQuery <int>("SELECT CaseAuthorizationID FROM hoursEntry.AuthorizationswithoutRules"); return(Authorizations.Where(x => authIDs.Any(y => y == x.ID))); }