Пример #1
0
 /*
  * private ICommand aproveRequest;
  *
  * public ICommand AproveRequest
  * {
  *  get
  *  {
  *      if (aproveRequest == null)
  *      {
  *          aproveRequest = new RelayCommand(param => AproveRequestExecute(), param => CanAproveRequestExecute());
  *      }
  *      return aproveRequest;
  *  }
  * }
  */
 public void AproveRequestExecute()
 {
     selectedRequest.IsApproved = true;
     try
     {
         if (service.AddRequest(selectedRequest) != null)
         {
             RequestList = new ObservableCollection <vwRequest>(service.GetAllRequestByDoctor(doctor.DoctorId));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 private void RequestExecute()
 {
     request.PatientId = patient.PatientId;
     request.DoctorId  = patient.DoctorId;
     try
     {
         if (service.AddRequest(request) != null)
         {
             RequestList = new ObservableCollection <vwRequest>(service.GetAllRequestByPatient(patient.PatientId));
             CheckOpenRequest(RequestList);
             ResetRequestFilds();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }