Example #1
0
        private ArrayList FindWorkItems(Guid processOid)
        {
            BPMProcessor processor = new BPMProcessor();
            ArrayList    list      = new ArrayList();
            ArrayList    list2     = new ArrayList();

            foreach (DEMarkup markup in this.MarkupList)
            {
                if ((processOid == markup.ProcessOid) && !list2.Contains(markup.WorkItemOid))
                {
                    DELWorkItem theWorkItem = new DELWorkItem();
                    try
                    {
                        processor.GetWorkItemByOid(markup.WorkItemOid, out theWorkItem);
                        list.Add(theWorkItem);
                        list2.Add(markup.WorkItemOid);
                    }
                    catch (Exception exception)
                    {
                        PrintException.Print(exception);
                    }
                }
            }
            return(list);
        }
Example #2
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("必须定义打开文件的内部浏览器,否则不能批注");
         }
     }
 }