Example #1
0
 private string CalculateAlternateID(List<BenefitElectionAlternateID> benefitElectionAlternateIDs, CoveredUser coveredUser, DateTime effectiveDate)
 {
     if (coveredUser.RelationID == (int)Relation.Employee) return "0";
     var maxAlternateID = GetMaxAlternateIDDayBeforeEffectiveDate(benefitElectionAlternateIDs, effectiveDate);
     if (String.IsNullOrEmpty(maxAlternateID)) return "1";
     return (int.Parse(maxAlternateID) + 1).ToString();
 }
Example #2
0
 private string CalculateAlternateID(List<BenefitElectionAlternateID> benefitElectionAlternateIDs, CoveredUser coveredUser, DateTime effectiveDate)
 {
     if (coveredUser.RelationID == (int)Relation.Employee) return "A";
     var maxAlternateID = GetMaxAlternateIDDayBeforeEffectiveDate(benefitElectionAlternateIDs, effectiveDate);
     if (String.IsNullOrEmpty(maxAlternateID)) return "B";
     return GetNextCharacter(maxAlternateID);
 }
Example #3
0
 private UserAlternateID GetUserAlternateID(List<BenefitElectionAlternateID> benefitElectionAlternateIDs, CoveredUser coveredUser, DateTime effectiveDate)
 {
     var userAlternateID = new UserAlternateID() { UserID = coveredUser.UserID };
     var election = GetElectionAsOfEffectiveDateOrDayBeforeEffectiveDate(benefitElectionAlternateIDs, coveredUser.UserID, effectiveDate);
     if (HasDayBeforeElectionAlternateID(election))
     {
         userAlternateID.AlternateID = election.AlternateID;
     }
     else
     {
         userAlternateID.AlternateID = CalculateAlternateID(benefitElectionAlternateIDs, coveredUser, effectiveDate);
     };
     m_previousCoveredUserAlternateID = userAlternateID.AlternateID;
     return userAlternateID;
 }