示例#1
0
 private void StoreImg_Load(object sender, EventArgs e)
 {
     imgBrow1.LoadFile(ArchId, FileName);
     imgBrow1.LoadConten(ArchId);
     GetUser();
     GetArchInfo();
 }
示例#2
0
 private void LvBoxsnQu_Click(object sender, EventArgs e)
 {
     if (LvBoxsnQu.Items.Count <= 0)
     {
         return;
     }
     if (LvBoxsnQu.SelectedItems.Count <= 0)
     {
         return;
     }
     ArchID      = Convert.ToInt32(LvBoxsnQu.SelectedItems[0].SubItems[3].Text);
     FileNameTmp = LvBoxsnQu.SelectedItems[0].SubItems[4].Text;
     imgBrow1.LoadConten(ArchID);
     ucDLInfo1.LoadInfo2(ArchID, 0);
     cleFile();
 }
示例#3
0
文件: FrmQuery.cs 项目: Ghcsm/Wh_Fzg
        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;
            }
        }