public void Add(Dependent dependent) { List.Add(dependent); }
/// <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); }