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

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

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

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

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

                return(true);
            }

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

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

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

            return(true);
        }