コード例 #1
0
ファイル: DoctorListViewModel.cs プロジェクト: PvtPepe/Kurs
 private void DoctorDelete()
 {
     _dialogService.ShowDialog("ClinicNotificationView", r =>
     {
         if (r.Result == ButtonResult.Yes)
         {
             docRepo.Delete(SelectedDoctor);
             Doctors = new ObservableCollection <Doctor>(docRepo.GetAll());
         }
     });
 }
コード例 #2
0
 private void PopulatedGridView()
 {
     doctor.department = cbDepartment.Text;
     this.dgvDoctor.AutoGenerateColumns = false;
     this.dgvDoctor.DataSource          = doctorRepo.GetAll(doctor).ToList();
     this.dgvDoctor.ClearSelection();
     this.dgvDoctor.Refresh();
 }
コード例 #3
0
ファイル: DoctorListViewModel.cs プロジェクト: PvtPepe/Kurs
 public DoctorListViewModel(IRegionManager regionManager, IDialogService dialogService)
 {
     _regionManager        = regionManager;
     _dialogService        = dialogService;
     docRepo               = new DoctorRepo(new ClinicAppDAL.EF.ClinicAppClinicContext());
     Doctors               = new ObservableCollection <Doctor>(docRepo.GetAll());
     DoctorSelectedCommand = new DelegateCommand <Doctor>(DoctorSelected);
     DoctorDeleteCommand   = new DelegateCommand(DoctorDelete, canDelete).ObservesProperty(() => SelectedDoctor);
     DoctorAddCommand      = new DelegateCommand(DoctorAdd);
     SearchCommand         = new DelegateCommand(Search);
     ChangeCommand         = new DelegateCommand(Change, canDelete).ObservesProperty(() => SelectedDoctor);
 }
コード例 #4
0
        public VisitAddViewModel()
        {
            ButtonClick = new DelegateCommand(Add);
            patRepo     = new BaseRepo <Patient>(new ClinicAppDAL.EF.ClinicAppClinicContext());
            diagRepo    = new BaseRepo <Diagnosis>(new ClinicAppDAL.EF.ClinicAppClinicContext());
            docRepo     = new DoctorRepo(new ClinicAppDAL.EF.ClinicAppClinicContext());
            visRepo     = new DoctorVisitRepo(new ClinicAppDAL.EF.ClinicAppClinicContext());
            VisitDate   = DateTime.Now;

            Doctors   = new ObservableCollection <Doctor>(docRepo.GetAll());
            Patients  = new ObservableCollection <Patient>(patRepo.GetAll());
            Diagnoses = new ObservableCollection <Diagnosis>(diagRepo.GetAll());
        }