private void SetDisplayPos() { if (this.deMetaAttri != null) { foreach (DEMetaAttribute attribute in this.Attrs) { if (this.deMetaAttri.Combination.IndexOf("[" + attribute.Name + "]") > -1) { string label = ""; label = attribute.Label; if (ResFunc.IsRefRes(this.classOid)) { if (attribute.Name == "ID") { label = "代号"; } if (attribute.Name == "LABEL") { label = "类名"; } } if ((base.DisplayLayout.Bands.Count != 0) && (base.DisplayLayout.Bands[0].Columns.Count != 0)) { base.DisplayLayout.Bands[0].Columns[label].Header.VisiblePosition = 0; } } } } }
private int GetResDataCount() { int num = 0; if (ResFunc.IsOnlineOutRes(this.curFolder.ClassOid)) { return(ResFunc.GetDataCount(this.curFolder, this.attrList, this.attrOuter, emResourceType.OutSystem)); } if (ResFunc.IsRefRes(this.curFolder.ClassOid)) { PLSPL plspl = new PLSPL(); DEMetaClass class2 = ModelContext.MetaModel.GetClass(this.curFolder.ClassOid); DEMetaClass class3 = ModelContext.MetaModel.GetClass(class2.RefClass); ArrayList attrList = new ArrayList(); foreach (DEMetaAttribute attribute in this.attrList) { if (this.ISDefAttrViewable(attribute)) { attrList.Add(attribute); } } return(plspl.GetSPLCount(class3.Name, attrList, ClientData.LogonUser.Oid, this.curFolder.FilterString, this.curFolder.FilterValue)); } if (ResFunc.IsTabRes(this.curFolder.ClassOid)) { ArrayList list2 = new ArrayList(); num = ResFunc.GetDataCount(this.curFolder, list2, this.attrOuter, emResourceType.Customize); } return(num); }
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); } }
private void InitOldAttrLstData() { this.al_OldAttr = this.GetAttributes(this.myCls.Name); if (this.b_isRefCls) { ArrayList c = new ArrayList(); c = ResFunc.GetFixedAttrList(); this.al_OldAttr.AddRange(c); } }
private void LoadAttrData() { DEResFolder defolder = new DEResFolder { Oid = this.g_ClsOid, ClassOid = this.g_ClsOid, ClassName = this.className }; ArrayList showAttrList = ResFunc.GetShowAttrList(defolder, emTreeType.NodeTree); this.al_attrs = ResFunc.CloneMetaAttrLst(showAttrList); }
private void SetDisplayName(DataSet ds) { try { string tableName = ""; if (ResFunc.IsOnlineOutRes(this.classOid)) { tableName = this.myds.Tables[0].TableName; } else { tableName = "PLM_CUS_" + this.className; if (ResFunc.IsRefRes(this.classOid)) { tableName = "PLM_CUSV_" + this.className; } } string str2 = "PLM_"; string str3 = ""; if (((ds != null) && (ds.Tables.Count > 0)) && (ds.Tables[tableName] != null)) { this.SetParam(); foreach (DataColumn column in ds.Tables[tableName].Columns) { if (column.ColumnName == "PLM_M_ID") { column.ColumnName = "代号"; } if (column.ColumnName == "PLM_LABEL") { column.ColumnName = "类名"; } foreach (DEMetaAttribute attribute in this.Attrs) { str3 = str2 + attribute.Name; if (column.ColumnName == str3) { column.ColumnName = attribute.Label; break; } } if (column.DataType.Equals(System.Type.GetType("System.Byte[]"))) { this.al_guid.Add(column.ColumnName); } } } } catch (Exception exception) { throw new Exception("error!" + exception.Message); } }
private void ConvertOuterDSHeader(DataSet ds_ret, Guid g_clsoid) { ArrayList attrList = new ArrayList(); ArrayList outList = new ArrayList(); DEResFolder defolder = new DEResFolder { ClassOid = g_clsoid }; DEMetaClass class2 = ModelContext.MetaModel.GetClass(g_clsoid); attrList = this.GetAttributes(class2.Name); outList = ResFunc.GetOuterAttr(defolder); this.ReplaceAttrName(ds_ret, outList, attrList); }
private void InitResInfo() { ArrayList showAttrList = ResFunc.GetShowAttrList(this.curFolder, emTreeType.NodeTree); this.attrList = ResFunc.CloneMetaAttrLst(showAttrList); this.attrSort = ResFunc.GetSortAttrList(this.curFolder); this.attrOuter = ResFunc.GetOuterAttr(this.curFolder); this.clsName = this.curFolder.ClassName; this.InitResStatus(); this.InitSortList(true); this.InitShowAttrLst(); this.SetAttrDataType(); }
private string GetClsAttr2ResAttrLbl(DECodeAttribute ca_in) { ArrayList list = new ArrayList(); new ArrayList(); new ArrayList(); new ArrayList(); if (this.theCls != null) { foreach (DEMetaAttribute attribute in PLDataModel.Agent2.GetClassAllAttributes(this.theCls.Name)) { if ((attribute.IsViewable && !attribute.IsGrid) && !attribute.IsVirtualClass) { list.Add(attribute); } } if (list.Count == 0) { return(""); } foreach (DEMetaAttribute attribute2 in list) { if (attribute2.Oid == ca_in.ClassAttrOid) { DEMetaClass metaClass = PLDataModel.Agent2.GetMetaClass(ca_in.ResClsOid); List <DEMetaAttribute> list3 = new List <DEMetaAttribute>(); if (metaClass != null) { ArrayList resAttrs = new ResFunc().GetResAttrs(metaClass); if ((resAttrs != null) && (resAttrs.Count > 0)) { list3.AddRange((DEMetaAttribute[])resAttrs.ToArray(typeof(DEMetaAttribute))); } } if ((list3 == null) || (list3.Count <= 0)) { return(attribute2.Label + " -> "); } foreach (DEMetaAttribute attribute3 in list3) { if (attribute3.Oid == ca_in.ResAttrOid) { return(attribute2.Label + " -> " + attribute3.Label); } } } } } return(""); }
private void ResCombo_RowSelected(object sender, RowSelectedEventArgs e) { this.m_dropdownRow = e.Row; if ((((this.m_dropdownRow != null) && !ResFunc.IsOnlineOutRes(this.classOid)) && (constResource.Label_OID != "")) && ((this.m_dropdownRow.Cells[constResource.Label_OID] != null) && (this.m_dropdownRow.Cells[constResource.Label_OID].Value.ToString() != ""))) { if (this.m_dropdownRow.Cells[constResource.Label_OID].Value.GetType() == typeof(Guid)) { this.resOid = (Guid)this.m_dropdownRow.Cells[constResource.Label_OID].Value; } else { this.resOid = new Guid((byte[])this.m_dropdownRow.Cells[constResource.Label_OID].Value); } } }
public bool IsInDataSet(string str) { this.LoadData(); string tableName = "PLM_CUS_" + this.className; if (ResFunc.IsRefRes(this.classOid)) { tableName = "PLM_CUSV_" + this.className; } bool flag = false; if (this.myds == null) { this.InitializeData(); } DataSet myds = this.myds; if ((myds == null) || (myds.Tables.Count <= 0)) { return(false); } if (ResFunc.IsOnlineOutRes(this.className)) { tableName = myds.Tables[0].TableName; } if (myds.Tables[tableName].Rows.Count <= 0) { return(false); } foreach (DataColumn column in myds.Tables[tableName].Columns) { if (column.ColumnName == this.comColumn) { foreach (DataRow row in myds.Tables[tableName].Rows) { if (str == row[this.comColumn].ToString()) { return(true); } } return(flag); } } return(flag); }
public Guid GetResourceOID(string id, string clsName) { string str = "PLM_CUS_" + clsName; if (ResFunc.IsRefRes(this.classOid)) { str = "PLM_CUSV_" + clsName; } Guid empty = Guid.Empty; ulong stamp = 0L; if (id != "") { DataSet set; UCCusResource.GetData(out stamp, out set, clsName, this.Attrs); if ((set == null) || (set.Tables.Count <= 0)) { return(empty); } if (set.Tables[str].Rows.Count <= 0) { return(empty); } try { foreach (DataRow row in set.Tables[str].Rows) { string str2 = row["PLM_ID"].ToString(); if (id == str2) { return(new Guid((byte[])row["PLM_OID"])); } } return(empty); } catch (Exception exception) { throw new Exception("error!" + exception.Message); } } return(empty); }
public string GetResourceID(Guid resOID, string clsName) { string str = "PLM_CUS_" + clsName; if (ResFunc.IsRefRes(this.classOid)) { str = "PLM_CUSV_" + clsName; } string str2 = ""; ulong stamp = 0L; if (resOID != Guid.Empty) { DataSet set; UCCusResource.GetData(out stamp, out set, clsName, this.Attrs); if ((set == null) || (set.Tables.Count <= 0)) { return(str2); } if (set.Tables[str].Rows.Count <= 0) { return(str2); } try { foreach (DataRow row in set.Tables[str].Rows) { Guid guid = new Guid((byte[])row["PLM_OID"]); if (resOID == guid) { return(row["PLM_ID"].ToString()); } } return(str2); } catch (Exception exception) { throw new Exception("error!" + exception.Message); } } return(str2); }
private void InitResStatus() { if (ResFunc.IsOnlineOutRes(this.curFolder.ClassOid)) { this.emResType = emResourceType.OutSystem; } else if (ResFunc.IsRefRes(this.curFolder.ClassOid)) { this.emResType = emResourceType.Standard; this.b_refType = true; } else if (ResFunc.IsTabRes(this.curFolder.ClassOid)) { this.emResType = emResourceType.Customize; } else { this.emResType = emResourceType.PLM; } }
private DECodeAttribute GetCodeAttrValue() { string text = this.comBoxAttrName.Text; DEMetaAttribute metaAttr = this.GetMetaAttr(text); if (metaAttr != null) { if (this.pnlValue.Controls.Count == 0) { this.ca_input.ClassOid = this.ClassOid; this.ca_input.ClassAttrOid = metaAttr.Oid; this.ca_input.ResAttrOid = Guid.Empty; this.ca_input.ResClsOid = Guid.Empty; return(this.ca_input); } ComboBoxEditPLM tplm = this.pnlValue.Controls[0] as ComboBoxEditPLM; string str2 = tplm.Text; DEMetaClass myCls = ModelContext.MetaModel.GetClass(metaAttr.LinkedResClass); ArrayList resAttrs = new ResFunc().GetResAttrs(myCls); if (resAttrs == null) { return(null); } if (resAttrs.Count == 0) { return(null); } foreach (DEMetaAttribute attribute2 in resAttrs) { if (attribute2.Label == str2) { this.ca_input.ClassOid = this.ClassOid; this.ca_input.ClassAttrOid = metaAttr.Oid; this.ca_input.ResAttrOid = attribute2.Oid; this.ca_input.ResClsOid = myCls.Oid; return(this.ca_input); } } } return(null); }
private bool CheckOptionByDA() { bool flag = true; DEResFolder defolder = new DEResFolder { Oid = Guid.Empty, ClassOid = this.clsOid, ClassName = this.clsName, Filter = this.FilterConditon.ToString(), FilterString = this.FilterString, FilterValue = this.FilterValue }; ArrayList list = new ArrayList(); ArrayList outerAttr = new ArrayList(); list = ResFunc.CloneMetaAttrLst(ResFunc.GetShowAttrList(defolder, emTreeType.NodeTree)); outerAttr = ResFunc.GetOuterAttr(defolder); try { if (ResFunc.IsOnlineOutRes(defolder.ClassOid)) { ResFunc.GetDataCount(defolder, list, outerAttr, emResourceType.OutSystem); return(flag); } if (ResFunc.IsRefRes(defolder.ClassOid)) { PLSPL plspl = new PLSPL(); DEMetaClass class2 = ModelContext.MetaModel.GetClass(defolder.ClassOid); DEMetaClass class3 = ModelContext.MetaModel.GetClass(class2.RefClass); plspl.GetSPLCount(class3.Name, list, ClientData.LogonUser.Oid, defolder.FilterString, defolder.FilterValue); return(flag); } if (ResFunc.IsTabRes(defolder.ClassOid)) { ArrayList list4 = new ArrayList(); ResFunc.GetDataCount(defolder, list4, outerAttr, emResourceType.Customize); } } catch { return(false); } return(flag); }
private void SetCodeAttrValue(DECodeAttribute ca_def) { if ((ca_def != null) && (ca_def.ResClsOid != Guid.Empty)) { DEMetaClass myCls = ModelContext.MetaModel.GetClass(ca_def.ResClsOid); if (myCls != null) { ArrayList resAttrs = new ResFunc().GetResAttrs(myCls); if (((resAttrs != null) && (resAttrs.Count != 0)) && (this.pnlValue.Controls.Count != 0)) { ComboBoxEditPLM tplm = this.pnlValue.Controls[0] as ComboBoxEditPLM; foreach (DEMetaAttribute attribute in resAttrs) { if (attribute.Oid == ca_def.ResAttrOid) { tplm.Text = attribute.Label; break; } } } } } }
private void ConfigureResCombo() { base.DataSource = this.myView; if (ResFunc.IsOnlineOutRes(this.classOid)) { base.ValueMember = this.comColumn; } else { base.ValueMember = constResource.Label_OID; } base.DisplayMember = this.comColumn; this.SetDisplayPos(); if (this.deMetaAttri.IsResInputEnable) { base.AutoEdit = true; } else { base.AutoEdit = false; } base.MaxDropDownItems = 6; }
private void CheckDefineAttr() { switch (ResFunc.CheckDefineAttrLst(this.g_ClsOid)) { case 0: case 1: break; case 2: MessageBoxPLM.Show("数据模型删除属性,请检查资源类节点属性显示定义和模型定义", "提示"); return; case 3: MessageBoxPLM.Show("数据模型新增属性,请检查资源类节点属性显示定义", "提示"); return; case 4: MessageBoxPLM.Show("数据模型删除并新增了属性,请检查资源类节点属性显示定义和模型定义", "提示"); break; default: return; } }
public bool IsInDataSet(object ob_in, string str_comattr) { this.LoadData(); string tableName = "PLM_CUS_" + this.className; if (ResFunc.IsRefRes(this.classOid)) { tableName = "PLM_CUSV_" + this.className; } if (str_comattr == null) { return(false); } if (str_comattr == string.Empty) { return(false); } bool flag = false; if (this.myds == null) { this.InitializeData(); } DataSet myds = this.myds; if ((myds == null) || (myds.Tables.Count <= 0)) { return(false); } if (ResFunc.IsOnlineOutRes(this.className)) { tableName = myds.Tables[0].TableName; } if (myds.Tables[tableName].Rows.Count <= 0) { return(false); } foreach (DataColumn column in myds.Tables[tableName].Columns) { if (column.ColumnName == this.comColumn) { foreach (DataRow row in myds.Tables[tableName].Rows) { if (str_comattr.Equals("对象全局唯一标识")) { if ((row["PLM_OID"] != null) && (row["PLM_OID"].ToString() != "")) { Guid guid = (Guid)row["PLM_OID"]; if (((Guid)ob_in) == guid) { return(true); } } } else { string str2 = str_comattr; string str3 = str2; foreach (DEMetaAttribute attribute in this.Attrs) { if (str_comattr.IndexOf("[" + attribute.Name + "]") > -1) { string str4 = "PLM_" + attribute.Name; str2 = str2.Replace("[" + attribute.Name + "]", Convert.ToString(row[str4].ToString())); str3 = str3.Replace("[" + attribute.Name + "]", ""); } } if (str2 == str3) { str2 = ""; } string str5 = str2; if (ob_in.ToString() == str5) { return(true); } } } return(flag); } } return(flag); }
private void InitializeData() { if ((this.className != null) && (this.className != "")) { string tableName = "PLM_CUS_" + this.className; this.Attrs = this.GetAttributes(this.className); try { if (ResFunc.IsOnlineOutRes(this.className)) { this.myds = new PLOuterResource().GetOuterResData(this.classOid, true); this.Attrs = ResFunc.GetAttrList(this.myds, this.Attrs); if (this.myds != null) { tableName = this.myds.Tables[0].TableName; } } else if (ResFunc.IsTabRes(this.classOid)) { ResFunc.GetData(out Stamp, out this.myds, this.className, this.Attrs); } else { this.myds = new DataSet(); ArrayList items = new ArrayList(); items = this.GetItemLST(this.className); DataTable dataSource = DataSourceMachine.GetDataSource(this.className, items); this.myds.Tables.Add(dataSource); } } catch (PLMException exception) { PrintException.Print(exception); } catch (Exception exception2) { MessageBoxPLM.Show("读取数据集发生错误" + exception2.ToString(), "读取数据集", MessageBoxButtons.OK, MessageBoxIcon.Hand); } if ((this.myds != null) && (this.deMetaAttri != null)) { if (((this.deMetaAttri != null) && (this.deMetaAttri.LinkType == 1)) && (this.deMetaAttri.Combination != "")) { DataColumn column = new DataColumn(this.comColumn) { DataType = typeof(string) }; this.myds.Tables[tableName].Columns.Add(column); foreach (DataRow row in this.myds.Tables[tableName].Rows) { string combination = this.deMetaAttri.Combination; string str3 = combination; foreach (DEMetaAttribute attribute in this.Attrs) { if (this.deMetaAttri.Combination.IndexOf("[" + attribute.Name + "]") > -1) { string str2 = "PLM_" + attribute.Name; combination = combination.Replace("[" + attribute.Name + "]", Convert.ToString(row[str2])); str3 = str3.Replace("[" + attribute.Name + "]", ""); } } if (combination == str3) { combination = ""; } row[this.comColumn] = combination; } } else if ((this.deMetaAttri.LinkType == 0) && (this.deMetaAttri.DataType == 8)) { DataColumn column2 = new DataColumn(this.comColumn) { DataType = typeof(string) }; this.myds.Tables[tableName].Columns.Add(column2); foreach (DataRow row2 in this.myds.Tables[tableName].Rows) { row2[this.comColumn] = row2["PLM_ID"].ToString(); } } DataSet ds = this.myds.Copy(); this.SetDisplayName(ds); this.myView = ds.Tables[tableName].DefaultView; this.ConfigureResCombo(); this.SetDisplayGrid(); this.InitFilterData(); } } }
private void DoOutFile(string strFileName) { ArrayList files = new ArrayList(); for (int i = 0; i < this.TotalNum; i++) { int num2 = 0; int num3 = 0; int num4 = 0; if ((i >= (this.StartNum - 1)) && (i <= (this.EndNum - 1))) { num4++; if (i == 0) { num2 = i * this.showNum; } else { num2 = (i * this.showNum) + 1; } num3 = (i + 1) * this.showNum; if (ResFunc.IsOnlineOutRes(this.curFolder.ClassOid)) { ResFunc.GetNumDS(out this.theDataSet, this.curFolder, this.attrList, num2, num3, this.strSort); ResFunc.ConvertOuterDSHead(this.theDataSet, this.attrList, this.attrOuter); } else if (ResFunc.IsRefRes(this.curFolder.ClassOid)) { PLSPL plspl = new PLSPL(); DEMetaClass class2 = ModelContext.MetaModel.GetClass(this.curFolder.ClassOid); DEMetaClass class3 = ModelContext.MetaModel.GetClass(class2.RefClass); this.clsName = class3.Name; ArrayList attrList = new ArrayList(); foreach (DEMetaAttribute attribute in this.attrList) { if (this.ISDefAttrViewable(attribute)) { attrList.Add(attribute); } } this.theDataSet = plspl.GetSPLNumDataSet(class3.Name, attrList, ClientData.LogonUser.Oid, num2, num3, this.curFolder.FilterString, this.curFolder.FilterValue, this.strSort); this.b_refType = true; } else if (ResFunc.IsTabRes(this.curFolder.ClassOid)) { new ArrayList(); ResFunc.GetNumDS(out this.theDataSet, this.curFolder, this.attrList, num2, num3, this.strSort); } if (this.theDataSet != null) { if (num4 == 1) { this.InitLvShowHeader(); } this.ConvertToListView(); if (this.IsMultiPageOut) { string str = Path.Combine(this.tmpPath, "page" + ((i + 1)).ToString()); this.ToXlsFile(this.lvw, str, "page" + ((i + 1)).ToString()); files.Add(str); } } } } if (!this.IsMultiPageOut) { string str2 = Path.Combine(this.tmpPath, "page1"); this.ToXlsFile(this.lvw, str2, "page1"); files.Add(str2); } if (files.Count > 0) { try { this.excelPipe.UnionBooks(files); this.excelPipe.RemoveWorkSheet(1); } catch (Exception exception) { MessageBoxPLM.Show(exception.Message); } finally { try { this.excelPipe.QuitAll(strFileName); } catch (Exception exception2) { MessageBoxPLM.Show(exception2.Message); } } } }
private void FrmFilterData_Load(object sender, EventArgs e) { ArrayList attrList = new ArrayList(); ArrayList attrOuter = new ArrayList(); ArrayList list3 = new ArrayList(); try { DEMetaAttribute attribute; DEMetaClass class2 = ModelContext.MetaModel.GetClass(this.clsOid); attrList = ResFunc.CloneMetaAttrLst(ModelContext.MetaModel.GetAttributes(this.clsName)); if (this.isOnLineOutRes) { DEResFolder defolder = new DEResFolder { ClassOid = this.clsOid }; attrOuter = ResFunc.GetOuterAttr(defolder); this.SetAttrDataType(attrList, attrOuter); } if (class2.IsRefResClass) { DEMetaClass refCls = this.GetRefCls(this.clsOid); ArrayList attributes = ModelContext.MetaModel.GetAttributes(refCls.Name); ArrayList fixedAttrList = ResFunc.GetFixedAttrList(); attributes.AddRange(fixedAttrList); attrList = ResFunc.CloneMetaAttrLst(attributes); } for (int i = 0; i < attrList.Count; i++) { attribute = (DEMetaAttribute)attrList[i]; if (attribute.IsViewable) { list3.Add(attribute.Label); this.filterAttrs.Add(attribute); } } if (this.isOnLineOutRes) { PLOuterResource resource = new PLOuterResource(); ArrayList list7 = new ArrayList(); attrOuter = resource.GetOuterResAttrs(this.clsOid); ArrayList list8 = new ArrayList(); for (int j = 0; j < this.filterAttrs.Count; j++) { bool flag = false; attribute = (DEMetaAttribute)this.filterAttrs[j]; foreach (DEOuterAttribute attribute2 in attrOuter) { if (attribute2.FieldOid == attribute.Oid) { list7.Add(attribute2); flag = true; break; } } if (!flag) { list8.Add(attribute); } } foreach (DEMetaAttribute attribute3 in list8) { this.filterAttrs.Remove(attribute3); list3.Remove(attribute3.Label); } if (list7.Count > 0) { this.cobParamName.Tag = list7; } } if (list3.Count > 0) { this.cobParamName.Properties.Items.AddRange(list3.ToArray()); } } catch (Exception exception) { PrintException.Print(exception); } }
private void ResCombo_DragDrop(object sender, DragEventArgs e) { if (!base.ReadOnly) { this.LoadData(); DEMetaAttribute deMetaAttri = this.deMetaAttri; CLCopyData data = new CLCopyData(); data = (CLCopyData)e.Data.GetData(typeof(CLCopyData)); if (data != null) { string combination; if (data[0] is DEBusinessItem) { DEBusinessItem item = (DEBusinessItem)data[0]; combination = deMetaAttri.Combination; foreach (DEMetaAttribute attribute2 in this.Attrs) { if (deMetaAttri.Combination.IndexOf("[" + attribute2.Name + "]") > -1) { combination = combination.Replace("[" + attribute2.Name + "]", item.GetAttrValue(this.className, attribute2.Name).ToString()); } } combination = combination.Replace("[ID]", item.Id.ToString()); this.Text = combination.Trim(); this.ResourceOid = item.MasterOid; } else { DECopyData data2 = (DECopyData)data[0]; if (data2 != null) { if (data2.ClassName != this.className) { MessageBoxPLM.Show("资源类不匹配", "工程资源", MessageBoxButtons.OK); } else { DataRowView view = (DataRowView)data2.ItemList[0]; if (view != null) { if ((deMetaAttri != null) && (deMetaAttri.LinkType == 1)) { combination = deMetaAttri.Combination; foreach (DEMetaAttribute attribute3 in this.Attrs) { if (deMetaAttri.Combination.IndexOf("[" + attribute3.Name + "]") > -1) { string str2 = "PLM_" + attribute3.Name; combination = combination.Replace("[" + attribute3.Name + "]", Convert.ToString(view[str2])); } } if (ResFunc.IsRefRes(this.classOid)) { string str3 = "PLM_M_ID"; combination = combination.Replace("[ID]", Convert.ToString(view[str3])); } this.Text = combination.Trim(); } else { this.Text = view["PLM_ID"].ToString(); } this.ResourceOid = new Guid((byte[])view["PLM_OID"]); } } } } } } }