Esempio n. 1
0
 private void cmbFileList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.item != null)
     {
         this.file = this.item.FileList[this.cmbFileList.SelectedIndex] as DESecureFile;
     }
     if (this.AllMarkups.Contains(this.file.FileOid))
     {
         this.MarkupList = this.AllMarkups[this.file.FileOid] as ArrayList;
     }
     else
     {
         try
         {
             this.MarkupList = PLItem.Agent.GetMarkups(this.file.ItemMasterOid, this.file.FileOid, ClientData.LogonUser.Oid);
         }
         catch (Exception exception)
         {
             PrintException.Print(exception, "获取批注信息");
             this.FillProcess();
             return;
         }
         if ((this.MarkupList != null) && (this.MarkupList.Count != 0))
         {
             this.AllMarkups.Add(this.file.FileOid, this.MarkupList);
         }
         else
         {
             MessageBoxPLM.Show("文件未被批注过!");
             this.FillProcess();
             return;
         }
     }
     this.FillProcess();
 }
Esempio n. 2
0
 private bool InitFiles()
 {
     if (this.bizItem != null)
     {
         List <DESecureFile>   list  = new List <DESecureFile>();
         List <DESecureFile>   list2 = new List <DESecureFile>();
         List <DEBusinessItem> list3 = new List <DEBusinessItem>();
         List <DEBusinessItem> list4 = new List <DEBusinessItem>();
         Dictionary <DESecureFile, DEBusinessItem> dictionary = PLItem.Agent.GetVisualizationFiles(this.bizItem.Iteration.Oid, this.bizItem.Iteration.ClassName, ClientData.LogonUser.Oid, this.psOption);
         if ((dictionary == null) || (dictionary.Count == 0))
         {
             this.InitFileRelaData();
             return(true);
         }
         DESecureFile[] array = new DESecureFile[dictionary.Count];
         dictionary.Keys.CopyTo(array, 0);
         PLFileType type = new PLFileType();
         for (int i = 0; i < array.Length; i++)
         {
             DESecureFile item = array[i];
             if (item.FileType != Guid.Empty)
             {
                 DEFileType fileType = null;
                 if (this.dic_FileTypes.ContainsKey(item.FileType))
                 {
                     fileType = this.dic_FileTypes[item.FileType];
                 }
                 else
                 {
                     fileType = type.GetFileType(item.FileType);
                     this.dic_FileTypes[item.FileType] = fileType;
                 }
                 if (fileType != null)
                 {
                     if (fileType.CanThumbnail)
                     {
                         list2.Add(item);
                         list4.Add(PSConvert.ToBizItem(dictionary[item], this.psOption.CurView, ClientData.LogonUser.Oid));
                     }
                     if (fileType.CanVisualization)
                     {
                         list.Add(item);
                         list3.Add(PSConvert.ToBizItem(dictionary[item], this.psOption.CurView, ClientData.LogonUser.Oid));
                     }
                 }
             }
         }
         if (!this.CompareEqualsFiles(list, list2))
         {
             this.InitFileRelaData();
             this.thumbnailFiles     = list2;
             this.thumbnailItems     = list4;
             this.visualizationFiles = list;
             this.visualizationItems = list3;
             return(true);
         }
     }
     return(false);
 }
Esempio n. 3
0
 private void InitFileRelaData()
 {
     this.thumbnailFiles     = new List <DESecureFile>();
     this.thumbnailItems     = new List <DEBusinessItem>();
     this.visualizationFiles = new List <DESecureFile>();
     this.visualizationItems = new List <DEBusinessItem>();
     this.curIndex           = 0;
     this.curIbizItem        = null;
     this.curFile            = null;
 }
Esempio n. 4
0
        public static void ViewFile(Guid fileOid, string fileName, Guid fileTypeOid, bool deleteAllowed, IBizItem bizItem)
        {
            DESecureFile file = new DESecureFile {
                FileOid  = fileOid,
                FileName = Path.GetFileName(fileName),
                Location = Path.GetDirectoryName(fileName),
                FileType = fileTypeOid
            };

            ViewFile(file, fileName, (bizItem == null) ? string.Empty : bizItem.ClassName, null, deleteAllowed, bizItem);
        }
Esempio n. 5
0
        public static void ViewFile(Guid fileOid, string fileName, Guid fileTypeOid, bool deleteAllowed)
        {
            DESecureFile file = new DESecureFile {
                FileOid  = fileOid,
                FileName = Path.GetFileName(fileName),
                Location = Path.GetDirectoryName(fileName),
                FileType = fileTypeOid
            };

            ViewFile(file, fileName, null, null, deleteAllowed, null);
        }
Esempio n. 6
0
 public void SetStatusText(DESecureFile file)
 {
     if (file == null)
     {
         this.statusStrip1.Visible = false;
     }
     else
     {
         this.statusStrip1.Visible = file.ConvertRuleOid == Guid.Empty;
         this.tspStateVaild.Text   = file.IsConvertVaild ? "转换文件有效" : "转换文件无效";
     }
 }
Esempio n. 7
0
 private void tspBtnShowType_Click(object sender, EventArgs e)
 {
     try {
         this.tspBtnShowType.Checked = !this.tspBtnShowType.Checked;
         this.tspBtnShowType.Text    = this.tspBtnShowType.Checked ? "缩略图" : "可视化";
         this.curIndex    = 0;
         this.curIbizItem = null;
         this.curFile     = null;
         this.ShowFile();
     } catch (Exception exception) {
         PrintException.Print(exception);
     }
 }
Esempio n. 8
0
 public FrmViewAllMarkups(string fileName, Guid fileOid, string className, ArrayList MarkupList, bool isShowDialog, DESecureFile file, DEObjectAttachFile item)
 {
     this.InitializeComponent();
     this.fileOid      = fileOid;
     this.className    = className;
     this.fileName     = fileName;
     this.MarkupList   = MarkupList;
     this.isShowDialog = isShowDialog;
     this.file         = file;
     this.item         = item;
     this.AllMarkups.Add(fileOid, MarkupList);
     this.AllFileNames.Add(fileOid, fileName);
     this.Fill();
 }
Esempio n. 9
0
 private void GetShowFile()
 {
     this.curFile     = null;
     this.curIbizItem = null;
     if (this.tspBtnShowType.Checked)
     {
         if ((this.thumbnailFiles != null) && (this.thumbnailFiles.Count > this.curIndex))
         {
             this.curFile     = this.thumbnailFiles[this.curIndex];
             this.curIbizItem = this.thumbnailItems[this.curIndex];
         }
     }
     else if ((this.visualizationFiles != null) && (this.visualizationItems.Count > this.curIndex))
     {
         this.curFile     = this.visualizationFiles[this.curIndex];
         this.curIbizItem = this.visualizationItems[this.curIndex];
     }
     this.SetPageBtnsVisible();
 }
Esempio n. 10
0
        private void SetInput(IBizItem bizItem, DESecureFile file, bool isShowFileList, DELProcessInfoForCLT processArgs, string className)
        {
            if (bizItem != null)
            {
                this._bizItem = PSConvert.ToBizItem(bizItem, ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid);
            }
            else
            {
                this.pnlFileList.Visible = false;
                isShowFileList           = false;
            }
            this._processArgs = processArgs;
            this._className   = className;
            bool flag = isShowFileList ? (this._bizItem.FileCount > 1) : false;

            this.pnlFileList.Visible = flag || (this._processArgs != null);
            this.btnMarkup.Visible   = this._processArgs != null;
            if (!this.IsMarkUpMode)
            {
                this.splitContainerSmall.PanelVisibility = SplitPanelVisibility.Panel1;
                this.panelButtons.Visible = false;
                this.btnMarkup.Enabled    = true;
            }
            else
            {
                this.splitContainerSmall.PanelVisibility = SplitPanelVisibility.Both;
                this.panelButtons.Visible = true;
                this.btnMarkup.Enabled    = false;
            }
            ArrayList fileList = null;

            if (isShowFileList)
            {
                fileList = this._bizItem.FileList;
            }
            else
            {
                fileList = new ArrayList {
                    file
                };
            }
            this.combFiles.SelectedIndexChanged -= new EventHandler(this.combFiles_SelectedIndexChanged);
            this.combFiles.DataSource            = fileList;
            try
            {
                for (int i = 0; i < this.combFiles.Properties.Items.Count; i++)
                {
                    DESecureFile file2 = this.combFiles.Properties.Items[i] as DESecureFile;
                    if ((file2 != null) && (file2.FileOid == file.FileOid))
                    {
                        this.combFiles.SelectedIndex = i;
                        goto Label_01A1;
                    }
                }
            }
            finally
            {
                this.combFiles.SelectedIndexChanged += new EventHandler(this.combFiles_SelectedIndexChanged);
            }
Label_01A1:
            this.LastSelectedIndex = this.combFiles.SelectedIndex;
        }
Esempio n. 11
0
 private void DoShowMarkUp(DESecureFile info)
 {
     if (this.browser == null)
     {
         MessageBox.Show("没有合适的批注编辑器,无法批注!", "提示");
     }
     else
     {
         this.Mode    = 0;
         this.CurFile = info;
         this.lstSelfDefRemarks.Items.Clear();
         Hashtable userOption = ClientData.GetUserOption();
         for (int i = 1; userOption["Option_Remark_" + i.ToString()] != null; i++)
         {
             string item = (string)userOption["Option_Remark_" + i.ToString()];
             this.lstSelfDefRemarks.Items.Add(item);
         }
         this.txtRemark.Text       = "";
         this.markLocation         = ViewFileHelper.Instance.GetTempMarkupPath();
         this.panelButtons.Visible = true;
         this.splitContainerSmall.PanelVisibility = SplitPanelVisibility.Both;
         this.markFileName = null;
         if (Directory.Exists(this.markLocation))
         {
             if ((Directory.GetFiles(this.markLocation).Length > 0) && (MessageBox.Show("系统可能正在批注其他的文件,继续操作将使原批注文件丢失,是否继续操作?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.No))
             {
                 return;
             }
             ViewFileHelper.DeleteDirectory(this.markLocation);
             Thread.Sleep(100);
         }
         while (Directory.Exists(this.markLocation))
         {
         }
         Directory.CreateDirectory(this.markLocation);
         try
         {
             this.curMarkup = PLItem.Agent.GetMarkup(info.FileOid, this._processArgs.WorkItemOid, this._processArgs.GroupDataOid, ClientData.LogonUser.Oid);
             if ((this.curMarkup != null) && (this.Mode == 0))
             {
                 this.Mode = 2;
             }
             if ((this.Mode == 0) && (this.curMarkup == null))
             {
                 this.curMarkup               = new DEMarkup();
                 this.curMarkup.FileOid       = info.FileOid;
                 this.curMarkup.ProcessOid    = this._processArgs.ProcessInstanceOid;
                 this.curMarkup.WorkItemOid   = this._processArgs.WorkItemOid;
                 this.curMarkup.DataOid       = this._processArgs.GroupDataOid;
                 this.curMarkup.UserOid       = ClientData.LogonUser.Oid;
                 this.curMarkup.MarkupFileOid = Guid.Empty;
                 this.curMarkup.ClassName     = this._className;
             }
             if (this.curMarkup.MarkupFileOid != Guid.Empty)
             {
                 ArrayList files = PLFileService.Agent.GetFiles(this.curMarkup.MarkupFileOid);
                 if ((files != null) && (files.Count > 0))
                 {
                     this.markFileName = this.markLocation + @"\" + ViewFileHelper.Instance.GetFileName(this.curMarkup.MarkupFileOid);
                     FSClientUtil.DownloadFile("ClaRel_BROWSE", this.curMarkup.MarkupFileOid, this.markFileName);
                 }
             }
             this.ShowMarkup();
         }
         catch
         {
         }
     }
 }
Esempio n. 12
0
        private void combFiles_SelectedIndexChanged(object sender, EventArgs e)
        {
            DESecureFile  selectedItem;
            string        str;
            bool          flag;
            FileBrowseWay way;

            if (this.combFiles.SelectedItem != null)
            {
                if (this.IsMarkUpMode)
                {
                    MessageBox.Show("当前文件处于批注状态,请先保存批注或者退出批注状态再操作!", "提示");
                    this.combFiles.SelectedIndexChanged -= new EventHandler(this.combFiles_SelectedIndexChanged);
                    this.combFiles.SelectedIndex         = this.LastSelectedIndex;
                    this.combFiles.SelectedIndexChanged += new EventHandler(this.combFiles_SelectedIndexChanged);
                    return;
                }
                if (this._bizItem == null)
                {
                    return;
                }
                selectedItem           = this.combFiles.SelectedItem as DESecureFile;
                this.LastSelectedIndex = this.combFiles.SelectedIndex;
                if (this._bizItem.FileList.GetFileByFileOid(selectedItem.FileOid) == null)
                {
                    return;
                }
                if (Path.GetExtension(selectedItem.FileName).ToUpper() == ".GXT")
                {
                    switch (PLGrantPerm.Agent.CanDoObjectOperation(ClientData.LogonUser.Oid, this._bizItem.MasterOid, this._bizItem.ClassName, PLGrantPerm.ToPermString(PLMBOOperation.BODownload), this._bizItem.SecurityLevel, this._bizItem.Phase, this._bizItem.RevNum))
                    {
                    case 0:
                        MessageBoxPLM.Show("您没有下载该对象源文件的权限。", "编辑源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;

                    case 2:
                        MessageBoxPLM.Show("当前对象在流程中,您没有下载该对象源文件的权限。", "编辑源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
                DESecureFile relationFileForBrowse = ViewFileHelper.GetRelationFileForBrowse(this._bizItem.Iteration, selectedItem);
                if (relationFileForBrowse != null)
                {
                    selectedItem = relationFileForBrowse;
                }
                ArrayList files = PLFileService.Agent.GetFiles(selectedItem.FileOid);
                if ((files != null) && (files.Count > 0))
                {
                    DEFile file3 = files[0] as DEFile;
                    if (file3 != null)
                    {
                        int num2 = Convert.ToInt32((long)(file3.OriginalSize / 0x100000L));
                        if ((num2 > 50) && (MessageBoxPLM.Show("您当前要浏览的源文件为" + num2.ToString() + "M,浏览会花费较长时间,您确认要继续吗?", "浏览源文件", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.Cancel))
                        {
                            return;
                        }
                    }
                }
                str = string.Empty;
                string path = string.Empty;
                flag = false;
                if (FileEvent.fileOperEvent != null)
                {
                    FileEvent.fileOperEvent(OperEventType.Before, "ClaRel_BROWSE", selectedItem.FileOid);
                }
                bool editable = this._bizItem.CanEdit(ClientData.LogonUser.Oid);
                if (!selectedItem.InLocalHost)
                {
                    try
                    {
                        str = ViewFileHelper.DownloadFileByDir(this._bizItem.Iteration, selectedItem, null, ClientData.UserGlobalOption, false, true, "ClaRel_BROWSE");
                    }
                    catch (Exception exception4)
                    {
                        if (editable)
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception4.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        else
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception4.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        return;
                    }
                    switch (str)
                    {
                    case null:
                    case "":
                        return;
                    }
                    if (!File.Exists(str))
                    {
                        MessageBoxPLM.Show("指定的文件索引不存在,可能是文件没有正确上载。", "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    flag = true;
                    goto Label_04DE;
                }
                if (selectedItem.InCurrentHost)
                {
                    path = selectedItem.Location;
                    str  = selectedItem.Location + @"\" + selectedItem.FileName;
                    if (!File.Exists(str))
                    {
                        if (DialogResult.Yes == MessageBoxPLM.Show("在指定路径下没有找到该文件,无法浏览!可能是文件路径发生变化,或已被删除。是否尝试从服务器获取文件?", "浏览源文件", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                        {
                            try
                            {
                                ViewFileHelper.DownLoadFile(this._bizItem.Iteration, selectedItem, path, ClientData.UserGlobalOption, editable, "ClaRel_BROWSE", this._bizItem);
                                goto Label_04DE;
                            }
                            catch (Exception exception)
                            {
                                if (editable)
                                {
                                    MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                }
                                else
                                {
                                    MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                }
                            }
                        }
                        return;
                    }
                    try
                    {
                        if (ClientData.LogonUser.Oid != selectedItem.UserOid)
                        {
                            str = ViewFileHelper.DownLoadFile(this._bizItem.Iteration, selectedItem, null, ClientData.UserGlobalOption, true, "ClaRel_BROWSE", this._bizItem);
                        }
                        if (!File.Exists(str))
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:源文件未上载", "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            return;
                        }
                        goto Label_04DE;
                    }
                    catch (Exception exception2)
                    {
                        if (editable)
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception2.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        else
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception2.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        return;
                    }
                }
                if (DialogResult.Yes == MessageBoxPLM.Show("文件存在于他人机器上。是否尝试从服务器获取文件?", "浏览源文件", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                {
                    try
                    {
                        str = ViewFileHelper.DownLoadFile(this._bizItem.Iteration, selectedItem, null, ClientData.UserGlobalOption, editable, "ClaRel_BROWSE", this._bizItem);
                        if (str == null)
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:文件未上载", "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            return;
                        }
                        goto Label_04DE;
                    }
                    catch (Exception exception3)
                    {
                        if (editable)
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception3.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        else
                        {
                            MessageBoxPLM.Show("无法从文件服务器获取源文件,原因是:" + exception3.Message, "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        return;
                    }
                }
            }
            return;

Label_04DE:
            way = FileBrowseWay.InnerBrowser;
            string             title = "文件浏览";
            BrowserDisplayRule rule  = null;

            if (Path.GetExtension(str).ToUpper() == ".GXT")
            {
                rule = new BrowserDisplayRule {
                    IsEdit      = IsEditGxt,
                    OnlyBrowser = IsOnlyBrowser
                };
                if (IsEditGxt)
                {
                    title = "文件编辑";
                }
                rule.Item     = this._bizItem;
                IsEditGxt     = false;
                IsOnlyBrowser = false;
            }
            DEBrowser browser = null;

            try
            {
                way = UIBrowser.GetBrowser(selectedItem.FileOid, str, selectedItem.FileType, out browser);
            }
            catch (Exception exception5)
            {
                PrintException.Print(exception5, title);
                return;
            }
            if (way == FileBrowseWay.InnerBrowser)
            {
                string deleteFilePath = null;
                if (flag)
                {
                    deleteFilePath = Path.GetDirectoryName(str);
                }
                UIBrowser.OpenFileWithBrowser(selectedItem.FileOid, str, this.panelBrowser, way, browser, deleteFilePath, rule, this._bizItem);
            }
            else
            {
                UIBrowser.OpenFileWithBrowser(selectedItem.FileOid, str, null, way, browser, Path.GetDirectoryName(str), this._bizItem);
            }
        }
Esempio n. 13
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("必须定义打开文件的内部浏览器,否则不能批注");
         }
     }
 }
Esempio n. 14
0
        public static void ViewAllMarkups(string fileName, Guid fileOid, string className, bool isShowDialog, DESecureFile file, DEObjectAttachFile item)
        {
            ArrayList markupList = new ArrayList();

            try
            {
                markupList = PLItem.Agent.GetMarkups(file.ItemMasterOid, fileOid, ClientData.LogonUser.Oid);
            }
            catch (Exception exception)
            {
                PrintException.Print(exception, "获取批注信息");
                return;
            }
            if ((markupList != null) && (markupList.Count != 0))
            {
                new FrmViewAllMarkups(fileName, fileOid, className, markupList, isShowDialog, file, item).ShowDialog();
            }
            else
            {
                MessageBoxPLM.Show("文件未被批注过!");
            }
        }
Esempio n. 15
0
 public static void ViewFile(DESecureFile file, string fileName, string className, DELProcessInfoForCLT processArgs, bool deleteAllowed, IBizItem bizItem)
 {
     ViewFile(file, fileName, className, processArgs, deleteAllowed, bizItem, null, false);
 }
Esempio n. 16
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. 17
0
        public static void ViewFile(DESecureFile file, string fileName, string className, DELProcessInfoForCLT processArgs, bool deleteAllowed, IBizItem bizItem, DEBrowser browser, bool isShowFileList)
        {
            CurViewFilePath = fileName;
            if (bizItem != null)
            {
                switch (PLGrantPerm.Agent.CanDoObjectOperation(ClientData.LogonUser.Oid, bizItem.MasterOid, bizItem.ClassName, PLGrantPerm.ToPermString(PLMBOOperation.BOView), bizItem.SecurityLevel, bizItem.Phase, bizItem.RevNum))
                {
                case 0:
                    MessageBoxPLM.Show("您没有浏览该对象源文件的权限。", "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;

                case 2:
                    MessageBoxPLM.Show("当前对象在流程中,您没有浏览该对象源文件的权限。", "浏览源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                if (Path.GetExtension(fileName).ToUpper() == ".GXT")
                {
                    switch (PLGrantPerm.Agent.CanDoObjectOperation(ClientData.LogonUser.Oid, bizItem.MasterOid, bizItem.ClassName, PLGrantPerm.ToPermString(PLMBOOperation.BODownload), bizItem.SecurityLevel, bizItem.Phase, bizItem.RevNum))
                    {
                    case 0:
                        MessageBoxPLM.Show("您没有下载该对象源文件的权限。", "编辑源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;

                    case 2:
                        MessageBoxPLM.Show("当前对象在流程中,您没有下载该对象源文件的权限。", "编辑源文件", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
            }
            FileBrowseWay      innerBrowser = FileBrowseWay.InnerBrowser;
            string             title        = "文件浏览";
            BrowserDisplayRule rule         = null;

            if (Path.GetExtension(fileName).ToUpper() == ".GXT")
            {
                rule = new BrowserDisplayRule {
                    IsEdit      = IsEditGxt,
                    OnlyBrowser = IsOnlyBrowser
                };
                if (IsEditGxt)
                {
                    title = "文件编辑";
                }
                rule.Item     = bizItem as DEBusinessItem;
                IsEditGxt     = false;
                IsOnlyBrowser = false;
            }
            try
            {
                if (browser == null)
                {
                    innerBrowser = UIBrowser.GetBrowser(file.FileOid, fileName, file.FileType, out browser);
                }
                else
                {
                    innerBrowser = browser.IsInnerBrowser ? FileBrowseWay.InnerBrowser : FileBrowseWay.OpenProcess;
                }
            }
            catch (Exception exception)
            {
                PrintException.Print(exception, title);
                return;
            }
            if (innerBrowser == FileBrowseWay.InnerBrowser)
            {
                FrmViewFile file2 = null;
                Form        form  = FormManager.GetForm(PLMFormType.ViewFile, file.FileOid);
                if ((form != null) && (form is FrmViewFile))
                {
                    file2 = (FrmViewFile)form;
                    if (bizItem != null)
                    {
                        file2.Text = bizItem.Id + "[" + ModelContext.MetaModel.GetClassLabel(bizItem.ClassName) + "] - " + title;
                        file2.SetStatusText(GetSecureFile(bizItem, file.FileOid));
                    }
                    else
                    {
                        file2.Text = Path.GetFileName(fileName) + " - " + title;
                    }
                }
                else
                {
                    try
                    {
                        file2 = new FrmViewFile();
                        if (bizItem != null)
                        {
                            file2.Text = bizItem.Id + "[" + ModelContext.MetaModel.GetClassLabel(bizItem.ClassName) + "] - " + title;
                            file2.SetStatusText(GetSecureFile(bizItem, file.FileOid));
                        }
                        else
                        {
                            file2.Text = Path.GetFileName(fileName) + " - " + title;
                        }
                    }
                    catch (Exception exception2)
                    {
                        PrintException.Print(exception2, MessageBoxIcon.Exclamation);
                        return;
                    }
                    file2.SetManaged(PLMFormType.ViewFile, file.FileOid);
                }
                file2.SetInput(bizItem, file, isShowFileList, processArgs, className);
                file2.Show();
                file2.Activate();
                string deleteFilePath = null;
                if (deleteAllowed)
                {
                    deleteFilePath = Path.GetDirectoryName(fileName);
                }
                UIBrowser.OpenFileWithBrowser(file.FileOid, fileName, file2.panelBrowser, innerBrowser, browser, deleteFilePath, rule, bizItem);
            }
            else
            {
                UIBrowser.OpenFileWithBrowser(file.FileOid, fileName, null, innerBrowser, browser, Path.GetDirectoryName(fileName), bizItem);
            }
        }
Esempio n. 18
0
 public ThumShowEventArgs(IBizItem bizItem, DESecureFile file)
 {
     this.bizItem = bizItem;
     this.file    = file;
 }