Ejemplo n.º 1
0
 private void cancelIllnessMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         long    patientID = Int64.Parse(dataGridView1.Rows[getSelectedRow(dataGridView1)].Cells[0].Value.ToString());
         long    illnessID = Int64.Parse(dataGridView2.Rows[getSelectedRow(dataGridView2)].Cells[0].Value.ToString());
         Patient patient   = new Patient()
         {
             PatientID = patientID
         };
         Illness illness = new Illness()
         {
             IllnessID = illnessID
         };
         if (!fachkonzept.UnLinkPatientIllness(patient, illness))
         {
             throw new Exception("Krankheit konnte nicht ausgetragen werden.");
         }
         matchingIllnesses.RemoveAll(x => x.IllnessID == illness.IllnessID);
         matchingIllnessBindingSource.ResetBindings(false);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }