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

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

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

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

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

                return(true);
            }

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

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

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

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