private void btnAddTreatment_Click(object sender, EventArgs e)
 {
     Cursor = Cursors.WaitCursor;
     if (string.IsNullOrEmpty(txtTreatmentName.Text.FullTrim()))
     {
         txtTreatmentName.BackColor = ErrorColor;
         Cursor = Cursors.Default;
         return;
     }
     if (!TreatmentManager.IsTreatmentFoundByName(txtTreatmentName.Text.FullTrim()))
     {
         TreatmentManager.AddTreatment(new Treatment {
             Name = txtTreatmentName.Text.FullTrim()
         });
     }
     Treatments.Add(new ExaminationTreatmentVm
     {
         TreatmentName        = txtTreatmentName.Text.FullTrim(),
         TreatmentDescription = txtTreatmentDescription.Text.FullTrim()
     });
     ClearTreatmentsInputs();
     FillTreatmentsGrid();
     SetAutoCompletionForTreatmentsNames();
     SetAutoCompletionForTreatmentsDescription();
     Cursor = Cursors.Default;
 }
 private void EditTreatment(bool editAnother = false)
 {
     if (string.IsNullOrEmpty(txtTreatmentOldName.Text.FullTrim()))
     {
         txtTreatmentOldName.BackColor = ErrorColor;
         txtTreatmentOldName.Focus();
         return;
     }
     if (string.IsNullOrEmpty(txtTreatmentNewName.Text.FullTrim()))
     {
         txtTreatmentNewName.BackColor = ErrorColor;
         return;
     }
     Treatment = TreatmentManager.GeTreatmentByName(txtTreatmentOldName.Text);
     if (Treatment == null)
     {
         ShowErrorMsg("لا يوجد علاج بهذا الاسم");
     }
     else
     {
         if (txtTreatmentNewName.Text.FullTrim() == txtTreatmentOldName.Text.FullTrim())
         {
             ShowErrorMsg("لا يمكن الحفظ بنفس الاسم");
             return;
         }
         if (TreatmentManager.IsTreatmentFoundByName(txtTreatmentNewName.Text.FullTrim()))
         {
             ShowErrorMsg("يوجد علاج آخر بنفس الاسم");
             return;
         }
         Treatment.Name = txtTreatmentNewName.Text.FullTrim();
         TreatmentManager.UpdateTreatment(Treatment);
         if (!editAnother)
         {
             Close();
         }
         ResetForm();
         txtTreatmentOldName.Focus();
         _treatments = null;
         SetAutoCompletion();
     }
 }