Esempio n. 1
0
        public static void EditMarkUp(string fileName, Guid fileOid, Guid processOid, Guid workItemOid, Guid dataOid, Guid userOid, string className, IInnerBrowser browser, Guid itemOid, int itemIteration)
        {
            FrmMarkupByBrowser browser2 = new FrmMarkupByBrowser {
                Mode          = 2,
                FileOid       = fileOid,
                processOid    = processOid,
                workItemOid   = workItemOid,
                dataOid       = dataOid,
                UserOid       = userOid,
                ClassName     = className,
                FileName      = fileName,
                browser       = browser,
                ItemOid       = itemOid,
                ItemIteration = itemIteration
            };

            if (ClientData.OptRmarkEditStyle == 0)
            {
                browser2.MdiParent = ClientData.mainForm;
            }
            else
            {
                browser2.ShowInTaskbar = true;
                browser2.WindowState   = FormWindowState.Maximized;
            }
            browser2.Show();
        }
Esempio n. 2
0
        private void btnMarkup_Click(object sender, EventArgs e)
        {
            try
            {
                DESecureFile selectedItem = this.combFiles.SelectedItem as DESecureFile;
                for (int i = 0; i < this.panelBrowser.Controls.Count; i++)
                {
                    Control control = this.panelBrowser.Controls[i];
                    try
                    {
                        this.browser = (IInnerBrowser)control;
                    }
                    catch
                    {
                        this.browser = null;
                    }
                    if (this.browser != null)
                    {
                        this.DoShowMarkUp(selectedItem);
                        this.IsMarkUpMode      = true;
                        this.btnMarkup.Enabled = false;
                        goto Label_0085;
                    }
                }
            }
            catch (Exception exception)
            {
                PrintException.Print(exception);
            }
Label_0085:
            try
            {
                if (this.combFiles.SelectedIndex != -1)
                {
                    FileBrowseWay way;
                    DEBrowser     browser = null;
                    DESecureFile  info    = this.combFiles.SelectedItem as DESecureFile;
                    try
                    {
                        way = UIBrowser.GetMarkupTool(info.FileOid, info.FileName, info.FileType, out browser);
                    }
                    catch (Exception exception2)
                    {
                        PrintException.Print(exception2, "业务对象管理");
                        return;
                    }
                    if (way == FileBrowseWay.InnerBrowser)
                    {
                        if (browser != null)
                        {
                            IInnerBrowser browser2 = null;
                            try
                            {
                                browser2 = BrowserPool.BrowserManager.GetBrowser(browser, null);
                            }
                            catch (Exception exception3)
                            {
                                MessageBoxPLM.Show(exception3.Message);
                                return;
                            }
                            if (browser2 != null)
                            {
                                this.DoShowMarkUp(info);
                                this.IsMarkUpMode      = true;
                                this.btnMarkup.Enabled = false;
                            }
                        }
                        else
                        {
                            MessageBoxPLM.Show("没有获取到有效的浏览器,无法批注。", "文件批注", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                    }
                    else
                    {
                        MessageBoxPLM.Show("批注文件必须通过内部浏览器完成。", "文件批注", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
            }
            catch (Exception exception4)
            {
                PrintException.Print(exception4);
            }
        }
Esempio n. 3
0
        public static void ViewMarkUp(string fileName, Guid fileOid, Guid processOid, Guid workItemOid, Guid dataOid, Guid userOid, string className, bool isShowDialog, IInnerBrowser browser)
        {
            FrmMarkupByBrowser browser2 = new FrmMarkupByBrowser {
                Mode        = 1,
                FileOid     = fileOid,
                processOid  = processOid,
                workItemOid = workItemOid,
                dataOid     = dataOid,
                UserOid     = userOid,
                ClassName   = className,
                FileName    = fileName,
                browser     = browser
            };

            if (isShowDialog)
            {
                browser2.ShowDialog();
            }
            else
            {
                browser2.MdiParent = ClientData.mainForm;
                browser2.Show();
            }
        }
Esempio n. 4
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if ((this.lvwProcess.SelectedIndices.Count != 1) || (this.lvwWorkItem.SelectedIndices.Count != 1))
     {
         if (this.lvwProcess.SelectedIndices.Count == 0)
         {
             MessageBoxPLM.Show("请选择一个流程!");
         }
         else if (this.lvwWorkItem.SelectedIndices.Count == 0)
         {
             MessageBoxPLM.Show("请选择一个步骤!");
         }
         base.DialogResult = DialogResult.None;
     }
     else
     {
         FileBrowseWay way;
         base.DialogResult = DialogResult.OK;
         DELProcessInsProperty tag  = (DELProcessInsProperty)this.lvwProcess.SelectedItems[0].Tag;
         DELWorkItem           item = (DELWorkItem)((object[])this.lvwWorkItem.SelectedItems[0].Tag)[0];
         DEMarkup markup            = (DEMarkup)((object[])this.lvwWorkItem.SelectedItems[0].Tag)[1];
         base.Close();
         if (markup.FileOid != this.file.FileOid)
         {
             DESecureFile fileByFileOid = PLItem.Agent.GetBizItemByIteration(markup.ItemOid, this.className, Guid.Empty, ClientData.LogonUser.Oid, BizItemMode.SmartBizItem).FileList.GetFileByFileOid(markup.FileOid);
             if (fileByFileOid != null)
             {
                 this.file = fileByFileOid;
             }
             else
             {
                 this.file.FileOid = markup.FileOid;
             }
         }
         if (this.AllFileNames.Contains(this.file.FileOid))
         {
             this.fileName = this.AllFileNames[this.file.FileOid] as string;
         }
         else
         {
             this.fileName      = FSClientUtil.DownloadFile(this.file.FileOid, "ClaRel_DOWNLOAD");
             this.file.FileType = UIFileType.GetFileType(this.fileName);
             this.file.FileName = this.fileName;
             this.AllFileNames.Add(this.file.FileOid, this.fileName);
         }
         DEBrowser browser = null;
         try
         {
             way = UIBrowser.GetMarkupTool(this.file.FileOid, this.file.FileName, this.file.FileType, out browser);
         }
         catch (Exception exception)
         {
             PrintException.Print(exception, "浏览文件批注");
             return;
         }
         if (way == FileBrowseWay.InnerBrowser)
         {
             if (browser != null)
             {
                 IInnerBrowser browser2 = null;
                 try
                 {
                     browser2 = BrowserPool.BrowserManager.GetBrowser(browser, null);
                 }
                 catch (Exception exception2)
                 {
                     MessageBoxPLM.Show(exception2.Message);
                     return;
                 }
                 if (browser2 != null)
                 {
                     if (this.AllFileNames.Contains(this.file.FileOid))
                     {
                         this.fileName = this.AllFileNames[this.file.FileOid] as string;
                     }
                     else
                     {
                         this.fileName = FSClientUtil.DownloadFile(this.file.FileOid, "ClaRel_DOWNLOAD");
                         this.AllFileNames.Add(this.file.FileOid, this.fileName);
                     }
                     FrmMarkupByBrowser.ViewMarkUp(this.fileName, this.file.FileOid, tag.ID, item.ID, Guid.Empty, item.ActorID, this.className, this.isShowDialog, browser2);
                 }
             }
         }
         else
         {
             MessageBoxPLM.Show("必须定义打开文件的内部浏览器,否则不能批注");
         }
     }
 }