Beispiel #1
0
        internal CatalogEntry TryGet(int id)
        {
            CatalogEntry entry = new CatalogEntry();

            entry = _catalogRepository.TryGet(id);
            return(entry);
        }
 public void Add( CatalogEntry entry )
 {
     using ( var context = _createStoreContext() )
     {
         context.CatalogEntries.Add( entry );
         context.SaveChanges();
     }
 }
 public bool Update( CatalogEntry entry )
 {
     using ( var context = _createStoreContext() )
     {
         context.Entry( entry ).State = EntityState.Modified;
         context.SaveChanges();
     }
     return true;
 }
 public void Delete( CatalogEntry entry )
 {
     using ( var context = _createStoreContext() )
     {
         context.CatalogEntries.Attach( entry );
         context.CatalogEntries.Remove( entry );
         context.SaveChanges();
     }
 }
Beispiel #5
0
        public PurchaseRecord RecordPurchase(CatalogEntry entry, int quantity)
        {
            PurchaseRecord purchaseRecord = new PurchaseRecord()
            {
                ProductName    = entry.ProductName,
                ProductVersion = entry.ProductVersion,
                Description    = entry.Blurb,
                LicensingBasis = entry.LicensingBasis,
                Quantity       = quantity
            };

            return(Add(purchaseRecord));
        }
Beispiel #6
0
        public PurchaseRecord RecordPurchase( CatalogEntry entry, int quantity )
        {
            PurchaseRecord purchaseRecord = new PurchaseRecord()
            {
                ProductName = entry.ProductName,
                ProductVersion = entry.ProductVersion,
                Description = entry.Blurb,
                LicensingBasis = entry.LicensingBasis,
                Quantity = quantity
            };

            return Add( purchaseRecord );
        }
Beispiel #7
0
 internal void Update( CatalogEntry entry )
 {
     _catalogRepository.Update( entry );
 }
Beispiel #8
0
 internal CatalogEntry TryGet( int id )
 {
     CatalogEntry entry = new CatalogEntry();
     entry = _catalogRepository.TryGet( id );
     return entry;
 }
Beispiel #9
0
 internal void Delete( CatalogEntry entry )
 {
     _catalogRepository.Delete( entry );
 }
Beispiel #10
0
 public void Add( CatalogEntry entry )
 {
     _catalogRepository.Add( entry );
 }
Beispiel #11
0
 internal void Update(CatalogEntry entry)
 {
     _catalogRepository.Update(entry);
 }
Beispiel #12
0
 internal void Delete(CatalogEntry entry)
 {
     _catalogRepository.Delete(entry);
 }
Beispiel #13
0
 public void Add(CatalogEntry entry)
 {
     _catalogRepository.Add(entry);
 }
 public static CatalogEntry ToServiceModel( this CatalogEntryModel model )
 {
     CatalogEntry entry = new CatalogEntry
     {
         Id = model.Id,
         ProductName = model.ProductName,
         ProductVersion = model.ProductVersion,
         Blurb = model.Blurb,
         Price = model.Price,
         SkuId = model.SkuId,
         LicensingBasis = model.LicensingBasis
     };
     return entry;
 }