Ejemplo n.º 1
0
        private void searchEmailsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            List <Customer> customers  = pastel.GetCustomers(false, null);
            String          reportPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "reports", "astrodon email addresses.csv");
            StreamWriter    writer     = new StreamWriter(reportPath);

            foreach (Customer c in customers)
            {
                String line = c.accNumber + ",";
                foreach (String email in c.Email)
                {
                    if (!String.IsNullOrEmpty(email))
                    {
                        line += email;
                    }
                }
                writer.WriteLine(line);
            }
            writer.Close();
            MessageBox.Show("Done");
        }