public int RetrieveByPK(string key, string val) { XmlEns ens = null; // Cash.GetObj(this.GetNewEntities.ToString(), Depositary.Application) as XmlEns; if (ens == null) { ens = this.GetNewEntities; ens.RetrieveAll(); } int i = 0; foreach (XmlEn en in ens) { if (en.GetValStringByKey(key) == val) { this.Row = en.Row; i++; } } if (i == 1) { return(1); } if (i > 1) { // BP.SystemConfig.DoClearCash(); throw new Exception("@XML = " + this.ToString() + " 中 PK=" + val + "不唯一。。。。"); } return(0); }
public int Retrieve(string key, string val, string key1, string val1) { XmlEns ens = Cash.GetObj(this.GetNewEntities.ToString(), Depositary.Application) as XmlEns; if (ens == null) { ens = this.GetNewEntities; ens.RetrieveAll(); } int i = 0; foreach (XmlEn en in ens) { if (en.GetValStringByKey(key) == val && en.GetValStringByKey(key1) == val1) { this.Row = en.Row; i++; } } if (i == 1) { return(1); } return(0); }
/// <summary> /// 指定属性查询 /// </summary> /// <param name="key">属性值</param> /// <param name="val">属性</param> public int RetrieveBy_del(string key, string val) { XmlEns ens = this.GetNewEntities; ens.RetrieveAll(); ens.RetrieveBy(key, val); if (ens.Count == 0) { return(0); } this.Row = ens[0].Row; return(ens.Count); }