Beispiel #1
0
        protected virtual void AddProductToState(Product product, IOrderState orderState)
        {
            var products = new List<Product>(orderState.Products);
            products.Add(product);

            orderState.Products = products;
        }
    public List <BusinessLogic.Product> getCatalogProducts()
    {
        List <CatalogItem>           items    = Catalog.getItemsForCatalog(1);
        List <BusinessLogic.Product> products = new List <BusinessLogic.Product>();

        foreach (CatalogItem item in items)
        {
            int id = item.productId;
            BusinessLogic.Product p = new BusinessLogic.Product(id);
            ProductMapper.getProductById(p);

            products.Add(p);
        }

        return(products);
    }
        private void btnAddItem_Click(object sender, EventArgs e)
        {
            tempItem.catalogId = this.catalogId;
            tempItem.productId = this.itemId;
            BusinessLogic.Product p = new BusinessLogic.Product(itemId);
            tempItem.productName = ProductMapper.getProductById(p).Name;

            if (editing == true)
            {
            }
            else if (editing == false)
            {
                CatalogItem.insertCatalogItem(tempItem);
            }
            CatalogScreen cs = new CatalogScreen(this.catalogId);

            cs.MdiParent = this.MdiParent;
            cs.Show();
            this.Close();
        }