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

            return((HIServiceItem)ob);
        }
예제 #2
0
        public HIServiceItem GetObjectByKey(long k_HISerItemID)
        {
            if (this.Contains(GetKey(k_HISerItemID)) == false)
            {
                return(null);
            }
            HIServiceItem ob = this[GetKey(k_HISerItemID)];

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

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

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

                return(true);
            }

            return(false);
        }
예제 #5
0
        public HIServiceItem GetObjectByKey(long k_HISerItemID, LV.Core.DAL.Base.IRepository repository)
        {
            if (this.Contains(GetKey(k_HISerItemID)) == false)
            {
                HIServiceItem ob = repository.GetQuery <HIServiceItem>().FirstOrDefault(o => o.HISerItemID == k_HISerItemID);
                if (ob != null)
                {
                    this.Add(ob);
                }
                return(ob);
            }
            HIServiceItem obj = this[GetKey(k_HISerItemID)];

            return((HIServiceItem)obj);
        }
예제 #6
0
        public bool DeleteObject(HIServiceItem item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Update(item);

            return(true);
        }
예제 #7
0
        public bool AddObject(HIServiceItem item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Add(item);

            return(true);
        }
예제 #8
0
 protected override KeyValuePair <string, long> GetKeyForItem(HIServiceItem item)
 {
     return(item.Key);
 }