示例#1
0
 /// <summary>
 /// Checks to see if the person's ID is in the file of IDs of people that prefer Hebrew
 /// </summary>
 /// <param name="p">person who's prefernce you want to check</param>
 /// <returns>true if person is not on the list, false otherwise</returns>
 public static bool checkPreference(Person p)
 {
     if (hebPeopleS.Equals(""))
     {
         hebPeopleS = File.ReadAllText(hebPeople);
     }
     return !hebPeopleS.Contains(p.Id);
 }
示例#2
0
        //extracts data from the report
        public List<Person> FetchPeople()
        {
            List<Person> people = new List<Person>();
            if (File.Exists(input))
            {
                string[] lines = File.ReadAllLines(input);
                Person p;
                string[] splitLine;
                string[] numbers;
                string line;
                foreach (string temp in lines)
                {
                    line = temp.Replace(",", "");
                    if (!(temp.ElementAt<char>(1) == 'M' || temp.ElementAt<char>(1) == 'P' || temp.Contains("0000")))//ignore header and marble memorials
                    {
                        //Parsing the information and adding the people goes here
                        p = new Person();
                        line.Replace(",\"", "");
                        p.PlaqueNum1 = line.Substring(1, 1);
                        p.PlaqueNum2 = line.Substring(2, 1);
                        p.PlaqueNum3 = line.Substring(4, 2);
                        splitLine = line.Split('\"');
                        p.Id = splitLine[3];
                        p.NameF = splitLine[7];
                        p.NameL = splitLine[9];
                        numbers = splitLine[10].Split('/');
                        p.DayG = int.Parse(numbers[1]);
                        p.MonthG = int.Parse(numbers[0]);
                        p.YearG = int.Parse(numbers[2]);

                        people.Add(p);
                    }
                }
            }
            else
                Console.WriteLine("No Input file");
            return people;
        }