private void ExamList_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex < 0) { return; } if (e.ColumnIndex == this.colFilePath.Index) { ExamResult examResult = this.ExamList.Rows[e.RowIndex].Cells[this.colFilePath.Index].Tag as ExamResult; if (examResult == null) { return; } if (string.IsNullOrEmpty(examResult.FILE_PATH)) { return; } string dstFilePath = string.Format("{0}\\{1}\\{2}\\{3}\\{4}.pdf" , SystemParam.Instance.WorkPath , "temp" , SystemParam.Instance.PatVisitInfo.PATIENT_ID , SystemParam.Instance.PatVisitInfo.VISIT_ID , examResult.EXAM_ID); if (!File.Exists(dstFilePath)) { bool result = ShareFolderRead.Download(examResult.FILE_PATH, dstFilePath); if (!result) { MessageBoxEx.ShowError("报告下载失败"); return; } } CommandHandler.Instance.SendCommand("报告查看", this.MainForm, dstFilePath); } }
private void button15_Click(object sender, EventArgs e) { try { //ShareFolderRead.Download(@"\\129.88.47.11\ris\report\PDF\FSK\2017-08-30\9337401.pdf", @"D:\download\9337401.pdf", "129.88.47.11", "ris", "maroland"); //bool status = false; ////连接共享文件夹 //status = ShareFolderRead.connectState(@"\\DESKTOP-L0DIMB0\share", "*****@*****.**", "yehui198971"); //if (status) //{ // //共享文件夹的目录 // DirectoryInfo theFolder = new DirectoryInfo(@"\\DESKTOP-L0DIMB0\share"); // //相对共享文件夹的路径 // string fielpath = @"\test"; // //获取保存文件的路径 // string filename = theFolder.ToString() + fielpath; // //执行方法 // ShareFolderRead.Transport(filename + @"\11.txt", @"D:\download\", "11.txt"); //} //else //{ // //ListBox1.Items.Add("未能连接!"); //} bool status = false; //连接共享文件夹 status = ShareFolderRead.connectState(@"\\129.88.47.11", "ris", "maroland"); if (status) { //共享文件夹的目录 DirectoryInfo theFolder = new DirectoryInfo(@"\\129.88.47.11\ris"); //相对共享文件夹的路径 string fielpath = @"\report\PDF\FSK\2017-08-30\"; //获取保存文件的路径 string filename = theFolder.ToString() + fielpath; //执行方法 ShareFolderRead.Transport(filename + @"\9337401.pdf", @"D:\download\", "9337401.pdf"); } else { //ListBox1.Items.Add("未能连接!"); } } catch (Exception ex) { } }
private void btnPrintPacs_Click(object sender, EventArgs e) { if (this.ExamList.Rows.Count <= 0) { MessageBoxEx.ShowMessage("没有要打印的报告"); return; } List <string> lstFileList = new List <string>(); List <string> lstExamID = new List <string>(); string szMergeFileName = string.Empty; WorkProcess.Instance.Initialize(this, this.ExamList.Rows.Count, "正在下载检查报告...."); foreach (DataGridViewRow item in this.ExamList.Rows) { if (WorkProcess.Instance.Canceled) { WorkProcess.Instance.Close(); return; } WorkProcess.Instance.Show(item.Index + 1); if (item.Cells[this.colResultStatus.Index].Value.ToString() != "确认报告") { continue; } if (item.Cells[this.colCheckBox.Index].Value != null && item.Cells[this.colCheckBox.Index].Value.ToString().ToLower() == "true" ) { ExamResult examResult = item.Cells[this.colFilePath.Index].Tag as ExamResult; if (examResult != null && !string.IsNullOrEmpty(examResult.FILE_PATH)) { //下载文件 string dstFilePath = string.Format("{0}\\{1}\\{2}\\{3}\\{4}.pdf" , SystemParam.Instance.WorkPath , "temp" , SystemParam.Instance.PatVisitInfo.PATIENT_ID , SystemParam.Instance.PatVisitInfo.VISIT_ID , examResult.EXAM_ID); if (!File.Exists(dstFilePath)) { bool result = ShareFolderRead.Download(examResult.FILE_PATH, dstFilePath); if (!result) { MessageBoxEx.ShowError("报告下载失败"); WorkProcess.Instance.Close(); return; } } lstFileList.Add(examResult.FILE_PATH); lstExamID.Add(examResult.EXAM_ID); } } } WorkProcess.Instance.Close(); if (lstFileList.Count <= 0) { MessageBoxEx.ShowMessage("没有要打印的报告"); return; } szMergeFileName = string.Format("{0}\\temp\\{1}\\{2}\\{3}.pdf" , SystemParam.Instance.WorkPath , SystemParam.Instance.PatVisitInfo.PATIENT_ID , SystemParam.Instance.PatVisitInfo.VISIT_ID , string.Join("_", lstExamID.ToArray())); if (!File.Exists(szMergeFileName)) { bool result = PdfHelper.MergePDFFiles(lstFileList.ToArray(), szMergeFileName); if (!result) { MessageBoxEx.ShowError("报告合并打印失败"); return; } } CommandHandler.Instance.SendCommand("报告查看", this.MainForm, szMergeFileName); }