Beispiel #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();
        }
        public void DeleteDiagnosis(string diagnosisStr, bool bio, bool little, bool big)
        {
            if (bio)
            {
                diagnosesAll.SetDiagnosesBio(diagnosesAll.GetDiagnosesBio().FindAll(o => !o.GetName().Equals(diagnosisStr)).ToList());
            }
            if (little)
            {
                diagnosesAll.SetDiagnosesLittle(diagnosesAll.GetDiagnosesLittle().FindAll(o => !o.GetName().Equals(diagnosisStr)).ToList());
            }
            if (big)
            {
                diagnosesAll.SetDiagnosesBig(diagnosesAll.GetDiagnosesBig().FindAll(o => !o.GetName().Equals(diagnosisStr)).ToList());
            }

            SaveDiagnosis();
        }