public Dependents GetAdultDependents() { Dependents adults = new Dependents(); foreach (Dependent dep in List) { if (dep.Age >= 18) { adults.Add(dep); } } return(adults); }
public Dependents GetAdultDependents() { Dependents adults = new Dependents(); foreach (Dependent dep in List) { if (dep.Age >= 18) { adults.Add(dep); } } return adults; }
/// <summary> /// Puts the relevant data into session from a DataSet object rather than storing the whole object in session /// </summary> /// <param name="info">The GetKeyEmployeeInfo Object filled with data</param> /// <param name="UserName">The UserName of the employee</param> /// <returns>True if successfull, False if there are errors or no data</returns> public static Boolean PutInSession(this GetKeyEmployeeInfo info, String UserName) { if (info.HasErrors) { return(false); } if (info.Tables.Count == 0) { return(false); } if (info.Tables[0].Rows.Count == 0) { return(false); } ThisSession.CCHID = info.CCHID; ThisSession.EmployeeID = info.EmployeeID; ThisSession.SubscriberMedicalID = info.SubscriberMedicalID; ThisSession.SubscriberRXID = info.SubscriberRXID; ThisSession.LastName = info.LastName; ThisSession.FirstName = info.FirstName; ThisSession.PatientAddress1 = info.Address1; ThisSession.PatientAddress2 = info.Address2; ThisSession.PatientCity = info.City; ThisSession.PatientState = info.State; ThisSession.PatientZipCode = info.ZipCode; ThisSession.PatientLatitude = info.Latitude; ThisSession.PatientLongitude = info.Longitude; ThisSession.DefaultPatientAddress = ThisSession.PatientAddressSingleLine; ThisSession.PatientDateOfBirth = info.DateOfBirth; ThisSession.PatientPhone = info.Phone; ThisSession.HealthPlanType = info.HealthPlanType; ThisSession.MedicalPlanType = info.MedicalPlanType; ThisSession.RxPlanType = info.RxPlanType; ThisSession.PatientGender = info.Gender; ThisSession.Parent = info.Parent; ThisSession.Adult = info.Adult; ThisSession.PatientEmail = UserName.Trim(); ThisSession.OptInIncentiveProgram = info.OptInIncentiveProgram; ThisSession.OptInEmailAlerts = info.OptInEmailAlerts; ThisSession.OptInTextMsgAlerts = info.OptInTextMsgAlerts; ThisSession.MobilePhone = info.MobilePhone; ThisSession.OptInPriceConcierge = info.OptInPriceConcierge; if (info.Insurer != String.Empty) { ThisSession.Insurer = info.Insurer; } if (info.RXProvider != String.Empty) { ThisSession.RXProvider = info.RXProvider; } if (info.DependentTable.TableName != "EmptyTable") { Dependents deps = new Dependents(); Dependent dep = null; info.ForEachDependent(delegate(DataRow dr) { dep = new Dependent(); dep.CCHID = int.Parse(dr["CCHID"].ToString()); dep.FirstName = dr["FirstName"].ToString(); dep.LastName = dr["LastName"].ToString(); dep.DateOfBirth = DateTime.Parse(dr["DateOfBirth"].ToString()); dep.Age = int.Parse(dr["Age"].ToString()); dep.IsAdult = int.Parse(dr["Adult"].ToString()) == 1 ? true : false; dep.ShowAccessQuestions = int.Parse(dr["ShowAccessQuestions"].ToString()) == 1 ? true : false; dep.RelationshipText = dr["RelationshipText"].ToString(); dep.DepToUserGranted = int.Parse(dr["DepToUserGranted"].ToString()) == 1 ? true : false; dep.UserToDepGranted = int.Parse(dr["UserToDepGranted"].ToString()) == 1 ? true : false; dep.Email = dr["Email"].ToString(); deps.Add(dep); }); ThisSession.Dependents = deps; } if (info.YouCouldHaveSavedTable.TableName != "EmptyTable") { ThisSession.YouCouldHaveSaved = (int)info.YouCouldHaveSaved; } return(true); }
/// <summary> /// Puts the relevant data into session from a DataSet object rather than storing the whole object in session /// </summary> /// <param name="info">The GetEmployeeEnrollment Object filled with data</param> /// <returns>True if successfull, False if there are errors or no data</returns> public static Boolean PutInSession(this GetEmployeeEnrollment info) { //General exit statuses if (info.HasErrors) { return(false); } if (info.Tables.Count == 0) { return(false); } if (info.Tables[0].Rows.Count == 0) { return(false); } //Employee info if (info.EmployeeTable.TableName == "Empty") { return(false); } if (info.EmployeeTable.Rows.Count == 0) { return(false); } ThisSession.CCHID = info.CCHID; ThisSession.EmployeeID = info.EmployeeID; ThisSession.SubscriberMedicalID = info.SubscriberMedicalID; ThisSession.SubscriberRXID = info.SubscriberRXID; ThisSession.LastName = info.LastName; ThisSession.FirstName = info.FirstName; ThisSession.PatientAddress1 = info.Address1; ThisSession.PatientAddress2 = info.Address2; ThisSession.PatientCity = info.City; ThisSession.PatientState = info.State; ThisSession.PatientZipCode = info.ZipCode; ThisSession.PatientLatitude = info.Latitude; ThisSession.PatientLongitude = info.Longitude; ThisSession.PatientDateOfBirth = info.DOB; ThisSession.PatientPhone = info.Phone; ThisSession.HealthPlanType = info.HealthPlanType; ThisSession.MedicalPlanType = info.MedicalPlanType; ThisSession.RxPlanType = info.RxPlanType; ThisSession.PatientGender = info.Gender; ThisSession.Parent = info.Parent; ThisSession.Adult = info.Adult; ThisSession.PatientEmail = info.Email; if (info.Insurer != string.Empty) { ThisSession.Insurer = info.Insurer; } if (info.RXProvider != string.Empty) { ThisSession.RXProvider = info.RXProvider; } //Dependent Info if (info.DependentTable.TableName != "EmptyTable") { Dependents deps = new Dependents(); info.ForEachDependent(delegate(DataRow dr) { deps.Add(dr.DependentFromRow()); }); ThisSession.Dependents = deps; } //You Could Have Saved if (info.YouCouldHaveSavedTable.TableName != "EmptyTable") { ThisSession.YouCouldHaveSaved = (int)info.YouCouldHaveSaved; } //Alternate plans if (info.AlternateTable.TableName != "EmptyTable" && info.AlternateTable.Rows.Count > 0) { //JM 9/16/13 - At this time we only support one split ThisSession.EmployerID = info.AlternateEmployerID.ToString(); ThisSession.CnxString = info.AlternateConnectionString; } return(true); }