Пример #1
0
        //
        // Constructor. Initialises the product database.
        //
        public ProductController() : base()
        {
            // our products will be stored in a dictionary
            products = new ProductDictionaryAdapter();

            // add some test products to the database
            SimpleProduct bookByOtero       = new SimpleProduct(1, "Software Engineering Design book", 80.00M, 0.25M);
            SimpleProduct bookByMillett     = new SimpleProduct(2, "Professional ASP.NET Design Patterns book", 50.00M, 0.50M);
            SimpleProduct notesFromLectures = new SimpleProduct(3, "Lecture slides", 10.00M, 0.00M);
            SimpleProduct notesFromLabs     = new SimpleProduct(4, "Printed lab notes", 10.00M, 0.10M);

            products.Insert(bookByOtero);
            products.Insert(bookByMillett);
            products.Insert(notesFromLectures);
            products.Insert(notesFromLabs);

            // create some product packages
            CompositeProduct bookPack  = new CompositeProduct(10, "Textbook pack", bookByOtero, bookByMillett);
            CompositeProduct notesPack = new CompositeProduct(11, "Notes pack", notesFromLectures, notesFromLabs);

            products.Insert(bookPack);
            products.Insert(notesPack);
        }
 public ProductManager(IProductGateway iProductGateway, ICommonGateway iCommonGateway)
 {
     _iProductGateway = iProductGateway;
     _iCommonGateway  = iCommonGateway;
 }
 public ProductListInteractor(IProductListOutput productOutput, IProductGateway productGateway)
 {
     this.productOutput  = productOutput;
     this.productGateway = productGateway;
 }