private void addAnalysis_Click(object sender, EventArgs e) { if (checkCorrect()) { String[] b = maskedTextBox1.Text.Split('.'); DateTime lastSurvey = new DateTime(Convert.ToInt32(b[2]), Convert.ToInt32(b[1]), Convert.ToInt32(b[0])); Analys analys = new Analys(lastSurvey); foreach (Control control in this.Controls) { if (control is RichTextBox) { analys.addTitles(Convert.ToString(control.Tag), Convert.ToDouble(control.Text)); } } patient.addAnalys(analys); medicalDB.addAnalysToDatabase(analys, patient); List <Patient> l = new List <Patient>(); l.Add(patient); medicalDB.writeToDatabase(l); if (owner != null) { owner.changeLastSurvey(); owner.reload(); } this.Close(); } }
private void addAnalysis_Click(object sender, EventArgs e) { String[] b = maskedTextBox1.Text.Split('.'); DateTime lastSurvey = new DateTime(Convert.ToInt32(b[2]), Convert.ToInt32(b[1]), Convert.ToInt32(b[0])); Analys analys = new Analys(lastSurvey); foreach (Control control in this.Controls) { if (control is RichTextBox) { analys.addTitles(Convert.ToString(control.Tag), Convert.ToDouble(control.Text)); } } patient.addAnalys(analys); if (owner != null) { owner.changeLastSurvey(); } this.Close(); }