示例#1
0
        public void AddCharity(string FilePath)
        {
            using (StreamReader file = new StreamReader(FilePath))
            {
                string line;
                while ((line = file.ReadLine()) != null)
                {
                    string[] fields = line.Split('|');

                    if (fields[4].ToString() == "United States" && fields.Length > 0)
                    {
                        Charity Charity = new Charity();
                        Charity.EIN           = fields[0].ToString();
                        Charity.Name          = fields[1].ToString();
                        Charity.City          = fields[2].ToString();
                        Charity.State         = fields[3].ToString();
                        Charity.Country       = fields[4].ToString();
                        Charity.Deductibility = fields[5].ToString();
                        Exigo.AddToCharity(Charity);
                    }
                }
            }
        }