示例#1
0
        public Ward GetObjectByKey(object keypair)
        {
            if (this.Contains(GetKey(keypair)) == false)
            {
                return(null);
            }
            Ward ob = this[GetKey(keypair)];

            return((Ward)ob);
        }
示例#2
0
        public Ward GetObjectByKey(long k_WID)
        {
            if (this.Contains(GetKey(k_WID)) == false)
            {
                return(null);
            }
            Ward ob = this[GetKey(k_WID)];

            return((Ward)ob);
        }
示例#3
0
        public Ward GetObjectByKey(KeyValuePair <string, long> keypair)
        {
            if (this.Contains(keypair) == false)
            {
                return(null);
            }
            Ward ob = this[keypair];

            return((Ward)ob);
        }
示例#4
0
        public bool ChangeItem(KeyValuePair <string, long> keypair, Ward item)
        {
            Ward orig = this.GetObjectByKey(keypair);

            if (orig != null)
            {
                int index = this.IndexOf(orig);
                this.SetItem(index, item);

                return(true);
            }

            return(false);
        }
示例#5
0
        public Ward GetObjectByKey(long k_WID, LV.Core.DAL.Base.IRepository repository)
        {
            if (this.Contains(GetKey(k_WID)) == false)
            {
                Ward ob = repository.GetQuery <Ward>().FirstOrDefault(o => o.WID == k_WID);
                if (ob != null)
                {
                    this.Add(ob);
                }
                return(ob);
            }
            Ward obj = this[GetKey(k_WID)];

            return((Ward)obj);
        }
示例#6
0
        public bool DeleteObject(Ward item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Update(item);

            return(true);
        }
示例#7
0
        public bool AddObject(Ward item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Add(item);

            return(true);
        }
示例#8
0
 protected override KeyValuePair <string, long> GetKeyForItem(Ward item)
 {
     return(item.Key);
 }