コード例 #1
0
ファイル: Quotation.cs プロジェクト: hoangvu37/ProjectLV
        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);
        }
コード例 #2
0
ファイル: Quotation.cs プロジェクト: hoangvu37/ProjectLV
        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);
        }
コード例 #3
0
ファイル: Quotation.cs プロジェクト: hoangvu37/ProjectLV
        public bool DeleteObject(Quotation item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Update(item);

            return(true);
        }
コード例 #4
0
ファイル: Quotation.cs プロジェクト: hoangvu37/ProjectLV
        public bool AddObject(Quotation item, LV.Core.DAL.Base.IRepository repository)
        {
            repository.Add(item);

            return(true);
        }
コード例 #5
0
ファイル: Quotation.cs プロジェクト: hoangvu37/ProjectLV
 protected override KeyValuePair <string, long> GetKeyForItem(Quotation item)
 {
     return(item.Key);
 }