예제 #1
0
        public ExamineViewModel(IWindowManager windowManager)
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;

                _user          = App.Current.User;
                _windowManager = windowManager;
            }

            PatientResultsProvider = new PatientResultsProvider(_esClinicContext);
            ProductResultsProvider = new ProductResultsProvider(_esClinicContext);

            Sessions  = new BindableCollection <Session>();
            EsRecords = new BindableCollection <EndoscopyRecord>();
            Services  = new BindableCollection <Service>();
            Drugs     = new BindableCollection <Drug>();
            Visitors  = new BindableCollection <Visitor>();
            RefreshVisitors();

            _events = new EventAggregator();
            _events.Subscribe(this);

            CanNewSession = false;
            _drugSaved    = true;

            NotifyOfPropertyChange(() => CanSaveSession);
            NotifyOfPropertyChange(() => CanSaveDrugs);
        }
        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();
            }
        }
예제 #3
0
        public EndoscopyViewModel(IEventAggregator events, int sessionId)
        {
            DisplayName = "Nội soi";
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }
            _events    = events;
            _sessionId = sessionId;

            Photos = new BindableCollection <TmpPhoto>();

            IsEnabledScopy = true;
            NotifyOfPropertyChange(() => IsEnabledScopy);

            EsTypes = new BindableCollection <EndoscopyType>();
            var esTypes = _esClinicContext.EndoscopyTypes.ToList();

            foreach (var esType in esTypes)
            {
                EsTypes.Add(esType);
            }

            Cameras = new BindableCollection <Camera>();
            foreach (var camera in CameraService.AvailableCameras)
            {
                Cameras.Add(camera);
            }

            _selectedCamera = Cameras.FirstOrDefault();
        }
예제 #4
0
        public EndoscopyViewModel(IEventAggregator events, int sessionId)
        {
            DisplayName = "Nội soi";
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }
            _events = events;
            _sessionId = sessionId;
          
            Photos = new BindableCollection<TmpPhoto>();

            IsEnabledScopy = true;
            NotifyOfPropertyChange(() => IsEnabledScopy);

            EsTypes = new BindableCollection<EndoscopyType>();
            var esTypes = _esClinicContext.EndoscopyTypes.ToList();
            
            foreach (var esType in esTypes)
            {
                EsTypes.Add(esType);
            }

            Cameras = new BindableCollection<Camera>();
            foreach (var camera in CameraService.AvailableCameras)
            {
                Cameras.Add(camera);
            }

            _selectedCamera = Cameras.FirstOrDefault();
        }
예제 #5
0
        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 EndoscopyRecordViewModel(EndoscopyRecord esRecord)
        {
            DisplayName = "Xem kết quả nội soi";
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            EsImages = new BindableCollection <BitmapImage>();
            var esImages =
                _esClinicContext.EndoscopyPhotoes.ToList().Where(e => e.EndoscopyRecordId == esRecord.EndoscopyRecordId);

            foreach (var image in esImages)
            {
                EsImages.Add(ImageDataConverter.BytesToBitmapImage(image.Photo));
            }

            var type = _esClinicContext.EndoscopyTypes.ToList()
                       .FirstOrDefault(e => e.EndoScopyTypeId == esRecord.EndoscopyTypeId);

            if (type != null)
            {
                ResultTitle = "Mục nội soi: " + type.Name;
            }
            NotifyOfPropertyChange(() => ResultTitle);

            Result = esRecord.Result;
            NotifyOfPropertyChange(() => Result);
        }
예제 #7
0
        public LoginViewModel(IEventAggregator events)
        {
            _events = events;

            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }
        }
예제 #8
0
        public LoginViewModel(IEventAggregator events)
        {
            _events = events;

            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;

            }
        }
        public ImportProductsViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            ImportProducts = new BindableCollection <Product>();

            Exp = DateTime.Today;

            ProductResultsProvider = new ProductResultsProvider(_esClinicContext);
        }
예제 #10
0
        public ImportProductsViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            ImportProducts = new BindableCollection<Product>();
           
            Exp = DateTime.Today;

            ProductResultsProvider = new ProductResultsProvider(_esClinicContext);
        }
예제 #11
0
        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);
        }
예제 #12
0
        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);
        }
예제 #13
0
        public UserInfoManageViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            Users = new BindableCollection <User>();

            var users = _esClinicContext.Users.ToList();

            foreach (var user in users)
            {
                Users.Add(user);
            }
        }
예제 #14
0
        public ServiceManageViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            ServiceTypes = new BindableCollection <ServiceType>();

            var serviceTypes = _esClinicContext.ServiceTypes.ToList();

            foreach (var service in serviceTypes)
            {
                ServiceTypes.Add(service);
            }
        }
예제 #15
0
        public SurchargeManageViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            Surcharges = new BindableCollection <Surcharge>();

            var surcharges = _esClinicContext.Surcharges.ToList();

            foreach (var surcharge in surcharges)
            {
                Surcharges.Add(surcharge);
            }
        }
        public EndoscopyManageViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            EsTypes = new BindableCollection <EndoscopyType>();

            var esTypes = _esClinicContext.EndoscopyTypes.ToList();

            foreach (var esType in esTypes)
            {
                EsTypes.Add(esType);
            }
        }
예제 #17
0
        public ServiceManageViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            ServiceTypes = new BindableCollection<ServiceType>();

            var serviceTypes = _esClinicContext.ServiceTypes.ToList();

            foreach (var service in serviceTypes)
            {
                ServiceTypes.Add(service);
            }
        }
        public SurchargeManageViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            Surcharges = new BindableCollection<Surcharge>();

            var surcharges = _esClinicContext.Surcharges.ToList();

            foreach (var surcharge in surcharges)
            {
                Surcharges.Add(surcharge);
            }
        }
예제 #19
0
        public UserInfoManageViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            Users = new BindableCollection<User>();

            var users = _esClinicContext.Users.ToList();

            foreach (var user in users)
            {
                Users.Add(user);
            }
        }
        public EndoscopyManageViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            EsTypes = new BindableCollection<EndoscopyType>();

            var esTypes = _esClinicContext.EndoscopyTypes.ToList();

            foreach (var esType in esTypes)
            {
                EsTypes.Add(esType);
            }
        }
예제 #21
0
        public ProductManageViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            Products = new BindableCollection<Product>();

            var products = _esClinicContext.Products.ToList();

            foreach (var product in products)
            {
                Products.Add(product);
            }

            Exp = DateTime.Now;
            BrandName = "";
            GenericDrug = "";
        }
        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();
        }
예제 #23
0
        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();
        }
예제 #24
0
        public ProductManageViewModel()
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
            }

            Products = new BindableCollection <Product>();

            var products = _esClinicContext.Products.ToList();

            foreach (var product in products)
            {
                Products.Add(product);
            }

            Exp         = DateTime.Now;
            BrandName   = "";
            GenericDrug = "";
        }
예제 #25
0
        public PaymentsViewModel(IWindowManager windowManager)
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
                Payors = new AutoRefreshWrapper<Payor>(_esClinicContext.Payors, "Session", _esClinicContext, RefreshMode.StoreWins);
                _windowManager = windowManager;
            }

            

            Services = new BindableCollection<Service>();
            Drugs = new BindableCollection<Drug>();
            Surcharges = new BindableCollection<Surcharge>();

            var surchanges = _esClinicContext.Surcharges.ToList();
            foreach (var surchange in surchanges)
            {
                Surcharges.Add(surchange);
            }
        }
예제 #26
0
        public PaymentsViewModel(IWindowManager windowManager)
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
                Payors           = new AutoRefreshWrapper <Payor>(_esClinicContext.Payors, "Session", _esClinicContext, RefreshMode.StoreWins);
                _windowManager   = windowManager;
            }



            Services   = new BindableCollection <Service>();
            Drugs      = new BindableCollection <Drug>();
            Surcharges = new BindableCollection <Surcharge>();

            var surchanges = _esClinicContext.Surcharges.ToList();

            foreach (var surchange in surchanges)
            {
                Surcharges.Add(surchange);
            }
        }
        public EndoscopyRecordViewModel(EndoscopyRecord esRecord)
        {
            DisplayName = "Xem kết quả nội soi";
            if (App.Current != null)
                _esClinicContext = App.Current.EsClinicContext;

            EsImages = new BindableCollection<BitmapImage>();
            var esImages =
                _esClinicContext.EndoscopyPhotoes.ToList().Where(e => e.EndoscopyRecordId == esRecord.EndoscopyRecordId);
            foreach (var image in esImages)
            {
                EsImages.Add(ImageDataConverter.BytesToBitmapImage(image.Photo));
            }

            var type = _esClinicContext.EndoscopyTypes.ToList()
                .FirstOrDefault(e => e.EndoScopyTypeId == esRecord.EndoscopyTypeId);
            if (type != null)
                ResultTitle = "Mục nội soi: " + type.Name;
            NotifyOfPropertyChange(()=>ResultTitle);

            Result = esRecord.Result;
            NotifyOfPropertyChange(() => Result);
        }
예제 #28
0
 public PatientResultsProvider(EsClinicEntities esClinicContext)
 {
     _esClinicContext = esClinicContext;
 }
예제 #29
0
 public ProductResultsProvider(EsClinicEntities esClinicContext)
 {
     _esClinicContext = esClinicContext;
 }