/// <summary> /// Checks whether the network data contains any of the PII information /// and returns the flag /// </summary> /// <param name="person"></param> /// <returns></returns> public Boolean ContainsPII(Person person, String requestParameters) { Boolean containsPII = false; String sanitizedKey; try { //If there are no request parameters if (requestParameters == null) return false; //Initialize //this.PII = new Dictionary<string, Int32>(); this.PII = new List<string>(); //Get the PII data Dictionary<String,String> dicPII = person.GetPII(); foreach (KeyValuePair<String,String> pII in dicPII) { //If the request parameter contains the PII information if (requestParameters.Contains(pII.Value)) { if(pII.Key.Contains("_")) sanitizedKey = SanitizeKey(pII.Key); else sanitizedKey = pII.Key; ////If this PII was already encountered //if (this.PII.ContainsKey(sanitizedKey)) // //Increment the count // this.PII[sanitizedKey] = this.PII[sanitizedKey] + 1; //else // //Initialize the count // this.PII.Add(sanitizedKey, 1); //If its not already present if(!PII.Contains(sanitizedKey)) PII.Add(sanitizedKey); containsPII = true; break; } } } catch (Exception ex) { containsPII = false; } return containsPII; }
/// <summary> /// Gets the required data from database /// </summary> private void GetData() { DBUtility dbUtility = DBUtility.CreateDBUtility(Configurations.DatabaseName, Configurations.PIITableName); //Initialize _sbAllowableHostNames = new StringBuilder(); //Get the person data (PII Information) _person = dbUtility.GetPersonData(Configurations.User); //Get the list of accessible websites dbUtility.TableName = Configurations.WebsitesTableName; _websites = dbUtility.GetWebsites(); //Build the allowable Hostnames _allowableHostNames = new List<string>(); foreach (Website website in _websites) { _allowableHostNames.Add(website.URL); _sbAllowableHostNames.Append(website.URL); } }
/// <summary> /// Copies the data from the given instance /// </summary> /// <param name="person"></param> public void Copy(Person person) { this.Volunteer = person.Volunteer; this.FullName = person.FullName; this.DayOfBirth = person.DayOfBirth; this.EmailAddress = person.EmailAddress; this.MonthOfBirth = person.MonthOfBirth; this.YearOfBirth = person.YearOfBirth; this.PhoneNumber = person.PhoneNumber; this.StreetAddress = person.StreetAddress; this.City = person.City; this.State = person.State; this.Zip = person.Zip; this.SpouseName = person.SpouseName; this.Children = person.Children; this.GrandChildren = person.GrandChildren; this.PastEmployers = person.PastEmployers; this.CurrentEmployers = person.CurrentEmployers; this.LastUpdatedOn = person.LastUpdatedOn; }