Example #1
0
 private void loadProtocolsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //LoadProtocols();
     openFileDialog1.Filter   = "JSON (*.json) | *.json";
     openFileDialog1.FileName = defaultFileName;
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         string str = String.Empty;
         try
         {
             str = File.ReadAllText(openFileDialog1.FileName);
         }
         catch (Exception ex)
         {
             Debug.WriteLine("Couldn't read file : + " + openFileDialog1.FileName);
             Debug.WriteLine(ex.Message);
         }
         clinic.FromJSON(str);
         // clinic = new Clinic(clinic);
         defaultFileName = openFileDialog1.FileName;
         statusBar1.Text = "Using : " + Path.GetFileName(defaultFileName);
     }
     else
     {
         clinic = Seed.SetupData(clinic);
         //msg = "Protocols seeded";
     }
     //HOHEventObj.UpdateClinic(clinic);
     UpdateProtocols();
 }