public ClinicInfoManageViewModel() { if (App.Current != null) { _esClinicContext = App.Current.EsClinicContext; } LogoImg = new BitmapImage(new Uri("/ESClinic;component/Resources/Placeholder.jpg", UriKind.Relative)); NotifyOfPropertyChange(() => LogoImg); var info = _esClinicContext.ClinicInfoes.FirstOrDefault(); if (info != null) { _info = info; ClinicName = info.Name; ClinicAddress = info.Address; ClinicPhone = info.Phone; if (info.Logo != null) { LogoImg = ImageDataConverter.BytesToBitmapImage(info.Logo); NotifyOfPropertyChange(() => LogoImg); } } else { _info = new ClinicInfo(); _esClinicContext.ClinicInfoes.Add(_info); _esClinicContext.SaveChanges(); } }
public PrescriptionViewModel(Session session) { DisplayName = "Toa thuốc"; if (App.Current != null) { _esClinicContext = App.Current.EsClinicContext; } _session = session; IsBusyHidden = true; NotifyOfPropertyChange(() => IsBusyHidden); _clinic = _esClinicContext.ClinicInfoes.FirstOrDefault(); _patient = _esClinicContext.Patients.Find(session.PatientId); }
public HttpResponseMessage Post([FromBody] ClinicInfo value) { try { m_repository.Update(value); return(new HttpResponseMessage(HttpStatusCode.OK)); } catch (EntityNotFoundException exp) { return(ResponseCreator.GenerateResponse(HttpStatusCode.NotFound, exp)); //new HttpResponseMessage(HttpStatusCode.NotFound); } catch (Exception exp) { return(ResponseCreator.GenerateResponse(HttpStatusCode.InternalServerError, exp)); //new HttpResponseMessage(HttpStatusCode.InternalServerError); } }
public EndoscopyResultsViewModel(EndoscopyRecord esRecord, Patient patient, Session session) { DisplayName = "Kết quả nội soi"; if (App.Current != null) { _esClinicContext = App.Current.EsClinicContext; } _esRecord = esRecord; _patient = patient; _session = session; _esClinicContext.Entry(_esRecord).Collection("Photos").Load(); _nPhoto = _esRecord.EndoscopyPhotoes.Count; IsBusyHidden = true; NotifyOfPropertyChange(() => IsBusyHidden); _clinic = _esClinicContext.ClinicInfoes.FirstOrDefault(); }