void CompletedWork(object sender, RunWorkerCompletedEventArgs e)
 {
     Log.RecordLog(new StackTrace(true).GetFrame(0).GetFileLineNumber().ToString(), "BeforeDownlad_CompletedWork", "IntoFunc");
     if (e.Error != null)
     {
         tmr.Stop();
         Log.RecordLog(new StackTrace(true).GetFrame(0).GetFileLineNumber().ToString(), "BeforeDownload.xaml.cs_CompletedWork()_Error", e.Error.Message);
         Handler_snackbarShow(TranslationSource.Instance["Error"]);   //錯誤
         SetHttpResponseOK(_ReceiveDataStatus.Error);
     }
     else if (e.Cancelled)
     {
         tmr.Stop();
         Log.RecordLog(new StackTrace(true).GetFrame(0).GetFileLineNumber().ToString(), "BeforeDownload.xaml.cs_CompletedWork()_exception", "e.Cancelled");
         Inteware_Messagebox Msg = new Inteware_Messagebox();
         Msg.ShowMessage(TranslationSource.Instance["ReceivingDataNotResponding"], TranslationSource.Instance["Warning"], MessageBoxButton.YesNo, MessageBoxImage.Warning);
         if (Msg.ReturnClickWhitchButton == (int)Inteware_Messagebox._ReturnButtonName.YES)
         {
             OrderManagerFunctions omFunc = new OrderManagerFunctions();
             omFunc.RunCommandLine(http_url, "");
         }
         Handler_snackbarShow(TranslationSource.Instance["Cancel"]);    //取消(超過時間,也許再讓使用者可以自行增加秒數?)
         SetHttpResponseOK(_ReceiveDataStatus.Cancel);
     }
     else
     {
         tmr.Stop();
         Log.RecordLog(new StackTrace(true).GetFrame(0).GetFileLineNumber().ToString(), "BeforeDownload.xaml.cs_CompletedWork()", "OK");
         SetHttpResponseOK(_ReceiveDataStatus.OK);
     }
 }
        private void Click_ButtonEvent(object sender, RoutedEventArgs e)
        {
            if (sender is Button)
            {
                switch (((Button)sender).Name)
                {
                case "button_DownloadOrder":
                {
                    if (background_orthoSmallcase.Visibility == Visibility.Visible)
                    {
                        background_orthoSmallcase.Visibility = Visibility.Hidden;
                    }
                    DownloadOrderFile();
                    break;
                }

                case "button_openDir":
                {
                    OrderManagerFunctions omFunc = new OrderManagerFunctions();
                    omFunc.RunCommandLine(Properties.OrderManagerProps.Default.systemDisk + @"Windows\explorer.exe", "/select,\"" + DownloadFileName + "\"");
                    break;
                }
                }
            }
        }
        private void Click_buttn_event(object sender, RoutedEventArgs e)
        {
            if (sender is Button buttonName)
            {
                switch (buttonName.Name)
                {
                case "button_openCAD":
                {
                    OrderManagerFunctions omFunc = new OrderManagerFunctions();
                    omFunc.RunCommandLine(Properties.Settings.Default.cad_exePath, "-openrpd \"" + cadInfo.CaseXmlPath + "\"");
                    break;
                }

                case "button_openDir":
                {
                    if (cadInfo != null && System.IO.Directory.Exists(cadInfo.CaseDirectoryPath) == true)
                    {
                        OrderManagerFunctions omFunc = new OrderManagerFunctions();
                        omFunc.RunCommandLine(Properties.OrderManagerProps.Default.systemDisk + @"Windows\explorer.exe", "\"" + cadInfo.CaseDirectoryPath + "\"");
                    }
                    break;
                }
                }
            }
        }
Exemple #4
0
 public ReleaseNote()
 {
     InitializeComponent();
     omFunc      = new OrderManagerFunctions();
     MainContent = "";
     DocUrl      = "";
 }
        private void Click_AirdentalWeb(object sender, RoutedEventArgs e)
        {
            string WebUrl = Properties.OrderManagerProps.Default.AirDentalAPI.Remove(Properties.OrderManagerProps.Default.AirDentalAPI.LastIndexOf("api/")) + @"project/implant/" + implantProjectInfo.Pid;
            OrderManagerFunctions omFunc = new OrderManagerFunctions();

            omFunc.RunCommandLine(WebUrl, "");
        }
 private void Click_FolderOpen(object sender, RoutedEventArgs e)
 {
     if (trayInfo != null && System.IO.Directory.Exists(trayInfo.CaseDirectoryPath) == true)
     {
         OrderManagerFunctions omFunc = new OrderManagerFunctions();
         omFunc.RunCommandLine(Properties.OrderManagerProps.Default.systemDisk + @"Windows\explorer.exe", "\"" + trayInfo.CaseDirectoryPath + "\"");
     }
     else if(splintInfo != null && System.IO.Directory.Exists(splintInfo.CaseDirectoryPath) == true)
     {
         OrderManagerFunctions omFunc = new OrderManagerFunctions();
         omFunc.RunCommandLine(Properties.OrderManagerProps.Default.systemDisk + @"Windows\explorer.exe", "\"" + splintInfo.CaseDirectoryPath + "\"");
     }
 }
        /// <summary>
        /// 讀取Tray專案
        /// </summary>
        public void LoadTrayProj()
        {
            string tray_projectDirectory = Properties.OrderManagerProps.Default.tray_projectDirectory;
            string tray_exePath          = Properties.Settings.Default.tray_exePath;

            if (Directory.Exists(tray_projectDirectory) == false && File.Exists(tray_exePath) != false)
            {
                OrderManagerFunctions omFunc = new OrderManagerFunctions();
                omFunc.AutoDetectSoftwareProjectPath((int)_softwareID.Tray);
                tray_projectDirectory = Properties.OrderManagerProps.Default.tray_projectDirectory;
            }
            if (Directory.Exists(tray_projectDirectory) == false || File.Exists(tray_exePath) == false)
            {
                return;
            }

            Caselist_Tray = new List <TrayInformation>();
            try
            {
                DirectoryInfo Dinfo = new DirectoryInfo(tray_projectDirectory);
                foreach (DirectoryInfo folder in Dinfo.GetDirectories())
                {
                    string DirectoryName = folder.ToString();
                    string XmlPath       = Dinfo.ToString() + DirectoryName + @"\" + DirectoryName + ".tml";

                    if (File.Exists(XmlPath) == false)
                    {
                        continue;
                    }
                    else
                    {
                        if (LoadXml((int)_softwareID.Tray, XmlPath) == false)
                        {
                            continue;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.RecordLog(new StackTrace(true).GetFrame(0).GetFileLineNumber().ToString(), "ProjectHandle.cs LoadtrayProj Exception", ex.Message);
            }

            Sorter.Sort_Tray(Caselist_Tray, 0, (Caselist_Tray.Count - 1), true);
            CaseShowEvent((int)_softwareID.Tray);
        }
        /// <summary>
        /// 讀取ImplantPlanning專案
        /// </summary>
        public void LoadImplantProjV2()
        {
            string implant_projectDirectory = Properties.OrderManagerProps.Default.implant_projectDirectory;
            string implant_exePath          = Properties.Settings.Default.implant_exePath;

            if (Directory.Exists(implant_projectDirectory) == false && File.Exists(implant_exePath) != false)
            {
                OrderManagerFunctions omFunc = new OrderManagerFunctions();
                omFunc.AutoDetectSoftwareProjectPath((int)_softwareID.Implant);
                implant_projectDirectory = Properties.OrderManagerProps.Default.implant_projectDirectory;
            }
            if (Directory.Exists(implant_projectDirectory) == false || File.Exists(implant_exePath) == false)
            {
                return;
            }

            //Implant外部清單
            Caselist_ImplantOuterCase = new List <ImplantOuterInformation>();

            DirectoryInfo dInfo = new DirectoryInfo(implant_projectDirectory);

            // C:\IntewareData\Implant\2020130102946\202001301037_final_mi\LinkStation\ManufacturingDir\(Guide生出來的物件)
            foreach (DirectoryInfo folder in dInfo.GetDirectories())
            {
                // 這層是C:\IntewareData\Implant\

                string XmlPath = folder.FullName + @"\" + folder.ToString() + ".xml";
                if (File.Exists(XmlPath) == false)
                {
                    continue;
                }
                else
                {
                    if (LoadXml((int)_softwareID.Implant, XmlPath) == false)
                    {
                        continue;
                    }
                }
            }

            Sorter.Sort_Implant(Caselist_ImplantOuterCase, 0, (Caselist_ImplantOuterCase.Count - 1), true);
            CaseShowEvent((int)_softwareID.Implant);
        }
        private void Click_systemButton(object sender, RoutedEventArgs e)
        {
            if (sender is Button)
            {
                OrderManagerFunctions omFunc = new OrderManagerFunctions();
                switch (((Button)sender).Name)
                {
                case "button_loadImp":
                {
                    omFunc.RunCommandLine(Properties.Settings.Default.implant_exePath, "\"readdii\" \"" + implantInfo.ImplantTiiPath + "\"");
                    break;
                }

                case "button_loadGuide":
                {
                    string gmlFile = implantInfo.GuideCaseDir + implantInfo.OrderName + "-Guide.gml";
                    string lmgFile = implantInfo.GuideCaseDir + implantInfo.OrderName + ".lmg";

                    if (File.Exists(gmlFile) == true)        //有gml就先讀
                    {
                        omFunc.RunCommandLine(Properties.Settings.Default.guide_exePath, "guiderpd \"" + gmlFile + "\"");
                    }
                    else if (File.Exists(lmgFile) == true)        //沒有gml再讀lmg
                    {
                        omFunc.RunCommandLine(Properties.Settings.Default.guide_exePath, "guide \"" + lmgFile + "\"");
                    }
                    break;
                }

                case "button_openDir":
                {
                    omFunc.RunCommandLine(Properties.OrderManagerProps.Default.systemDisk + @"Windows\explorer.exe", "\"" + System.IO.Path.GetDirectoryName(implantInfo.GuideModelPath) + @"\" + "\"");
                    break;
                }

                case "button_openPDF":
                {
                    omFunc.RunCommandLine("\"" + implantInfo.PDFpath + "\"", "");
                    break;
                }
                }
            }
        }
        /// <summary>
        /// 讀取OrthoAnalysis專案
        /// </summary>
        public void LoadOrthoProj()
        {
            string ortho_exePath          = Properties.Settings.Default.ortho_exePath;
            string ortho_projectDirectory = Properties.OrderManagerProps.Default.ortho_projectDirectory;

            if (Directory.Exists(ortho_projectDirectory) == false && File.Exists(ortho_exePath) != false)
            {
                OrderManagerFunctions omFunc = new OrderManagerFunctions();
                omFunc.AutoDetectSoftwareProjectPath((int)_softwareID.Ortho);
                ortho_projectDirectory = Properties.OrderManagerProps.Default.ortho_projectDirectory;
            }
            if (Directory.Exists(ortho_projectDirectory) == false || File.Exists(ortho_exePath) == false)
            {
                return;
            }

            //Ortho外部清單
            Caselist_OrthoOuterCase = new List <OrthoOuterInformation>();
            DirectoryInfo dInfo = new DirectoryInfo(ortho_projectDirectory);

            // C:\IntewareData\OrthoAnalysisV3\OrthoData\Test_1216\2019-12-16-1543\Test_1216.xml
            foreach (DirectoryInfo folder in dInfo.GetDirectories())
            {
                // 這層是C:\IntewareData\OrthoAnalysisV3\OrthoData\folder\
                string OuterXmlPath = folder.FullName + @"\PatientInfo.xml";
                if (File.Exists(OuterXmlPath) == false)
                {
                    continue;
                }
                else
                {
                    if (LoadXml((int)_softwareID.Ortho, OuterXmlPath) == false)
                    {
                        continue;
                    }
                }
            }
            Sorter.Sort_Ortho(Caselist_OrthoOuterCase, 0, (Caselist_OrthoOuterCase.Count - 1), true);
            CaseShowEvent((int)_softwareID.Ortho);
        }
Exemple #11
0
        private void MouseLeftButtonUp_checkVersion(object sender, RoutedEventArgs e)
        {
            string param = "-eng";

            if (Properties.Settings.Default.sysLanguage == "zh-TW")
            {
                param = "-zhTW";
            }

            latch = new CountdownEvent(1);
            Thread thread = new Thread(() =>
            {
                OrderManagerFunctions omFunc = new OrderManagerFunctions();
                omFunc.RunCommandLine("OrderManagerLauncher.exe", param);
                RefreshData(latch);
            });

            thread.Start();
            latch.Wait();
            Thread.Sleep(2000);
            Environment.Exit(0);
        }
        private void Click_systemButton(object sender, RoutedEventArgs e)
        {
            if (sender is Button)
            {
                switch (((Button)sender).Name)
                {
                case "button_loadProj":
                {
                    OrderManagerFunctions omFunc = new OrderManagerFunctions();
                    omFunc.RunCommandLine(Properties.Settings.Default.cad_exePath, "-openrpd \"" + CADInfo.CaseXmlPath + "\"");
                    break;
                }

                case "button_openDir":
                {
                    OrderManagerFunctions omFunc = new OrderManagerFunctions();
                    omFunc.RunCommandLine(Properties.OrderManagerProps.Default.systemDisk + @"Windows\explorer.exe", "\"" + CADInfo.CaseDirectoryPath + @"\" + "\"");
                    break;
                }
                }
            }
        }
        private void Click_ButtonEvent(object sender, RoutedEventArgs e)
        {
            if (sender is Button)
            {
                switch (((Button)sender).Name)
                {
                case "button_openImplant":
                {
                    OrderManagerFunctions omFunc = new OrderManagerFunctions();
                    omFunc.RunCommandLine(Properties.Settings.Default.implant_exePath, "\"readct\" \"" + Path.GetDirectoryName(implantInfo.XmlfilePath) + "\"");
                    break;
                }

                case "button_openDir":
                {
                    OrderManagerFunctions omFunc = new OrderManagerFunctions();
                    omFunc.RunCommandLine(Properties.OrderManagerProps.Default.systemDisk + @"Windows\explorer.exe", "\"" + Path.GetDirectoryName(implantInfo.CaseDirectoryPath) + "\"");
                    break;
                }
                }
            }
        }
Exemple #14
0
        private void Click_systemButton(object sender, RoutedEventArgs e)
        {
            if (sender is Button)
            {
                switch (((Button)sender).Name)
                {
                case "button_loadProj":
                {
                    OrderManagerFunctions omFunc = new OrderManagerFunctions();
                    omFunc.RunCommandLine(Properties.Settings.Default.ortho_exePath, "-rp \"-" + orthoInfo.SmallCaseXmlPath + "\"");
                    break;
                }

                case "button_openDir":
                {
                    OrderManagerFunctions omFunc = new OrderManagerFunctions();
                    omFunc.RunCommandLine(Properties.OrderManagerProps.Default.systemDisk + @"Windows\explorer.exe", "\"" + System.IO.Path.GetDirectoryName(orthoInfo.SmallCaseXmlPath) + @"\" + "\"");
                    break;
                }
                }
            }
        }
        private void Click_systemButton(object sender, RoutedEventArgs e)
        {
            if (sender is Button)
            {
                switch (((Button)sender).Name)
                {
                case "button_loadProj":
                {
                    if (TrayInfo != null && System.IO.File.Exists(TrayInfo.CaseXmlPath) == true)
                    {
                        OrderManagerFunctions omFunc = new OrderManagerFunctions();
                        omFunc.RunCommandLine(Properties.Settings.Default.tray_exePath, "-guiderpd \"" + TrayInfo.CaseXmlPath + "\"");
                    }
                    else if (SplintInfo != null && System.IO.File.Exists(SplintInfo.CaseXmlPath) == true)
                    {
                        OrderManagerFunctions omFunc = new OrderManagerFunctions();
                        omFunc.RunCommandLine(Properties.Settings.Default.splint_exePath, "-guiderpd \"" + SplintInfo.CaseXmlPath + "\"");
                    }
                    break;
                }

                case "button_openDir":
                {
                    if (TrayInfo != null && System.IO.Directory.Exists(TrayInfo.CaseDirectoryPath) == true)
                    {
                        OrderManagerFunctions omFunc = new OrderManagerFunctions();
                        omFunc.RunCommandLine(Properties.OrderManagerProps.Default.systemDisk + @"Windows\explorer.exe", "\"" + TrayInfo.CaseDirectoryPath + "\"");
                    }
                    else if (SplintInfo != null && System.IO.Directory.Exists(SplintInfo.CaseDirectoryPath) == true)
                    {
                        OrderManagerFunctions omFunc = new OrderManagerFunctions();
                        omFunc.RunCommandLine(Properties.OrderManagerProps.Default.systemDisk + @"Windows\explorer.exe", "\"" + SplintInfo.CaseDirectoryPath + "\"");
                    }
                    break;
                }
                }
            }
        }
Exemple #16
0
        void CompletedWork_DownloadSoftware(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                Handler_snackbarShow(TranslationSource.Instance["Download"] + TranslationSource.Instance["Error"]);
                SoftwareDownloadCancelEvent(readyInstallSoftwareInfo.softwareID);
            }
            else if (e.Cancelled)
            {
                Handler_snackbarShow(TranslationSource.Instance["Download"] + TranslationSource.Instance["Cancel"]);
                SoftwareDownloadCancelEvent(readyInstallSoftwareInfo.softwareID);
            }
            else
            {
                Handler_snackbarShow(TranslationSource.Instance["Order_DownloadCompleted"]);
                SoftwareLogoShowEvent(readyInstallSoftwareInfo.softwareID, (int)_softwareStatus.Installing, 0);
                string downloadPath = GetSoftwarePath(readyInstallSoftwareInfo.softwareID);

                string param = "/quiet APPDIR=\"" + downloadPath + "\"";
                OrderManagerFunctions omFunc = new OrderManagerFunctions();
                omFunc.RunCommandLine(downloadfilepath, param, true);
            }
        }
Exemple #17
0
        private void Click_ButtonEvent(object sender, RoutedEventArgs e)
        {
            OrderManagerFunctions omFunc = new OrderManagerFunctions();

            omFunc.RunCommandLine(Properties.Settings.Default.ortho_exePath, "-rp \"" + orthosmallcaseInfo.SmallCaseXmlPath + "\"");
        }
Exemple #18
0
        private void Click_systemButton(object sender, RoutedEventArgs e)
        {
            if (sender is Button)
            {
                switch (((Button)sender).Name)
                {
                case "sysBtn_Yes":
                {
                    if (File.Exists(textbox_EZCAD.Text) == true)
                    {
                        Properties.Settings.Default.cad_exePath = Path.GetFullPath(textbox_EZCAD.Text);
                    }
                    else
                    {
                        Properties.Settings.Default.cad_exePath = "";
                    }
                    if (File.Exists(textbox_Implant.Text) == true)
                    {
                        Properties.Settings.Default.implant_exePath = Path.GetFullPath(textbox_Implant.Text);
                    }
                    else
                    {
                        Properties.Settings.Default.implant_exePath = "";
                    }
                    if (File.Exists(textbox_Ortho.Text) == true)
                    {
                        Properties.Settings.Default.ortho_exePath = Path.GetFullPath(textbox_Ortho.Text);
                    }
                    else
                    {
                        Properties.Settings.Default.ortho_exePath = "";
                    }
                    if (File.Exists(textbox_Tray.Text) == true)
                    {
                        Properties.Settings.Default.tray_exePath = Path.GetFullPath(textbox_Tray.Text);
                    }
                    else
                    {
                        Properties.Settings.Default.tray_exePath = "";
                    }
                    if (File.Exists(textbox_Splint.Text) == true)
                    {
                        Properties.Settings.Default.splint_exePath = Path.GetFullPath(textbox_Splint.Text);
                    }
                    else
                    {
                        Properties.Settings.Default.splint_exePath = "";
                    }
                    if (File.Exists(textbox_Guide.Text) == true)
                    {
                        Properties.Settings.Default.guide_exePath = Path.GetFullPath(textbox_Guide.Text);
                    }
                    else
                    {
                        Properties.Settings.Default.guide_exePath = "";
                    }

                    if (Directory.Exists(textbox_Download.Text) == true)
                    {
                        Properties.Settings.Default.DownloadFolder = textbox_Download.Text;
                    }
                    else
                    {
                        Properties.Settings.Default.DownloadFolder = OriginalSet.DownloadFolder;
                    }

                    if (Directory.Exists(textbox_Log.Text) == true)
                    {
                        Properties.Settings.Default.Log_filePath = textbox_Log.Text;
                    }
                    else
                    {
                        Properties.Settings.Default.Log_filePath = OriginalSet.LogFolder;
                    }

                    //多國語系
                    ComboBoxItem typeItem = (ComboBoxItem)comboboxLanguage.SelectedItem;

                    if (typeItem.Content.ToString() == "繁體中文")
                    {
                        Properties.Settings.Default.sysLanguage = "zh-TW";
                    }
                    else
                    {
                        Properties.Settings.Default.sysLanguage = "en-US";
                    }

                    Properties.Settings.Default.Save();
                    this.DialogResult = true;
                    break;
                }

                case "sysBtn_Cancel":
                {
                    //還原
                    Properties.Settings.Default.cad_exePath     = OriginalSet.Cad_exePath;
                    Properties.Settings.Default.implant_exePath = OriginalSet.Implant_exePath;
                    Properties.Settings.Default.ortho_exePath   = OriginalSet.Ortho_exePath;
                    Properties.Settings.Default.tray_exePath    = OriginalSet.Tray_exePath;
                    Properties.Settings.Default.splint_exePath  = OriginalSet.Splint_exePath;
                    Properties.Settings.Default.guide_exePath   = OriginalSet.Guide_exePath;
                    Properties.Settings.Default.DownloadFolder  = OriginalSet.DownloadFolder;
                    Properties.Settings.Default.Log_filePath    = OriginalSet.LogFolder;

                    if (OriginalSet.Language == (int)_langSupport.zhTW)
                    {
                        LocalizationService.SetLanguage("zh-TW");
                    }
                    else
                    {
                        LocalizationService.SetLanguage("en-US");
                    }

                    this.DialogResult = false;
                    break;
                }

                case "sysBtn_AutoDetect":
                {
                    OrderManagerFunctions omFunc = new OrderManagerFunctions();
                    omFunc.AutoDetectEXE((int)_classFrom.Setting);

                    textbox_EZCAD.Text   = Properties.Settings.Default.cad_exePath;
                    textbox_Implant.Text = Properties.Settings.Default.implant_exePath;
                    textbox_Ortho.Text   = Properties.Settings.Default.ortho_exePath;
                    textbox_Tray.Text    = Properties.Settings.Default.tray_exePath;
                    textbox_Splint.Text  = Properties.Settings.Default.splint_exePath;
                    textbox_Guide.Text   = Properties.Settings.Default.guide_exePath;
                    break;
                }
                }
            }
        }
        private void MouseLeftButtonUp_ForgotPWD(object sender, MouseButtonEventArgs e)
        {
            OrderManagerFunctions omFunc = new OrderManagerFunctions();

            omFunc.RunCommandLine(Properties.HyperLink.Default.ForgetAirdentalPassword, "");
        }
        /// <summary>
        /// 設定UI所顯示的資訊
        /// </summary>
        public bool SetInformation()
        {
            if (currentSoftwareID == -1 || http_url == "")
            {
                return(false);
            }

            OrderManagerFunctions omFunc = new OrderManagerFunctions();

            string[] SoftwareNameArray = new string[6] {
                omFunc.GetSoftwareName(_softwareID.EZCAD),
                omFunc.GetSoftwareName(_softwareID.Implant), omFunc.GetSoftwareName(_softwareID.Ortho),
                omFunc.GetSoftwareName(_softwareID.Tray), omFunc.GetSoftwareName(_softwareID.Splint), omFunc.GetSoftwareName(_softwareID.Guide)
            };
            label_TitleBar.Content = TranslationSource.Instance["Install"] + "-" + SoftwareNameArray[currentSoftwareID];
            label_Header.Content   = TranslationSource.Instance["AboutToInstall"] + " " + SoftwareNameArray[currentSoftwareID];
            if (Properties.OrderManagerProps.Default.mostsoftwareDisk != "")
            {
                textbox_InstallPath.Text = Properties.OrderManagerProps.Default.mostsoftwareDisk + @"IntewareInc\" + SoftwareNameArray[currentSoftwareID].Replace(".", " ") + @"\";
            }
            else
            {
                textbox_InstallPath.Text = @"C:\IntewareInc\" + SoftwareNameArray[currentSoftwareID].Replace(".", " ") + @"\";
            }
            jlabel_RequireSpace.Content   += ":";
            jlabel_AvailableSpace.Content += ":";
            try
            {
                if (((HttpWebResponse)httpResponse).StatusDescription == "OK" && httpResponse.ContentLength > 1)
                {
                    // 取得下載的檔名
                    Uri    uri = new Uri(http_url);
                    string downloadfileRealName = Path.GetFileName(uri.LocalPath);
                    label_DownloadFileName.Content = "(" + downloadfileRealName + ")";

                    if (RemainingSpace(textbox_InstallPath.Text) == true)  //客戶電腦剩餘空間
                    {
                        label_RequireSpace.Tag     = Convert.ToUInt64(httpResponse.ContentLength);
                        label_RequireSpace.Content = ConvertDiskUnit(Convert.ToUInt64(httpResponse.ContentLength), (int)_diskUnit.MB);

                        if ((ulong)label_AvailableSpace.Tag < (ulong)label_RequireSpace.Tag)
                        {
                            label_AvailableSpace.Foreground = Brushes.Orange;
                            label_AvailableSpace.ToolTip    = TranslationSource.Instance["NoEnoughSpaceToInstall"];//磁碟空間不足以安裝軟體
                        }
                        else if ((ulong)label_AvailableSpace.Tag < (ulong)label_RequireSpace.Tag * 3)
                        {
                            label_AvailableSpace.Foreground = Brushes.Orange;
                            label_AvailableSpace.ToolTip    = TranslationSource.Instance["SpaceMaynotBeEnough"];//磁碟空間可能不足以安裝軟體
                        }
                        else
                        {
                            label_AvailableSpace.Foreground = Brushes.White;
                            label_AvailableSpace.ToolTip    = TranslationSource.Instance["SpaceAvailable"];
                        }
                    }
                    else
                    {
                        Inteware_Messagebox Msg = new Inteware_Messagebox();
                        Msg.ShowMessage(TranslationSource.Instance["CannnotGetRemainingSpace"]);
                        if (httpResponse != null)
                        {
                            httpResponse.Close();
                        }
                        return(false);
                    }
                }
            }
            catch (Exception ex)
            {
                Inteware_Messagebox Msg = new Inteware_Messagebox();
                Msg.ShowMessage(ex.Message, TranslationSource.Instance["NetworkError"]);    //網路連線異常or載點掛掉
                if (httpResponse != null)
                {
                    httpResponse.Close();
                }
                return(false);
            }
            if (httpResponse != null)
            {
                httpResponse.Close();
            }
            return(true);
        }
        private void Click_OpenDir(object sender, RoutedEventArgs e)
        {
            OrderManagerFunctions omFunc = new OrderManagerFunctions();

            omFunc.RunCommandLine(Properties.OrderManagerProps.Default.systemDisk + @"Windows\explorer.exe", "\"" + System.IO.Path.GetDirectoryName(orthoInfo.CaseDirectoryPath) + "\"");
        }