Exemplo n.º 1
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);
        }
Exemplo n.º 2
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();
                //Cash.SetConn(this.GetNewEntities.ToString(), Depositary.Application) as XmlEns;
            }

            int i = 0;

            foreach (XmlEn en in ens)
            {
                if (en.GetValStringByKey(key).Equals(val))
                {
                    this.Row = en.Row;
                    i++;
                    break;
                }
            }
            if (i == 1)
            {
                return(1);
            }

            if (i > 1)
            {
                // BP.Sys.SystemConfig.DoClearCash();
                throw new Exception("@XML=[" + this.ToString() + "]中PK=" + val + "不唯一...");
            }
            return(0);
        }