private void Button_Click(object sender, RoutedEventArgs e)
        {
            AllergensManagement am = new AllergensManagement();

            string typeAllergen = textBoxTypeAllergen.Text;

            int n = am.GetAllAllergens().Count;
            int idAllergen;

            if (n > 0)
            {
                idAllergen = Int32.Parse(am.GetAllAllergens()[n - 1].Id) + 1;
            }
            else
            {
                idAllergen = 0;
            }

            Allergen a = new Allergen(idAllergen.ToString(), typeAllergen);

            am.CreateAllergen(a);


            Close();
        }
        public AddAllergenWindow(string idPatient)
        {
            InitializeComponent();
            double screenWidth  = System.Windows.SystemParameters.PrimaryScreenWidth;
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
            double windowWidth  = this.Width;
            double windowHeight = this.Height;

            this.Left = (screenWidth / 2) - (windowWidth / 2);
            this.Top  = (screenHeight / 2) - (windowHeight / 2);

            idP = idPatient;

            AllergensManagement am           = new AllergensManagement();
            List <Allergen>     defAllergens = am.GetAllAllergens();


            foreach (var item in defAllergens)
            {
                ComboBox1.Items.Add(item.Name);
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            SecretaryController sc = new SecretaryController();
            AllergensManagement am = new AllergensManagement();
            PatientManagement   pm = new PatientManagement();

            Patient p;
            string  cb       = ComboBox1.Text;
            string  specName = textBoxTypeAllergen.Text;

            List <Patient> patients = sc.GetAllPatients();

            p = sc.getPatient(idP);

            string   idAllergen = am.getID(cb);
            Allergen a          = new Allergen(idAllergen, cb, specName);

            p.ListAllergens.Add(a);

            pm.updateAllergen(p);


            Close();
        }