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

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

            return((refDepreciationType)ob);
        }
        public refDepreciationType GetObjectByKey(int k_DeprecTypeID)
        {
            if (this.Contains(GetKey(k_DeprecTypeID)) == false)
            {
                return(null);
            }
            refDepreciationType ob = this[GetKey(k_DeprecTypeID)];

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

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

                return(true);
            }

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

            return((refDepreciationType)obj);
        }
 protected override KeyValuePair <string, int> GetKeyForItem(refDepreciationType item)
 {
     return(item.Key);
 }
        public bool DeleteObject(refDepreciationType item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Update(item);

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

            return(true);
        }