public RescrUsedInOperation GetObjectByKey(object keypair)
        {
            if (this.Contains(GetKey(keypair)) == false)
            {
                return(null);
            }
            RescrUsedInOperation ob = this[GetKey(keypair)];

            return((RescrUsedInOperation)ob);
        }
        public RescrUsedInOperation GetObjectByKey(long k_RescrID)
        {
            if (this.Contains(GetKey(k_RescrID)) == false)
            {
                return(null);
            }
            RescrUsedInOperation ob = this[GetKey(k_RescrID)];

            return((RescrUsedInOperation)ob);
        }
        public RescrUsedInOperation GetObjectByKey(KeyValuePair <string, long> keypair)
        {
            if (this.Contains(keypair) == false)
            {
                return(null);
            }
            RescrUsedInOperation ob = this[keypair];

            return((RescrUsedInOperation)ob);
        }
        public bool ChangeItem(KeyValuePair <string, long> keypair, RescrUsedInOperation item)
        {
            RescrUsedInOperation orig = this.GetObjectByKey(keypair);

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

                return(true);
            }

            return(false);
        }
        public RescrUsedInOperation GetObjectByKey(long k_RescrID, LV.Core.DAL.Base.IRepository repository)
        {
            if (this.Contains(GetKey(k_RescrID)) == false)
            {
                RescrUsedInOperation ob = repository.GetQuery <RescrUsedInOperation>().FirstOrDefault(o => o.RescrID == k_RescrID);
                if (ob != null)
                {
                    this.Add(ob);
                }
                return(ob);
            }
            RescrUsedInOperation obj = this[GetKey(k_RescrID)];

            return((RescrUsedInOperation)obj);
        }
        public bool DeleteObject(RescrUsedInOperation item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Update(item);

            return(true);
        }
        public bool AddObject(RescrUsedInOperation item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Add(item);

            return(true);
        }
 protected override KeyValuePair <string, long> GetKeyForItem(RescrUsedInOperation item)
 {
     return(item.Key);
 }