private void Button_Click(object sender, RoutedEventArgs e)
        {
            Patient patient = new Patient();

            patient.Birthday     = BirthdayDp.SelectedDate;
            patient.FirstName    = FirstnameTb.Text;
            patient.LastName     = LastnameTb.Text;
            patient.Country      = tbCountry.Text;
            patient.City         = tbCity.Text;
            patient.Street       = tbStreet.Text;
            patient.Streetnumber = tbStreetnumber.Text;
            patient.Zipcode      = tbZip.Text;

            if (InsuranceCb.SelectedItem != null)
            {
                Insurance selectedEntry = (Insurance)InsuranceCb.SelectedItem;
                patient.InsuranceId = selectedEntry.InsuranceId;
            }
            else
            {
                patient.InsuranceId = 0;
            }

            var date = DateTime.Now;

            date = new DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, date.Kind);
            patient.CreatedDate = date;

            Database.IPatientMapper mapper = PatientanlegerApp.Db.GetPatientMapper();
            if (mapper.Insert(patient) == 1)
            {
                MessageBox.Show("Patient wurde angelegt", "Patientenanleger 3000");
            }
        }
        private void searchBtn_Click(object sender, RoutedEventArgs e)
        {
            string         name     = searchTb.Text;
            List <Patient> patients = new List <Patient>();

            Database.IPatientMapper mapper = PatientanlegerApp.Db.GetPatientMapper();
            mapper.SelectByName(name, ref patients);

            patientDg.Items.Clear();

            foreach (var patient in patients)
            {
                patientDg.Items.Add(patient);
            }
        }
        private void SavePatientBtn_Click(object sender, RoutedEventArgs e)
        {
            if (currentPatient == null)
            {
                return;
            }

            if (!currentPatient.Dirty) // nothing changed
            {
                return;
            }

            UpdateModel();

            Database.IPatientMapper mapper = PatientanlegerApp.Db.GetPatientMapper();
            if (!mapper.UpdateSingle(currentPatient))
            {
                MessageBox.Show("Es ist ein Fehler aufgetreten");
            }

            currentPatient.Dirty = false;
        }