| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System.Collections.Generic;
- namespace MAX.Models
- {
- public class ProductCatalogue
- {
- public Network AddNetwork(int id, string name)
- {
- var network = new Network()
- {
- Id = id,
- Name = name
- };
- Networks.Add(network);
- NetworkMap.Add(id, network);
- return network;
- }
- public Product AddProduct(Network network, int id, decimal faceValue, string description,
- Batch.Vouchertype voucherType, decimal discountPercentage)
- {
- var product = new Product()
- {
- Id = id,
- Network = network,
- FaceValue = faceValue,
- Description = description,
- VoucherType = voucherType,
- DiscountPercentage = discountPercentage
- };
- network.Products.Add(product);
- ProductMap.Add(id, product);
- return product;
- }
- public List<Network> Networks { get; set; } = new List<Network>();
- public Dictionary<int, Network> NetworkMap { get; set; } = new Dictionary<int, Network>();
- public Dictionary<int, Product> ProductMap { get; set; } = new Dictionary<int, Product>();
- }
- }
|