Exemple #1
0
        public void UpdateTreatment()
        {
            Treatment treatment = TreatmentFactory.Instance().CreateTreatment(treatmentType, operationRoom, cage, item, DateTime.Now, DateTime.Now, true, "", true, animal, employee, 0);

            TreatmentManager treatmentManager = new TreatmentManager();
            string           treatmentt       = treatmentManager.UpdateTreatment(treatment);

            Assert.AreEqual("ok", treatmentt);
        }
 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();
     }
 }
 public bool Update([FromBody] TreatmentUpdateRequest request)
 {
     return(_treatmentManager.UpdateTreatment(request));
 }