private void DoctorDelete() { _dialogService.ShowDialog("ClinicNotificationView", r => { if (r.Result == ButtonResult.Yes) { docRepo.Delete(SelectedDoctor); Doctors = new ObservableCollection <Doctor>(docRepo.GetAll()); } }); }
private void PopulatedGridView() { doctor.department = cbDepartment.Text; this.dgvDoctor.AutoGenerateColumns = false; this.dgvDoctor.DataSource = doctorRepo.GetAll(doctor).ToList(); this.dgvDoctor.ClearSelection(); this.dgvDoctor.Refresh(); }
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); }
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()); }