Пример #1
0
        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();
        }
Пример #2
0
        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);
        }
Пример #3
0
 public DiagnosisAllService()
 {
     diagnosesAll = new DiagnosisAll();
 }