private void AfterReleaseDescUpdated(IBizItem[] bizItems) { if ((bizItems != null) && (bizItems.Length != 0)) { DEBusinessItem item = PSConvert.ToBizItem(bizItems[0], ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid); string attrValue = (string)item.Iteration.GetAttrValue("TEMPLATETYPE"); if (ClientData.mainForm != null) { foreach (Form form in ClientData.mainForm.MdiChildren) { if (form is FrmBrowse) { FrmBrowse browse = form as FrmBrowse; if ((browse.headClass == attrValue) || (browse.headClass == null)) { foreach (ListViewItem item2 in browse.lvwTemplates.Items) { if (((DEBusinessItem)item2.Tag).Master.Oid == item.Master.Oid) { item2.Tag = item; if (!browse.inDialog) { browse.FillListViewItem(item2, item.Master, item.Revision); } break; } } } } } } } }
private void AfterRenamed(object sender, PLMOperationArgs e) { if (((e.BizItems != null) && (e.BizItems.Length != 0)) && (e.BizItems[0].ClassName == "PPCRDTEMPLATE")) { string templateType = ""; DEBusinessItem item = PSConvert.ToBizItem(e.BizItems[0], ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid); if (item.Iteration == null) { templateType = PLCardTemplate.GetTemplateType(item.Revision, this.user.Oid); } else { templateType = (string)item.Iteration.GetAttrValue("TEMPLATETYPE"); } if ((this.headClass == templateType) || (this.headClass == null)) { foreach (ListViewItem item2 in this.lvwTemplates.Items) { if (((DEBusinessItem)item2.Tag).Master.Oid == item.Master.Oid) { item2.Tag = e.BizItems[0]; if (!this.inDialog) { this.FillListViewItem(item2, item.Master, item.Revision); } break; } } } } }
public bool UpdateData(bool updateIteration) { try { foreach (Control control in this.pnlProperty.Controls) { if (typeof(TextBox).IsInstanceOfType(control) && !((TextBox)control).ReadOnly) { DEMetaAttribute tag = (DEMetaAttribute)control.Tag; object attrValue = PSConvert.String2Attribute(((TextBox)control).Text, tag); if (!tag.NullAllowed && ((attrValue == null) || attrValue.Equals(""))) { MessageBox.Show(tag.Label + "不能为空。", "输入提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); control.Focus(); return(false); } this.Item.Iteration.SetAttrValue(tag.Name, attrValue); } } if (updateIteration) { this.Item.Iteration = PLItem.UpdateItemIteration(this.Item.Iteration, this.uOid, false); } return(true); } catch (Exception exception) { MessageBox.Show("输入信息格式错误,请检查信息合法性!" + exception.Message); return(false); } }
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); }
public void OnMatch(object sender, PLMOperationArgs args) { if (((args != null) && (args.BizItems != null)) && (args.BizItems.Length != 0)) { IBizItem item = args.BizItems[0]; DEBusinessItem theItem = PSConvert.ToBizItem(item, args.Option.CurView, ClientData.LogonUser.Oid); AttributeSelectorFrm frm = new AttributeSelectorFrm(theItem, sender, args); frm.ShowDialog(); } }
public bool Display(object obizItem, DEPSOption psOption, ThumbnailSetting thumSetting) { if (obizItem is TreeNode) { obizItem = ((TreeNode)obizItem).Tag; } if (obizItem is DataRowView) { DataRowView view = (DataRowView)obizItem; obizItem = PLItem.Agent.GetBizItemByMaster(new Guid((byte[])view[0]), 0, psOption.CurView, ClientData.LogonUser.Oid, BizItemMode.BizItem) as DEBusinessItem; } if (!(obizItem is IBizItem)) { this.bizItem = null; this.InitFileRelaData(); int generation = GC.GetGeneration(this.pnlViewer); BrowserPool.BrowserManager.RemoveBrowser(this.pnlViewer); this.pnlViewer.Controls.Clear(); GC.Collect(generation); return(this.toolStrip1.Visible = false); } bool flag = false; if (this.bizItem == null) { flag = true; } else if (((IBizItem)obizItem).MasterOid != this.bizItem.MasterOid) { flag = true; } this.bizItem = PSConvert.ToBizItem(obizItem as IBizItem, psOption.CurView, ClientData.LogonUser.Oid); this.toolStrip1.Visible = true; this.psOption = psOption; this.thumSetting = thumSetting; bool flag2 = this.InitFiles(); if (!flag) { flag = flag2; } if (!flag) { this.toolStrip1.Visible = (this.curFile != null) && this.thumSetting.IsShowToolBar; return(this.curFile != null); } this.SetShowTypeContent(this.thumSetting); this.ShowFile(); this.toolStrip1.Visible = (this.curFile != null) && this.thumSetting.IsShowToolBar; return(this.curFile != null); }
private void AfterItemUpdated(IBizItem[] bizItems) { if ((bizItems != null) && (bizItems.Length != 0)) { DEBusinessItem item = PSConvert.ToBizItem(bizItems[0], ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid); string attrValue = (string)item.Iteration.GetAttrValue("TEMPLATETYPE"); if ((this.headClass == attrValue) || (this.headClass == null)) { foreach (ListViewItem item2 in this.lvwTemplates.Items) { if (((DEBusinessItem)item2.Tag).Master.Oid == item.Master.Oid) { item2.Tag = item; if (!this.inDialog) { this.FillListViewItem(item2, item.Master, item.Revision); } break; } } } } }
private void AfterItemUpdated(IBizItem[] bizItems) { if ((bizItems != null) && (bizItems.Length != 0)) { ArrayList list = new ArrayList(PSConvert.ToBizItems(bizItems, ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid)); foreach (DEBusinessItem item in list) { if (item.ClassName != "DQDOSSIERPRINT") { break; } string tsStatue = PlArchivManage.GetTsStatue(item); string str2 = tsStatue; if ((str2 == null) || ((str2 != "打印完成") && (str2 != "打印取消"))) { if (tsStatue == "开始打印") { bool flag = false; foreach (ListViewItem item2 in this.lvwTSD.Items) { DEBusinessItem tag = item2.Tag as DEBusinessItem; if (tag.MasterOid == item.MasterOid) { flag = true; break; } } if (!flag) { continue; } } this.UpdateTsdItem(item); } } } }
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; }
private static DESecureFile GetSecureFile(IBizItem bizItem, Guid fileOid) { return(PSConvert.ToBizItem(bizItem, ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid).Iteration.FileList.FindFile(fileOid)); }
public void UpdateUI(DEBusinessItem item, DEMetaClassEx meta, Guid uOid, bool readOnly) { this.Item = item; if (meta != null) { this.meta = meta; } this.uOid = uOid; this.Text = "编辑对象" + item.Master.Id; int y = 20; int x = 20; int num3 = 150; int num4 = 50; int height = 30; int width = 100; int num7 = 150; this.pnlProperty.Controls.Clear(); foreach (DEMetaAttribute attribute in this.meta.Attributes) { if (attribute.IsViewable) { Label label = new Label { Location = new Point(x, y + 5), Size = new Size(width, height), Text = attribute.Label + ":" }; TextBox box = null; ResCombo combo = null; if (!readOnly) { if (attribute.LinkedResClass != Guid.Empty) { combo = new ResCombo(ModelContext.MetaModel.GetClass(attribute.LinkedResClass).Name, attribute); } else { box = new TextBox(); } } else { box = new TextBox(); } if (!attribute.IsEditable || (PLGrantPerm.CanDoClassAttribute(ClientData.LogonUser.Oid, item.Master.ClassName, attribute.Name, item) == 1)) { if (box != null) { box.ReadOnly = true; } else if (combo != null) { combo.readOnly = true; } } if (readOnly) { if (box != null) { box.ReadOnly = true; } else if (combo != null) { combo.readOnly = true; } } if (box != null) { box.Location = new Point(num3, y); box.Size = new Size(num7, height); box.Tag = attribute; } else if (combo != null) { combo.Location = new Point(num3, y); combo.Size = new Size(num7, height); combo.Tag = attribute; } object attrValue = this.Item.Iteration.GetAttrValue(attribute.Name); if (box != null) { if (attrValue is Guid) { box.Text = PrincipalRepository.GetPrincipalName((Guid)attrValue); } else { box.Text = PSConvert.Attribute2String(attrValue, attribute); } } else if (combo != null) { if ((attribute.LinkType == 0) && (attribute.DataType == 8)) { if (attrValue == null) { combo.ResValue = ""; } else { combo.ResValue = combo.GetResourceID(new Guid((byte[])attrValue), ModelContext.MetaModel.GetClass(attribute.LinkedResClass).Name); } } else { combo.ResValue = PSConvert.Attribute2String(attrValue, attribute); } } this.pnlProperty.Controls.Add(label); if (box != null) { this.pnlProperty.Controls.Add(box); } else if (combo != null) { this.pnlProperty.Controls.Add(combo); } y += num4; } } }
private void ShowFile() { this.GetShowFile(); if (this.curFile == null) { int generation = GC.GetGeneration(this.pnlViewer); BrowserPool.BrowserManager.RemoveBrowser(this.pnlViewer); this.pnlViewer.Controls.Clear(); GC.Collect(generation); } else { BrowserDisplayRule visibleDisplayRule = ViewFileHelper.Instance.GetVisibleDisplayRule(); ViewFileHelper.Instance.ViewFile(this.curIbizItem.Iteration, false, this.curFile, null, this.pnlViewer, this.psOption, false, this.curIbizItem, null, visibleDisplayRule, false); this.SetPictureDoubleClickEvent(); if (this.AfterShowThumFile != null) { this.AfterShowThumFile(this, new ThumShowEventArgs(this.curIbizItem, this.curFile)); } this.btnOpenObject.Text = this.curIbizItem.Id + "[" + ModelContext.MetaModel.GetClassLabel(this.curIbizItem.ClassName) + "]" + PSConvert.ToString(this.curIbizItem.ExactState); this.tspLabelPage.Text = this.tspBtnShowType.Checked ? string.Concat(new string[5]) : string.Concat(new string[5]); } }