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;
 }
 /// <summary>
 /// 内部采用异步线程取得所有患者,搜索条件增加时在此扩展
 /// </summary>
 /// <returns></returns>
 private ICollection<Doctor> getAllDoctor(KeyValuePair<string, string> searchCondition)
 {
     using (Task<ICollection<Doctor>> task = Task.Run<ICollection<Doctor>>(new Func<ICollection<Doctor>>(() =>
     {
         //return result;
         int count;
         using (DoctorBLL doctorBLL = new DoctorBLL())
         {
             ICollection<Doctor> result;
             switch (searchCondition.Key)
             {
                 case "FirstName":
                     result = doctorBLL.SelectByFirstName(searchCondition.Value);
                     break;
                 case "LastName":
                     result = doctorBLL.SelectByLastName(searchCondition.Value);
                     break;
                 default:
                     result = doctorBLL.SelectPaging(1, short.MaxValue, out count);
                     break;
             }
             return result;
         }
     })))
     {
         return task.Result;
     }
 }
 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);
     }
 }