private void Initialize() { string str4 = "PLM_CUS_" + this.clsName; UCCusResource.GetData(out Stamp, out this.myds, this.clsName, this.attrs); if (this.myds != null) { this.metaAttr = (DEMetaAttribute)base.Tag; if (((this.metaAttr != null) && (this.metaAttr.LinkType == 1)) && (this.metaAttr.Combination != "")) { DataColumn column = new DataColumn("PLM_Res_ComColumn") { DataType = typeof(string) }; this.myds.Tables[str4].Columns.Add(column); foreach (DataRow row in this.myds.Tables[str4].Rows) { string combination = this.metaAttr.Combination; string str3 = combination; foreach (DEMetaAttribute attribute in this.attrs) { if (this.metaAttr.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["PLM_Res_ComColumn"] = combination; } } else if ((this.metaAttr.LinkType == 0) && (this.metaAttr.DataType == 8)) { DataColumn column2 = new DataColumn("PLM_Res_ComColumn") { DataType = typeof(string) }; this.myds.Tables[str4].Columns.Add(column2); foreach (DataRow row2 in this.myds.Tables[str4].Rows) { row2["PLM_Res_ComColumn"] = row2["PLM_ID"].ToString(); } this.resOid = this.GetResourceOID(this.txtInput.Text, this.clsName); } this.myView = this.myds.Tables[str4].DefaultView; if (this.txtInput != null) { this.flag = 0; this.attrValue = this.txtInput.Text.Trim(); } } }
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); }
public Guid GetResourceOID(string id, string clsName) { string str = "PLM_CUS_" + this.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 (PLMException exception) { PrintException.Print(exception); } catch (Exception exception2) { MessageBoxPLM.Show("error!" + exception2.Message, "工程资源"); } } return(empty); }
public string GetResourceID(Guid resOID, string clsName) { string str = "PLM_CUS_" + this.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 (PLMException exception) { PrintException.Print(exception); } catch (Exception exception2) { MessageBoxPLM.Show("error!" + exception2.Message, "工程资源"); } } return(str2); }