private void addButton_Click(object sender, EventArgs e)
 {
     try
     {
         string          name            = tProductName.Text;
         double          price           = double.Parse(tProductPrice.Text);
         string          categoryName    = tProductCategoryName.Text;
         string          description     = tProductDescription.Text;
         int             row             = int.Parse(tProductRow.Text);
         int             column          = int.Parse(tProductColumn.Text);
         int             size            = int.Parse(tProductSize.Text);
         int             quantity        = int.Parse(tProductQuantity.Text);
         ProductCategory productCategory = new ProductCategory(categoryName, description);
         Product         product         = new Product(name, price, productCategory);
         ProductPosition productPosition = new ProductPosition(row, column);
         containableItem = new ContainableItem(productPosition, size, product);
         ProductBand productBand = new ProductBand(new List <ContainableItem>());
         productBand.AddManyItems(containableItem, quantity);
         bandList.Add(productBand);
     }
     catch (FormatException)
     {
         MessageBox.Show("Some input value is wrong! Please try again!",
                         "Wrong input",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Information);
     }
 }
예제 #2
0
 public ContainableItem(ProductPosition productPosition, int size, Product product)
 {
     _productPositon = productPosition;
     _size           = size;
     _product        = product;
 }