Пример #1
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value is Guid)
     {
         var doctorBLL = new DoctorBLL();
         var doctor = doctorBLL.GetById((Guid)value);
         doctorBLL.Dispose();
         if (doctor != null)
         {
             return doctor.FirstName + " " + doctor.LastName;
         }
         return null;
     }
     return null;
 }
Пример #2
0
 private void OnExecuteConfirmCommand()
 {
     var doctorBLL = new DoctorBLL();
     try
     {
         doctorBLL.Delete(Doctor.Id);
         StaticDatas.CurrentSelectedDoctor = null;
     }
     catch (Exception ex)
     {
         LogHelper.Error(ToString(), ex);
         MessageBox.Show(Application.Current.MainWindow, ex.Message, ResourceHelper.LoadString("Error"), MessageBoxButton.OK, MessageBoxImage.Error);
     }
     finally
     {
         if (doctorBLL != null)
         {
             doctorBLL.Dispose();
             doctorBLL = null;
         }
         clearData();
         Messenger.Default.Send<object>(null, Model.MessengerToken.ClosePopup);
         Messenger.Default.Send<ViewInfo>(new ViewInfo(ViewName.DoctorListView, ViewType.View), Model.MessengerToken.Navigate);
     }
 }