Esempio n. 1
0
        /// <summary>
        /// 本機資訊與伺服器資訊都沒問題後的版本判斷
        /// </summary>
        /// <param name="agencys">Agencys</param>
        private void CheckServerTrialPeriod(Agencys agencys)
        {
            //開始判斷伺服器認證碼的使用權限
            TextBlockStatus.Dispatcher.Invoke(() =>
            {
                TextBlockStatus.Text = "取得伺服器認證資訊";
            }, DispatcherPriority.Render);

            if (agencys.Agency_IsVerify)
            {
                if (agencys.Agency_IsTry)
                {
                    if (agencys.Agency_TrialPeriod < DateTime.Now.Date)
                    {
                        MessageBoxTips = "試用期限已到,請聯絡資訊廠商";
                    }
                    else
                    {
                        IsValidTrialPeriod = true;

                        MessageBoxTips = "此為試用版本,試用日期至" + ((DateTime)agencys.Agency_TrialPeriod).ToShortDateString();

                        ReturnDialogResult = true;
                    }
                }
                else
                {
                    ReturnDialogResult = true;
                }
            }
            else
            {
                MessageBoxTips = "此驗證碼已停用,如欲使用請聯絡資訊廠商";
            }
        }
Esempio n. 2
0
        public PatientInformation(Agencys agencys, Patients patients)
        {
            InitializeComponent();

            Agencys  = agencys;
            Patients = patients;
        }
Esempio n. 3
0
 //編輯
 public PatientViewModel(Agencys agencys, Patients patients)
 {
     Agencys         = agencys;
     Patients        = patients;
     PatientNumber   = Patients.Patient_Number;
     PatientName     = Patients.Patient_Name;
     PatientIDNumber = Patients.Patient_IDNumber;
     GenderM         = Patients.Patient_Gender;
     Birth           = Patients.Patient_Birth.Date;
     if (!string.IsNullOrEmpty(Patients.Patient_Photo))
     {
         PatientsFolder patientsFolder = new PatientsFolder(Agencys, Patients);
         if (!Directory.Exists(patientsFolder.PatientFullPatientPhotoPath))
         {
             Directory.CreateDirectory(patientsFolder.PatientFullPatientPhotoPath);
         }
         PatientPhoto = new LoadBitmapImage().SettingBitmapImage(Agencys.Agency_ImagePath + @"\" + Patients.Patient_Photo, 400);
     }
     using (var dde = new DigiDentalEntities())
     {
         var qpc = from pc in dde.PatientCategories
                   select new PatientCategoryInfo()
         {
             PatientCategory_ID    = pc.PatientCategory_ID,
             PatientCategory_Title = pc.PatientCategory_Title,
             IsChecked             = pc.Patients.Where(p => p.Patient_ID == patients.Patient_ID).Count() > 0 ? true : false
         };
         PatientCategoryInfo = qpc.ToList().FindAll(pci => pci.IsChecked == true);
     }
 }
Esempio n. 4
0
        public ObservableCollection <ImageInfo> QueryNewInsertImage(Agencys agencys, Patients patients, DateTime registrationDate, ObservableCollection <ImageInfo> oriImageInfos)
        {
            using (var ide = new iDentalEntities())
            {
                var queryID = from ori in oriImageInfos
                              select ori.Image_ID;

                var qi = from i in ide.Images
                         where i.Registrations.Patient_ID == patients.Patient_ID &&
                         i.Registrations.Registration_Date == registrationDate.Date &&
                         i.Image_IsEnable == true &&
                         !queryID.Contains(i.Image_ID)
                         select i;
                ObservableCollection <ImageInfo> observableCollection = new ObservableCollection <ImageInfo>(qi.ToList().Select(s => new ImageInfo
                {
                    Registration_Date = s.Registrations.Registration_Date,
                    Image_ID          = s.Image_ID,
                    Image_Path        = s.Image_Path,
                    Image_FullPath    = agencys.Agency_ImagePath + s.Image_Path,
                    Image_FileName    = s.Image_FileName,
                    Image_Extension   = s.Image_Extension,
                    Registration_ID   = s.Registration_ID,
                    CreateDate        = s.CreateDate,
                    IsSelected        = false
                }));
                return(observableCollection);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 選擇樣板回傳的圖片集合
        /// </summary>
        /// <param name="agencys"></param>
        /// <param name="patients"></param>
        /// <param name="templates"></param>
        /// <param name="templateImportDate"></param>
        /// <returns></returns>
        public ObservableCollection <TemplateImages> GetTemplateImagesCollection(Agencys agencys, Patients patients, Templates templates, DateTime templateImportDate)
        {
            var IsImageExist = (from iie in dde.TemplateImages
                                where iie.Template_ID == templates.Template_ID &&
                                iie.TemplateImage_ImportDate == templateImportDate.Date &&
                                iie.Patient_ID == patients.Patient_ID
                                select new
            {
                TemplateImage_ID = iie.TemplateImage_ID,
                TemplateImage_Number = iie.TemplateImage_Number,
                TemplateImage_ImportDate = iie.TemplateImage_ImportDate,
                Template_ID = iie.Template_ID,
                Image_ID = iie.Image_ID,
                Image_Path = agencys.Agency_ImagePath + iie.Image_Path,
                Patient_ID = iie.Patient_ID
            }).ToList().Select(s => new TemplateImages
            {
                TemplateImage_ID         = s.TemplateImage_ID,
                TemplateImage_Number     = s.TemplateImage_Number,
                TemplateImage_ImportDate = s.TemplateImage_ImportDate,
                Template_ID = s.Template_ID,
                Image_ID    = s.Image_ID,
                Image_Path  = s.Image_Path,
                Patient_ID  = s.Patient_ID
            });

            tICollection = new ObservableCollection <TemplateImages>(IsImageExist);
            return(tICollection);
        }
 /// <summary>
 /// 編輯
 /// </summary>
 /// <param name="windowTitle"></param>
 /// <param name="agencys"></param>
 /// <param name="patients"></param>
 public PatientSetting(string windowType, Agencys agencys, Patients patients)
 {
     InitializeComponent();
     Agencys    = agencys;
     Patients   = patients;
     WindowType = windowType;
 }
Esempio n. 7
0
        private void Button_OK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (dde == null)
                {
                    dde = new DigiDentalEntities();
                }
                Agencys a = (from q in dde.Agencys
                             where q.Agency_Code == svm.Agencys.Agency_Code
                             select q).First();
                a.Agency_ViewType     = svm.ViewType;
                a.Agency_ImagePath    = svm.ImagePath;
                a.Agency_WifiCardPath = svm.WifiCardPath;
                a.Function_ID         = svm.StartFunction;
                dde.SaveChanges();

                Agencys      = a;
                DialogResult = true;
            }
            catch (Exception ex)
            {
                Error_Log.ErrorMessageOutput(ex.ToString());
                DialogResult = false;
            }
            Close();
        }
        public ImageTransferInto(Agencys agencys, Patients patients, ObservableCollection <ImageInfo> displayImageInfoList)
        {
            InitializeComponent();

            imageTransferIntoViewModel = new ImageTransferIntoViewModel(agencys, patients, displayImageInfoList);

            DataContext = imageTransferIntoViewModel;
        }
Esempio n. 9
0
 public AgencySettingTab1ViewModel()
 {
     Agencys             = new TableAgencys().QueryVerifyAgencys();
     Agency_ImagePath    = Agencys.Agency_ImagePath;
     Agency_WifiCardPath = Agencys.Agency_WifiCardPath;
     Agency_ViewType     = Agencys.Agency_ViewType;
     Agency_Function     = Agencys.Function_ID;
 }
Esempio n. 10
0
 public ImageTransferIntoViewModel(Agencys agencys, Patients patients, ObservableCollection <ImageInfo> displayImageInfoList)
 {
     Agencys  = agencys;
     Patients = patients;
     RbSelf   = true;
     RbNewRegistrationDate = true;
     DisplayImageInfoList  = displayImageInfoList;
 }
        public TemplateFunction(Agencys agencys, Patients patients, MTObservableCollection <ImageInfo> showImages)
        {
            InitializeComponent();

            tmpA = agencys;
            tmpP = patients;
            tmpI = showImages;
        }
Esempio n. 12
0
 /// <summary>
 /// 病患大頭貼路徑
 /// </summary>
 /// <param name="agencys"></param>
 /// <param name="patients"></param>
 public PatientsFolder(Agencys agencys, Patients patients)
 {
     //..\病患資料夾\PatientPhoto
     PatientPhotoPath = @"\" + patients.Patient_ID + @"\PatientPhoto";
     //Agencys_ImagePath\病患資料夾
     PatientFullBasePath = agencys.Agency_ImagePath + @"\" + patients.Patient_ID;
     //Agencys_ImagePath\病患資料夾\PatientPhoto
     PatientFullPatientPhotoPath = PatientFullBasePath + @"\PatientPhoto";
 }
Esempio n. 13
0
        public ListFunction(Agencys agencys, MTObservableCollection <ImageInfo> showImages)
        {
            InitializeComponent();

            //暫存
            //Loaded後載入
            tmpA = agencys;
            tmpI = showImages;
        }
Esempio n. 14
0
        public FunctionTemplateViewModel(Agencys agencys, Patients patients)
        {
            Agencys  = agencys;
            Patients = patients;

            SetTemplateLayout(agencys);
            //載入樣板
            Templates = new TableTemplates().QueryAllTemplates();
        }
Esempio n. 15
0
        public PatientInformationViewModel(Agencys agencys, Patients patients)
        {
            tableImages = new TableImages();

            Agencys  = agencys;
            Patients = patients;

            FunctionsSetting();
        }
        /// <summary>
        /// 病患大頭照路徑設定
        /// </summary>
        /// <param name="agencys">機構資料</param>
        /// <param name="patients">病患資料</param>
        /// <returns></returns>
        public static PatientPhotoFolderInfo PatientPhotoFolderSetting(Agencys agencys, string patientsID)
        {
            PatientPhotoFolderInfo patientPhotoInfo = new PatientPhotoFolderInfo()
            {
                PatientPhotoPath     = @"\" + patientsID + @"\PatientPhoto",
                PatientPhotoFullPath = agencys.Agency_ImagePath + @"\" + patientsID + @"\PatientPhoto"
            };

            return(patientPhotoInfo);
        }
Esempio n. 17
0
 public Settings(Agencys agencys)
 {
     InitializeComponent();
     if (svm == null)
     {
         svm         = new SettingsViewModel();
         svm.Agencys = agencys;
     }
     DataContext = svm;
 }
        /// <summary>
        /// 病患影像路徑設定
        /// </summary>
        /// <param name="agencys">機構資料</param>
        /// <param name="patients">病患資料</param>
        /// <param name="registrationDate">掛號日</param>
        public static PatientImageFolderInfo PatientImageFolderSetting(Agencys agencys, string patientsID, DateTime registrationDate)
        {
            PatientImageFolderInfo patientImageFolderInfo = new PatientImageFolderInfo()
            {
                PatientImagePath     = @"\" + patientsID + @"\" + registrationDate.ToString("yyyyMMdd"),
                PatientImageFullPath = agencys.Agency_ImagePath + @"\" + patientsID + @"\" + registrationDate.ToString("yyyyMMdd")
            };

            return(patientImageFolderInfo);
        }
 public TemplateFunctionViewModel(Agencys agencys, Patients patients, MTObservableCollection <ImageInfo> showImages)
 {
     Agencys    = agencys;
     Patients   = patients;
     ShowImages = showImages;
     using (var dde = new DigiDentalEntities())
     {
         var temp = from t in dde.Templates
                    select t;
         Templates = new ObservableCollection <Templates>(temp);
     }
 }
Esempio n. 20
0
        public WebcamViewModel(Agencys agencys, Patients patients, DateTime registrationDate)
        {
            tableImages = new TableImages();

            this.agencys = agencys;

            this.patients = patients;

            this.registrationDate = registrationDate;

            RefreshDisplayImageInfoList();
        }
        public FunctionTemplate(Agencys agencys, Patients patients, MTObservableCollection <ImageInfo> displayImageInfo)
        {
            InitializeComponent();

            functionTemplateViewModel = new FunctionTemplateViewModel(agencys, patients);

            DataContext = functionTemplateViewModel;

            DisplayImageInfo = displayImageInfo;

            tableTemplates_Images = new TableTemplates_Images();
        }
Esempio n. 22
0
        public FunctionList(Agencys agencys, Patients patients, MTObservableCollection <ImageInfo> displayImageInfo)
        {
            InitializeComponent();

            Agencys = agencys;

            Patients = patients;

            functionListViewModel = new FunctionListViewModel();

            DataContext = functionListViewModel;

            DisplayImageInfo = displayImageInfo;
        }
Esempio n. 23
0
 /// <summary>
 /// 更新機構資訊
 /// </summary>
 /// <param name="agencys"></param>
 /// <param name="imagePath"></param>
 /// <param name="wifiCardPath"></param>
 /// <param name="viewType"></param>
 /// <param name="functionID"></param>
 /// <returns></returns>
 public void UpdateAgency(Agencys agencys, string imagePath, string wifiCardPath, string viewType, int functionID)
 {
     using (var ide = new iDentalEntities())
     {
         Agencys newAgencys = (from a in ide.Agencys
                               where a.Agency_Code == agencys.Agency_Code
                               select a).First();
         newAgencys.Agency_ImagePath    = imagePath;
         newAgencys.Agency_WifiCardPath = wifiCardPath;
         newAgencys.Agency_ViewType     = viewType;
         newAgencys.Function_ID         = functionID;
         ide.SaveChanges();
     }
 }
Esempio n. 24
0
 /// <summary>
 /// 病患影像資料夾(含掛號日底下)
 /// </summary>
 /// <param name="agencys">機構資訊</param>
 /// <param name="patients">病患資訊</param>
 /// <param name="registrationDate">掛號日</param>
 public PatientsFolder(Agencys agencys, Patients patients, DateTime registrationDate)
 {
     //..\病患資料夾\掛號日期
     PatientFolderPath = patients.Patient_ID + @"\" + registrationDate.ToString("yyyyMMdd");
     //..\病患資料夾\掛號日期\Original
     PatientFolderPathOriginal = PatientFolderPath + @"\Original";
     //..\病患資料夾\掛號日期\Small
     PatientFolderPathSmall = PatientFolderPath + @"\Small";
     //Agencys_ImagePath\病患資料夾\掛號日期
     PatientFullFolderPath = agencys.Agency_ImagePath + @"\" + PatientFolderPath;
     //Agencys_ImagePath\病患資料夾\掛號日期\Original
     PatientFullFolderPathOriginal = PatientFullFolderPath + @"\Original";
     //Agencys_ImagePath\病患資料夾\掛號日期\Small
     PatientFullFolderPathSmall = PatientFullFolderPath + @"\Small";
 }
Esempio n. 25
0
 private void ToggleButton_Save_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         //診所設定判斷
         Agencys agencys = agencySettingViewModel.Agencys;
         if (PathCheck.IsPathExist(agencys.Agency_ImagePath))
         {
             new TableAgencys().UpdateAgency(agencys, agencys.Agency_ImagePath, agencys.Agency_WifiCardPath, agencys.Agency_ViewType, agencys.Function_ID);
             ReturnDialogResult = true;
         }
         else
         {
             if (MessageBox.Show("您所設定的影像路徑無法使用,可能會導致影像無法存取,是否繼續?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
             {
                 new TableAgencys().UpdateAgency(agencys, agencys.Agency_ImagePath, agencys.Agency_WifiCardPath, agencys.Agency_ViewType, agencys.Function_ID);
                 ReturnDialogResult = true;
             }
         }
         //其他
         string PointofixPath = agencySettingViewModel.Pointofix;
         if (PathCheck.IsFileExist(PointofixPath) || string.IsNullOrEmpty(PointofixPath))
         {
             ConfigManage.AddUpdateAppConfig("PointofixPath", PointofixPath);
             ReturnDialogResult = true;
         }
         else
         {
             if (MessageBox.Show("您所設定的Pointofix的位置不存在,可能會導致該軟體無法使用,是否繼續?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
             {
                 ConfigManage.AddUpdateAppConfig("PointofixPath", PointofixPath);
                 ReturnDialogResult = true;
             }
         }
         string ImageDecodePixel = agencySettingViewModel.ImageDecodePixel;
         ConfigManage.AddUpdateAppConfig("ImageDecodePixel", ImageDecodePixel);
         MessageBox.Show("設定已更改");
     }
     catch (Exception ex)
     {
         MessageBox.Show("儲存設定時發生異常", "提示", MessageBoxButton.OK, MessageBoxImage.Error);
         ErrorLog.ErrorMessageOutput(ex.ToString());
     }
     DialogResult = ReturnDialogResult;
     Close();
 }
Esempio n. 26
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="images"></param>
        /// <returns></returns>
        public ImageInfo TransImagesToImageInfo(Agencys agencys, Images images, DateTime registrationDate, int decodePixelWidth)
        {
            ImageInfo imageInfo = new ImageInfo()
            {
                Registration_Date = registrationDate,
                Image_ID          = images.Image_ID,
                Image_Path        = images.Image_Path,
                Image_FullPath    = agencys.Agency_ImagePath + images.Image_Path,
                Image_FileName    = images.Image_FileName,
                Image_Extension   = images.Image_Extension,
                CreateDate        = images.CreateDate,
                Registration_ID   = images.Registration_ID,
                BitmapImage       = new CreateBitmapImage().BitmapImageShow(agencys.Agency_ImagePath + images.Image_Path, decodePixelWidth),
                IsSelected        = false
            };

            return(imageInfo);
        }
Esempio n. 27
0
        public TInOut9s(Agencys agencys, Patients patients, Templates templates, DateTime templateImportDate)
        {
            InitializeComponent();

            Patients = patients;

            Templates = templates;

            TemplateImportDate = templateImportDate;

            TemplateImagePixelWidth = (int)templates.Template_DecodePixelWidth;

            tableTemplates_Images = new TableTemplates_Images();

            ObservableCollection <Templates_Images> observableCollection = tableTemplates_Images.QueryTemplatesImagesImportDateAndReturnFullImagePath(agencys, patients, templates, templateImportDate);

            new LoadTemplates_Images().LoadAllTemplatesImages(observableCollection, MainGrid, TemplateImagePixelWidth);
        }
Esempio n. 28
0
        public TInOut10s(Agencys agencys, Patients patients, Templates templates, DateTime templateImportDate)
        {
            InitializeComponent();
            Agencys = agencys;

            Patients = patients;

            Templates = templates;

            TemplateImagePixelWidth = (int)Templates.Template_DecodePixelWidth;

            TemplateImportDate = templateImportDate;

            if (dbTI == null)
            {
                dbTI = new DBTemplateImages();
            }

            dbTI.ShowTemplateImage(Agencys, Patients, Templates, TemplateImagePixelWidth, MainGrid, TemplateImportDate);
        }
Esempio n. 29
0
        private void SetTemplateLayout(Agencys agencys)
        {
            //設定Grid 橫向或直向
            //0:橫幅 1:直幅
            switch (agencys.Agency_ViewType)
            {
            case "0":
                ColumnSpan           = 1;
                RowSpan              = 3;
                ButtonStretchContent = ">";
                ButtonStretchColumn  = 1;
                ButtonStretchRow     = 0;
                ButtonStretchWidth   = 15;
                ButtonStretchHeight  = 60;
                ListColumn           = 2;
                ListRow              = 0;
                ListItemColumn       = 1;
                ListHSBV             = ScrollBarVisibility.Hidden;
                ListVSBV             = ScrollBarVisibility.Visible;
                WrapOrientation      = Orientation.Vertical;
                break;

            case "1":
                ColumnSpan           = 3;
                RowSpan              = 1;
                ButtonStretchContent = "﹀";
                ButtonStretchColumn  = 0;
                ButtonStretchRow     = 1;
                ButtonStretchWidth   = 60;
                ButtonStretchHeight  = 15;
                ListColumn           = 0;
                ListRow              = 2;
                ListItemRow          = 1;
                ListHSBV             = ScrollBarVisibility.Visible;
                ListVSBV             = ScrollBarVisibility.Hidden;
                WrapOrientation      = Orientation.Horizontal;
                break;
            }
        }
Esempio n. 30
0
        public MainWindowViewModel(string hostName, Agencys agencys, Patients patients, DateTime selectedDate)
        {
            if (dde == null)
            {
                dde = new DigiDentalEntities();
            }

            HostName = hostName;
            Agencys  = agencys;
            Patients = patients;

            //設定病患大頭貼
            if (!string.IsNullOrEmpty(Patients.Patient_Photo))
            {
                PatientPhoto = new LoadBitmapImage().SettingBitmapImage(Agencys.Agency_ImagePath + @"\" + Patients.Patient_Photo, 400);
            }

            PatientCategoryInfo = (from pc in dde.PatientCategories
                                   where pc.Patients.Any(p => p.Patient_ID == Patients.Patient_ID)
                                   select new PatientCategoryInfo()
            {
                PatientCategory_ID = pc.PatientCategory_ID,
                PatientCategory_Title = pc.PatientCategory_Title,
                IsChecked = true
            }).ToList();

            //取掛號資訊清單 Registration
            var queryRegistrations = from qr in dde.Registrations
                                     where qr.Patient_ID == Patients.Patient_ID
                                     orderby qr.Registration_Date descending
                                     select qr;

            RegistrationsCollection = new ObservableCollection <Registrations>(queryRegistrations.ToList());

            SelectedDate = selectedDate;

            LoadFunctions();
        }