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

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

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

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

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

                return(true);
            }

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

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

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

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