public void LoadSessionInfo() { if (SelectedSession == null) { return; } NotifyOfPropertyChange(() => CanSaveSession); NotifyOfPropertyChange(() => CanNewEsRecord); NotifyOfPropertyChange(() => CanChangeService); NotifyOfPropertyChange(() => CanAddDrug); NotifyOfPropertyChange(() => CanSaveDrugs); Symtoms = SelectedSession.Symtoms; Diagnose = SelectedSession.Diagnose; if (SelectedSession.ReExamDate != null) { ReExamDate = SelectedSession.ReExamDate.Value; } SessionNote = SelectedSession.Note; var esRecords = _esClinicContext.EndoscopyRecords.Include("Type").ToList().Where(e => e.SessionId == SelectedSession.SessionId); EsRecords.Clear(); foreach (var esRecord in esRecords) { EsRecords.Add(esRecord); } var services = _esClinicContext.Services.Include("ServiceType").ToList().Where(s => s.SessionId == SelectedSession.SessionId); Services.Clear(); foreach (var service in services) { Services.Add(service); } var drugs = _esClinicContext.Drugs.Include("Product").ToList().Where(d => d.SessionId == SelectedSession.SessionId); Drugs.Clear(); foreach (var drug in drugs) { Drugs.Add(drug); } }
public void Handle(EndoscopyRecord esRecord) { EsRecords.Add(esRecord); }