Beispiel #1
0
 private FileHandler()
 {
     try
     {
         string fileName = System.IO.Path.GetFullPath(Directory.GetCurrentDirectory() + @"\..\..\patients.csv");
         Console.WriteLine(fileName);
         using (StreamReader sr = new StreamReader(fileName))
         {
             string line;
             while ((line = sr.ReadLine()) != null)
             {
                 string[] fields = line.Split(';');
                 PatientController.Instance().AddPatient(fields[0], fields[1], fields[2], fields[3], fields[4], fields[5]);
             }
         }
     }
     catch (Exception e)
     {
         Console.WriteLine("The file could not be read:");
         Console.WriteLine(e.Message);
     }
 }
Beispiel #2
0
 private void btn_AddPatient_Click(object sender, EventArgs e)
 {
     PatientController.Instance().AddPatient(txt_FirstName.Text, txt_LastName.Text, txt_StreetAddress.Text, txt_Phone.Text, txt_PostCode.Text, dTP_DOB.Value.ToString("dd/MM/yyyy"));
     Close();
 }