Example #1
0
        public bool ChangeItem(KeyValuePair <string, long> keypair, Quotation item)
        {
            Quotation orig = this.GetObjectByKey(keypair);

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

                return(true);
            }

            return(false);
        }
Example #2
0
        public Quotation GetObjectByKey(long k_QuotationID, LV.Core.DAL.Base.IRepository repository)
        {
            if (this.Contains(GetKey(k_QuotationID)) == false)
            {
                Quotation ob = repository.GetQuery <Quotation>().FirstOrDefault(o => o.QuotationID == k_QuotationID);
                if (ob != null)
                {
                    this.Add(ob);
                }
                return(ob);
            }
            Quotation obj = this[GetKey(k_QuotationID)];

            return((Quotation)obj);
        }
Example #3
0
        public bool DeleteObject(Quotation item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Update(item);

            return(true);
        }
Example #4
0
        public bool AddObject(Quotation item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Add(item);

            return(true);
        }
Example #5
0
 protected override KeyValuePair <string, long> GetKeyForItem(Quotation item)
 {
     return(item.Key);
 }