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); }
public int RetrieveByPK(string key, string val) { 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) { 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); }