private void MainForm_Activated(object sender, EventArgs e) { DiaAllService.ReadDiagnosis(); dateCalendar.Value = DateTime.Now; cmbOrganization.Items.Clear(); foreach (Organization o in OrgServise.GetOrganizations()) { cmbOrganization.Items.Add(o.GetName()); } DiagnosisAll diaAll = DiaAllService.GetDiagnosisAll(); cmdDiagnosisBio.Items.Clear(); foreach (Diagnosis o in diaAll.GetDiagnosesBio()) { cmdDiagnosisBio.Items.Add(o.GetName()); } cmdDiagnosisLitt.Items.Clear(); foreach (Diagnosis o in diaAll.GetDiagnosesLittle()) { cmdDiagnosisLitt.Items.Add(o.GetName()); } cmdDiagnosisBig.Items.Clear(); foreach (Diagnosis o in diaAll.GetDiagnosesBig()) { cmdDiagnosisBig.Items.Add(o.GetName()); } dateCalendar.Value = DateTime.Now; showTransaction(); }
public DiagnosisAll ReadDiagnosis() { BinaryFormatter formatter = new BinaryFormatter(); using (FileStream fs = new FileStream("diagnoses.dat", FileMode.OpenOrCreate)) { try { diagnosesAll = (DiagnosisAll)formatter.Deserialize(fs); } catch (Exception ex) { } } return(diagnosesAll); }
public DiagnosisAllService() { diagnosesAll = new DiagnosisAll(); }