private void StoreImg_Load(object sender, EventArgs e) { imgBrow1.LoadFile(ArchId, FileName); imgBrow1.LoadConten(ArchId); GetUser(); GetArchInfo(); }
private void LoadFile() { butLoad.Enabled = false; try { if (Archid2 <= 0) { MessageBox.Show("ID获取失败请重新选择案卷!"); return; } int ArchState = Common.GetArchCheckState(Archid2); if (ArchState != 1) { MessageBox.Show("此卷档案未质检无法进行查阅!"); return; } string FileName = FileNameTmp2; string localPath = Path.Combine(Common.LocalTempPath, FileName.Substring(0, 8)); string localCheckFile = Path.Combine(Common.LocalTempPath, FileName.Substring(0, 8), FileName); try { if (!Directory.Exists(localPath)) { Directory.CreateDirectory(localPath); } if (File.Exists(localCheckFile)) { File.Delete(localCheckFile); } } catch { } string filjpg = Path.Combine(Common.ArchSavePah, FileName.Substring(0, 8), FileName); if (ftp.FtpCheckFile(filjpg)) { if (ftp.DownLoadFile(Common.ArchSavePah, FileName.Substring(0, 8), localCheckFile, FileName)) { imgBrow1.LoadFile(Archid2, localCheckFile); return; } } MessageBox.Show("警告,文件不存在!"); return; } catch (Exception ee) { MessageBox.Show(ee.ToString()); } finally { butLoad.Enabled = true; imgBrow1.Focus(); } }
private void LoadFile() { try { butOk.Enabled = false; if (ClsQuery.ArchID <= 0) { MessageBox.Show("ID获取失败请重新选择案卷!"); return; } if (ClsQuery.FileNameTmp.Trim().Length <= 0) { MessageBox.Show("文件名称获取失败!"); return; } int ArchState = Common.GetArchWorkState(ClsQuery.ArchID); if (ArchState < 5) { MessageBox.Show("此卷档案未排序或未质检无法进行查阅!"); return; } string FileName = ClsQuery.FileNameTmp; string localPath = Path.Combine(Common.LocalTempPath, FileName.Substring(0, 8)); string localCheckFile = Path.Combine(Common.LocalTempPath, FileName.Substring(0, 8), FileName); try { if (!Directory.Exists(localPath)) { Directory.CreateDirectory(localPath); } if (File.Exists(localCheckFile)) { File.Delete(localCheckFile); } } catch { } string filjpg = Path.Combine(Common.ArchSavePah, FileName.Substring(0, 8), FileName); if (ArchState == 5) { if (ftp.FtpCheckFile(filjpg)) { if (ftp.DownLoadFile(Common.ArchIndexPath, FileName.Substring(0, 8), localCheckFile, FileName)) { ImgBrow.Print = ClsQuery.Imgsys; imgBrow1.LoadFile(ClsQuery.ArchID, localCheckFile); imgBrow1.LoadConten(ClsQuery.ArchID); return; } } } else if (ArchState >= 7) { if (ftp.FtpCheckFile(filjpg)) { if (ftp.DownLoadFile(Common.ArchSavePah, FileName.Substring(0, 8), localCheckFile, FileName)) { ImgBrow.Print = ClsQuery.Imgsys; imgBrow1.LoadFile(ClsQuery.ArchID, localCheckFile); imgBrow1.LoadConten(ClsQuery.ArchID); return; } } } MessageBox.Show("警告,文件不存在!"); return; } catch (Exception ee) { MessageBox.Show(ee.ToString()); } finally { butOk.Enabled = true; } }
private void FrmImgshow_Load(object sender, EventArgs e) { imgBrow1.LoadFile(Arhcid, Filename); }