예제 #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);
        }
예제 #2
0
 private void lvw_ItemDrag(object sender, ItemDragEventArgs e)
 {
     if (this.lvw.SelectedItems.Count >= 1)
     {
         CLCopyData data = new CLCopyData();
         foreach (ListViewItem item in this.lvw.SelectedItems)
         {
             DataRowView tag = (DataRowView)item.Tag;
             try
             {
                 DEBusinessItem item2 = PLItem.Agent.GetBizItemByMaster(new Guid((byte[])tag[0]), 0, ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid, BizItemMode.BizItem) as DEBusinessItem;
                 if (item2 != null)
                 {
                     data.Add(item2);
                 }
             }
             catch (PLMException exception)
             {
                 PrintException.Print(exception);
                 return;
             }
             catch (Exception exception2)
             {
                 MessageBoxPLM.Show("拖动资源数据出错:" + exception2.Message, "工程资源");
                 return;
             }
         }
         this.lvw.DoDragDrop(data, DragDropEffects.Link | DragDropEffects.Move | DragDropEffects.Copy);
     }
 }
예제 #3
0
 private void tvwOrg_AfterSelect(object sender, TreeViewEventArgs e)
 {
     if ((e.Node.Tag != null) && (e.Node.Tag is DEOrganization))
     {
         this.lvwUser.Items.Clear();
         ArrayList members = null;
         try {
             members = new PLOrganization().GetMembers(((DEOrganization)e.Node.Tag).Oid);
         } catch (Exception exception) {
             PrintException.Print(exception);
             return;
         }
         if (members != null)
         {
             foreach (DEUser user in members)
             {
                 ListViewItem item = this.lvwUser.Items.Add(user.LogId, ClientData.MyImageList.GetIconIndex("ICO_RSP_USER"));
                 item.SubItems.Add(user.Name);
                 item.Tag = user;
             }
         }
         OrgModelUL.ChangeFrozenIco(this.lvwUser);
         if (this.UsersLoadCompleted != null)
         {
             this.UsersLoadCompleted();
         }
     }
 }
예제 #4
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();
 }
예제 #5
0
 private void OnDelete(object sender, EventArgs e)
 {
     if ((((this.lvwAddin.SelectedItems.Count != 0) && (this.lvwAddin.SelectedItems[0].Tag != null)) && (this.lvwAddin.SelectedItems[0].Tag is DEAddinReg)) && (MessageBox.Show("您确认要删除插件吗?", "插件管理", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.Cancel))
     {
         ArrayList list = new ArrayList();
         for (int i = 0; i < this.lvwAddin.SelectedItems.Count; i++)
         {
             list.Add(this.lvwAddin.SelectedItems[i]);
         }
         for (int j = 0; j < list.Count; j++)
         {
             ListViewItem item = list[j] as ListViewItem;
             try
             {
                 if (item.Tag is DEAddinReg)
                 {
                     AddinRegistration.Instance.DeleteAddin(((DEAddinReg)item.Tag).Oid);
                     this.lvwAddin.Items.Remove(item);
                 }
             }
             catch (Exception exception)
             {
                 PrintException.Print(exception, "插件管理");
                 break;
             }
         }
     }
 }
예제 #6
0
        private void FilterData()
        {
            int           num3     = 0;
            StringBuilder builder  = new StringBuilder();
            StringBuilder builder2 = new StringBuilder();

            if (this.myView != null)
            {
                for (int i = 0; i < this.txtBoxList.Count; i++)
                {
                    TextEditPLM txtBox = (TextEditPLM)this.txtBoxList[i];
                    if (txtBox.Text != "")
                    {
                        ComboBoxEditPLM cob = (ComboBoxEditPLM)this.cobList[i];
                        if ((cob.Text == "在..之间") || (cob.Text == "不在..之间"))
                        {
                            DEMetaAttribute tag = (DEMetaAttribute)txtBox.Tag;
                            for (int j = 0; j < this.txtList.Count; j++)
                            {
                                TextEditPLM     tplm2      = (TextEditPLM)this.txtList[j];
                                DEMetaAttribute attribute2 = (DEMetaAttribute)tplm2.Tag;
                                if ((tag.Oid == attribute2.Oid) && (tplm2.Text != ""))
                                {
                                    num3++;
                                    if (num3 > 1)
                                    {
                                        builder.Append(" AND ");
                                    }
                                    builder2 = this.CreateCondition(cob, txtBox);
                                    builder.Append(builder2.ToString());
                                }
                            }
                        }
                        else
                        {
                            num3++;
                            if (num3 > 1)
                            {
                                builder.Append(" AND ");
                            }
                            builder.Append(this.CreateCondition(cob, txtBox).ToString());
                        }
                    }
                }
                try
                {
                    this.myView.RowFilter = builder.ToString();
                    this.DisplayData(this.myView);
                }
                catch (PLMException exception)
                {
                    PrintException.Print(exception);
                }
                catch
                {
                    MessageBoxPLM.Show("过滤数据发生错误:请检查输入的数据类型是否正确", "筛选数据集", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
            }
        }
예제 #7
0
 protected void OnResize(object sender, EventArgs e)
 {
     try {
         this.FillListViewImageList();
     } catch (Exception exception) {
         PrintException.Print(exception);
     }
 }
예제 #8
0
        private void PLMFolderTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (e.Node != null)
            {
                try
                {
                    this.currentNode = e.Node;
                    if (this.currentNode.Tag is DEFolder2)
                    {
                        if (this.NodesExpanded[this.currentNode] == null)
                        {
                            this.NodesExpanded.Add(this.currentNode, true);
                        }
                        this.DisPlaySubFolder(this.currentNode);
                        DEFolder2 tag = this.currentNode.Tag as DEFolder2;
                        switch (tag.FolderType)
                        {
                        case 'A':
                            this.iFolderType = 1;
                            return;

                        case 'B':
                            this.iFolderType = 0;
                            return;

                        case 'C':
                            this.iFolderType = 1;
                            return;

                        case 'P':
                            this.iFolderType = 0;
                            return;
                        }
                    }
                    else if (this.currentNode.Tag is string)
                    {
                        if (this.NodesExpanded[this.currentNode] == null)
                        {
                            this.NodesExpanded.Add(this.currentNode, true);
                        }
                        if (this.currentNode == this.PubRoot)
                        {
                            this.DisPlayPubvFolder(this.currentNode);
                            this.iFolderType = 1;
                        }
                        else if (this.currentNode == this.PrvRoot)
                        {
                            this.DisPlayPrivFolder(this.currentNode);
                            this.iFolderType = 0;
                        }
                    }
                }
                catch (PLMException exception)
                {
                    PrintException.Print(exception);
                }
            }
        }
예제 #9
0
        private void DisPlayPubvFolder(TreeNode pubRoot)
        {
            pubRoot.Nodes.Clear();
            ArrayList topFolders = new ArrayList();

            try
            {
                topFolders = PLFolder.RemotingAgent.GetTopFolders(ClientData.LogonUser.Oid, true);
            }
            catch (PLMException exception)
            {
                PrintException.Print(exception);
                return;
            }
            catch (Exception exception2)
            {
                PrintException.Print(exception2);
                return;
            }
            string    sortType = ClientData.GetSortType("SORT_FOLDER");
            IComparer comparer = null;

            if (sortType != "")
            {
                comparer = new SortArraylist(sortType, "SORT_FOLDER");
            }
            else
            {
                comparer = new SortArraylist("NAME", "SORT_FOLDER");
            }
            topFolders.Sort(comparer);
            foreach (DEFolder2 folder in topFolders)
            {
                string resName = "ICO_FDL_PUBLIC_CLOSE";
                string str3    = "ICO_FDL_PUBLIC_OPEN";
                if (folder.FolderEffway == RevisionEffectivityWay.PreciseIter)
                {
                    resName = "ICO_FDL_PRECISEITER_CLOSE";
                    str3    = "ICO_FDL_PRECISEITER_OPEN";
                }
                else if (folder.FolderEffway == RevisionEffectivityWay.LastReleasedRev)
                {
                    resName = "ICO_FDL_LASTRELEASEREV_CLOSE";
                    str3    = "ICO_FDL_LASTRELEASEREV_OPEN";
                }
                TreeNode node = new TreeNode(folder.Name, this.folderImage.GetIconIndex(resName), this.folderImage.GetIconIndex(str3))
                {
                    Tag = folder
                };
                if (folder.CanExpand)
                {
                    node.Nodes.Add(new TreeNode());
                }
                pubRoot.Nodes.Add(node);
            }
            pubRoot.Expand();
        }
예제 #10
0
        private void InitializeResTree(ResClsType rtype)
        {
            this.tvwResNode.ImageList          = ClientData.MyImageList.imageList;
            this.tvwResNode.ImageIndex         = ClientData.MyImageList.GetIconIndex("ICO_RES_NODE");
            this.tvwResNode.SelectedImageIndex = ClientData.MyImageList.GetIconIndex("ICO_RES_NODE");
            TreeNode node = new TreeNode("工程资源", ClientData.MyImageList.GetIconIndex("ICO_RES_FDL"), ClientData.MyImageList.GetIconIndex("ICO_RES_FDL_OPEN"));

            this.tvwResNode.Nodes.Add(node);
            PLResFolder folder = new PLResFolder();

            try {
                DataSet allFolders = folder.GetAllFolders(ClientData.LogonUser.Oid);
                if (allFolders.Tables.Count > 0)
                {
                    if (rtype != ResClsType.All)
                    {
                        for (int i = allFolders.Tables[0].Rows.Count - 1; i >= 0; i--)
                        {
                            DEMetaClass metaClass;
                            DataRow     row = allFolders.Tables[0].Rows[i];
                            if (row["PLM_NODE_TYPE"].ToString() == "O")
                            {
                                metaClass = ModelContext.GetMetaClass(row["PLM_CLASS_NAME"].ToString());
                                switch (rtype)
                                {
                                case ResClsType.OutRes:
                                    if (!metaClass.IsOuterResClass)
                                    {
                                        allFolders.Tables[0].Rows.RemoveAt(i);
                                    }
                                    break;

                                case ResClsType.RefRes:
                                    if (!metaClass.IsRefResClass)
                                    {
                                        allFolders.Tables[0].Rows.RemoveAt(i);
                                    }
                                    break;

                                case ResClsType.TabRes:
                                    goto Label_0185;
                                }
                            }
                            continue;
Label_0185:
                            if (metaClass.IsRefResClass || metaClass.IsOuterResClass)
                            {
                                allFolders.Tables[0].Rows.RemoveAt(i);
                            }
                        }
                    }
                    ResFunc.FillMyTreeByUser(node, allFolders, ClientData.MyImageList);
                }
            } catch (Exception exception) {
                PrintException.Print(exception);
            }
        }
예제 #11
0
        private void InitializeLvwImage()
        {
            string str = "";

            this.ImageListLarge          = new ImageList();
            this.ImageListSmall          = new ImageList();
            this.lvwImage.LargeImageList = this.ImageListLarge;
            this.lvwImage.SmallImageList = this.ImageListSmall;
            this.lvwImage.View           = View.Details;
            this.lvwImage.Items.Clear();
            try
            {
                this.myList = new PLPicture().GetAllPictures();
                if (this.myList.Count > 0)
                {
                    int       num;
                    DEPicture picture2 = null;
                    string    filename = "";
                    for (num = 0; num < this.myList.Count; num++)
                    {
                        picture2      = (DEPicture)this.myList[num];
                        filename      = FSClientUtil.DownloadFile(picture2.Oid, "ClaRel_BROWSE");
                        picture2.Name = filename;
                        this.ImageListLarge.Images.Add(Image.FromFile(filename));
                        this.ImageListSmall.Images.Add(Image.FromFile(filename));
                    }
                    ListViewItem item = null;
                    for (num = 0; num < this.myList.Count; num++)
                    {
                        picture2 = (DEPicture)this.myList[num];
                        item     = new ListViewItem(picture2.Alias, num);
                        long size = picture2.Size;
                        if (picture2.Size >= 0x400L)
                        {
                            size = picture2.Size / 0x400L;
                            str  = size.ToString() + " KB";
                        }
                        else if (picture2.Size < 0x400L)
                        {
                            str = size.ToString() + " 字节";
                        }
                        item.SubItems.AddRange(new string[] { str, picture2.Creator, picture2.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), picture2.Modifier, picture2.ModifyTime.ToString("yyyy-MM-dd HH:mm:ss"), picture2.Description });
                        item.Tag = picture2;
                        this.lvwImage.Items.Add(item);
                    }
                }
            }
            catch (PLMException exception)
            {
                PrintException.Print(exception);
            }
            catch (Exception exception2)
            {
                MessageBoxPLM.Show("初始化图片列表出错:" + exception2.Message, "图片资源");
            }
        }
예제 #12
0
 private void GetItemMasRev(out DEItemMaster2[] masters, out DEItemRevision2[] revs, string[] fieldNames, string[] operators, object[] values, PLMDataType[] attrTypes)
 {
     masters = null;
     revs    = null;
     try {
         PLItem.Agent.GetItemMasterRevisions(this.user.Oid, "PPCRDTEMPLATE", fieldNames, operators, values, attrTypes, out masters, out revs);
     } catch (Exception exception) {
         PrintException.Print(new PLMException("获取对象的MasterRevisions失败!\n", exception));
     }
 }
예제 #13
0
        private void DisplayUsers()
        {
            this.lvwUser.Items.Clear();
            List <string> list = new List <string>();

            switch (this.viewMode)
            {
            case UserViewMode.ByOrgTree:
                this.tvwOrg.Visible = true;
                OrgModelUL.FillOrgTree(this.tvwOrg.Nodes[0], ClientData.MyImageList.GetIconIndex("ICO_RSP_ORG"));
                this.tvwOrg.Nodes[0].Expand();
                this.tvwOrg.AfterSelect += this.selectOrg;
                break;

            case UserViewMode.ByList: {
                this.tvwOrg.Visible      = false;
                this.tvwOrg.AfterSelect -= this.selectOrg;
                ArrayList allUsers = null;
                try {
                    PLUser user = new PLUser();
                    allUsers = user.GetAllUsers();
                    if (this.showSysAdmin)
                    {
                        string sysAdmin = user.GetSysAdmin();
                        DEUser byLogId  = user.GetByLogId(sysAdmin);
                        allUsers.Add(byLogId);
                    }
                } catch (Exception exception) {
                    PrintException.Print(exception);
                    return;
                }
                if (allUsers != null)
                {
                    foreach (DEUser user3 in allUsers)
                    {
                        ListViewItem item = this.lvwUser.Items.Add(user3.LogId, ClientData.MyImageList.GetIconIndex("ICO_RSP_USER"));
                        item.SubItems.Add(user3.Name);
                        item.Tag = user3;
                        if (!list.Contains(user3.Name))
                        {
                            list.Add(user3.Name);
                        }
                        if (!list.Contains(user3.LogId))
                        {
                            list.Add(user3.LogId);
                        }
                    }
                }
                OrgModelUL.ChangeFrozenIco(this.lvwUser);
                break;
            }
            }
            this.txtUser.AutoCompleteCustomSource.Clear();
            this.txtUser.AutoCompleteCustomSource.AddRange(list.ToArray());
        }
예제 #14
0
 protected virtual void OnScrollChanged(object sender, bool vscroll)
 {
     try {
         if (vscroll)
         {
             this.FillListViewImageList();
         }
     } catch (Exception exception) {
         PrintException.Print(exception);
     }
 }
예제 #15
0
 private void OnKeyUp(object sender, KeyEventArgs e)
 {
     try {
         if (this.OnScroll != null)
         {
             this.OnScroll(this, true);
         }
     } catch (Exception exception) {
         PrintException.Print(exception);
     }
 }
예제 #16
0
 public virtual void FillListViewImageList()
 {
     try {
         if ((!base.Disposing && !base.IsDisposed) && ((this.imageFiller != null) && !this.imageFiller.IsBusy))
         {
             this.imageFiller.RunFillImage();
         }
     } catch (Exception exception) {
         PrintException.Print(exception);
     }
 }
예제 #17
0
 protected virtual void ViewThumFile()
 {
     try {
         if (((this.uc_thumTool != null) && this.uc_thumTool.ThumSetting.IsPreview) && ((base.SelectedItems != null) && (base.SelectedItems.Count == 1)))
         {
             this.uc_thumTool.ShowThum(base.SelectedItems[0].Tag, this.ThumPSOption);
         }
     } catch (Exception exception) {
         PrintException.Print(exception);
     }
 }
예제 #18
0
 private void tspBtnFirst_Click(object sender, EventArgs e)
 {
     try {
         if (this.curIndex != 0)
         {
             this.curIndex = 0;
             this.ShowFile();
         }
     } catch (Exception exception) {
         PrintException.Print(exception);
     }
 }
예제 #19
0
 private void tspbtnPreview_Click(object sender, EventArgs e)
 {
     try {
         if (this.curIndex != 0)
         {
             this.curIndex--;
             this.ShowFile();
         }
     } catch (Exception exception) {
         PrintException.Print(exception);
     }
 }
예제 #20
0
 private void FrmMarkupByBrowser_Load(object sender, EventArgs e)
 {
     this.browser.AddControl(this.pnlBrowser);
     this.browser.SetSourceFile(this.FileName);
     this.markLocation = ViewFileHelper.Instance.GetTempMarkupPath();
     if (Directory.Exists(this.markLocation))
     {
         if ((Directory.GetFiles(this.markLocation).Length > 0) && (MessageBoxPLM.Show("系统可能正在批注其他的文件,继续操作将使原批注文件丢失,是否继续操作?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.No))
         {
             return;
         }
         ViewFileHelper.DeleteDirectory(this.markLocation);
         Thread.Sleep(100);
     }
     while (Directory.Exists(this.markLocation))
     {
     }
     Directory.CreateDirectory(this.markLocation);
     new DirectoryInfo(this.markLocation).Attributes = FileAttributes.Hidden;
     try
     {
         this.curMarkup = PLItem.Agent.GetMarkup(this.FileOid, this.workItemOid, this.dataOid, this.UserOid);
         if ((this.curMarkup != null) && (this.Mode == 0))
         {
             this.Mode = 2;
         }
         if ((this.Mode == 0) && (this.curMarkup == null))
         {
             this.curMarkup               = new DEMarkup();
             this.curMarkup.FileOid       = this.FileOid;
             this.curMarkup.ProcessOid    = this.processOid;
             this.curMarkup.WorkItemOid   = this.workItemOid;
             this.curMarkup.DataOid       = this.dataOid;
             this.curMarkup.UserOid       = this.UserOid;
             this.curMarkup.MarkupFileOid = Guid.Empty;
         }
         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 (Exception exception)
     {
         PrintException.Print(exception);
     }
 }
예제 #21
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);
     }
 }
예제 #22
0
 private void btnOpenObject_Click(object sender, EventArgs e)
 {
     try {
         if ((this.curIbizItem != null) && (BizItemHandlerEvent.Instance.D_OpenItem != null))
         {
             List <IBizItem> items = new List <IBizItem> {
                 this.curIbizItem
             };
             PLMOperationArgs args = new PLMOperationArgs(FrmLogon.PLMProduct.ToString(), PLMLocation.BPMList.ToString(), items, this.psOption, null, null, null, null);
             BizItemHandlerEvent.Instance.D_OpenItem(null, args);
         }
     } catch (Exception exception) {
         PrintException.Print(exception);
     }
 }
예제 #23
0
 private void DisPlaySubFolder(TreeNode pNode)
 {
     if (((pNode != null) && !(pNode.Tag is string)) && (pNode.Tag is DEFolder2))
     {
         Cursor.Current = Cursors.WaitCursor;
         DEFolder2 tag = (DEFolder2)pNode.Tag;
         pNode.Nodes.Clear();
         try
         {
             ArrayList subFolders = PLFolder.RemotingAgent.GetSubFolders(ClientData.LogonUser.Oid, tag.Oid);
             string    sortType   = ClientData.GetSortType("SORT_FOLDER");
             IComparer comparer   = null;
             if (sortType != "")
             {
                 comparer = new SortArraylist(sortType, "SORT_FOLDER");
             }
             else
             {
                 comparer = new SortArraylist("NAME", "SORT_FOLDER");
             }
             subFolders.Sort(comparer);
             foreach (DEFolder2 folder2 in subFolders)
             {
                 TreeNode node = new TreeNode(folder2.Name, this.folderImage.GetObjectImage("folder", "close"), this.folderImage.GetObjectImage("folder", "open"))
                 {
                     Tag = folder2
                 };
                 pNode.Nodes.Add(node);
                 if (folder2.CanExpand)
                 {
                     node.Nodes.Add(new TreeNode());
                 }
             }
         }
         catch (PLMException exception)
         {
             PrintException.Print(exception);
         }
         catch (Exception exception2)
         {
             PrintException.Print(exception2);
         }
         finally
         {
             Cursor.Current = Cursors.Default;
         }
     }
 }
예제 #24
0
 private void FolderDelete(object sender, EventArgs e)
 {
     if (MessageBox.Show("你确定要删除文件夹“" + this.tvwFolder.SelectedNode.Text + "”吗?", "文件夹定制", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
     {
         DEFolder2 tag = (DEFolder2)this.tvwFolder.SelectedNode.Tag;
         try
         {
             Hashtable result = null;
             PLFolder.RemotingAgent.DeleteFolder(ClientData.LogonUser.Oid, tag.Oid, true, false, out result);
             this.tvwFolder.SelectedNode.Remove();
         }
         catch (Exception exception)
         {
             PrintException.Print(exception);
         }
     }
 }
예제 #25
0
 /// <summary>
 /// 初始PLM公共数据
 /// </summary>
 /// <param name="user">登陆用户</param>
 /// <returns></returns>
 private static bool Init()
 {
     try
     {
         //this.curUser = user;
         PSInit.InitPS(ClientData.LogonUser, false);
         BPMEventInit.InitBPMEvent();
         Thyt.TiPLM.UIL.TiMessage.UIMessage.Instance.InitilizeMessage(null);
         //Thyt.TiPLM.UIL.Addin.AddinDeployment.Instance.SyncAddinsWithServer();
         return(true);
     }
     catch (Exception ex)
     {
         //System.Diagnostics.EventLog.WriteEntry("PLM集成控件",ex.ToString(),System.Diagnostics.EventLogEntryType.Error);
         PrintException.Print(ex);
         return(false);
     }
 }
예제 #26
0
 private void ClearConditon()
 {
     for (int i = 0; i < this.txtBoxList.Count; i++)
     {
         TextEditPLM tplm = (TextEditPLM)this.txtBoxList[i];
         tplm.Text = "";
         ComboBoxEditPLM tplm2 = (ComboBoxEditPLM)this.cobList[i];
         if ((tplm2.Text == "在..之间") || (tplm2.Text == "不在..之间"))
         {
             tplm.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
             tplm.Width  = (base.Width - tplm.Left) - 5;
             tplm2.Tag   = 0;
             for (int j = 0; j < this.lblList.Count; j++)
             {
                 LabelPLM    lplm  = (LabelPLM)this.lblList[j];
                 TextEditPLM tplm3 = (TextEditPLM)this.txtList[j];
                 if (lplm.Tag == tplm.Tag)
                 {
                     this.gbFilter.Controls.Remove(lplm);
                     this.lblList.Remove(lplm);
                 }
                 if (tplm3.Tag == tplm.Tag)
                 {
                     this.gbFilter.Controls.Remove(tplm3);
                     this.txtList.Remove(tplm3);
                 }
             }
         }
         tplm2.Text = "等于";
     }
     try
     {
         this.myView.RowFilter = "";
         this.DisplayData(this.myView);
     }
     catch (PLMException exception)
     {
         PrintException.Print(exception);
     }
     catch (Exception exception2)
     {
         MessageBoxPLM.Show("过滤数据发生错误" + exception2.ToString(), "筛选数据集", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
 }
예제 #27
0
 private void FillProcess()
 {
     this.lvwProcess.Items.Clear();
     this.lvwWorkItem.Items.Clear();
     foreach (DEMarkup markup in this.MarkupList)
     {
         bool flag = false;
         DELProcessInsProperty theDELProcessInsProperty = null;
         foreach (DELProcessInsProperty property2 in this.ProcessList)
         {
             if (property2.ID == markup.ProcessOid)
             {
                 theDELProcessInsProperty = property2;
                 flag = true;
                 break;
             }
         }
         if (!flag)
         {
             BPMProcessor processor = new BPMProcessor();
             try
             {
                 processor.GetProcessInsProperty(ClientData.LogonUser.Oid, markup.ProcessOid, out theDELProcessInsProperty);
             }
             catch (Exception exception)
             {
                 PrintException.Print(exception);
                 continue;
             }
             if (theDELProcessInsProperty != null)
             {
                 this.ProcessList.Add(theDELProcessInsProperty);
             }
         }
         if (theDELProcessInsProperty != null)
         {
             this.AddProcessToList(theDELProcessInsProperty);
         }
     }
     if (this.lvwProcess.Items.Count > 0)
     {
         this.lvwProcess.Items[0].Selected = true;
     }
 }
예제 #28
0
 private void tspBtnPreview_Click(object sender, EventArgs e)
 {
     try
     {
         this.tspBtnPreview.Checked = !this.tspBtnPreview.Checked;
         this.thumSetting.IsPreview = this.tspBtnPreview.Checked;
         if (this.tspBtnPreview.Checked && (this.PreviewChanged != null))
         {
             this.PreviewChanged(this, new ThumToolsEventArgs(this.thumSetting.IsPreview, this.thumSetting.DisplayStyle));
         }
         UIThumbnailHelper.Instance.SaveSetting(this.Location, this.ThumSetting);
         this.panRight.Visible = this.tspBtnPreview.Checked;
         this.panRight.Width   = this.thumSetting.PreviwWidth;
     }
     catch (Exception exception)
     {
         PrintException.Print(exception);
     }
 }
예제 #29
0
 public void ShowThum(object objItem, DEPSOption option)
 {
     if (this.ucThumbnail != null)
     {
         try
         {
             Cursor.Current = Cursors.WaitCursor;
             this.ucThumbnail.Display(objItem, option, this.thumSetting);
         }
         catch (Exception exception)
         {
             PrintException.Print(exception);
         }
         finally
         {
             Cursor.Current = Cursors.Default;
         }
     }
 }
예제 #30
0
 public string GetUserHost()
 {
     try
     {
         string      str         = "";
         IPHostEntry hostByName  = Dns.GetHostByName(Dns.GetHostName());
         IPAddress[] addressList = hostByName.AddressList;
         if (((hostByName != null) && (addressList != null)) && (addressList.Length > 0))
         {
             str = addressList[0].ToString();
         }
         return(str);
     }
     catch (Exception exception)
     {
         PrintException.Print(exception);
     }
     return("");
 }