protected void btnSubmit_Click(object sender, EventArgs e)
    {
        Boolean success = false;
        if (IsValid)
        {
            InventoryItem inventoryItem = new InventoryItem();
            inventoryItem.setProductName(txtProductName.Text);
            inventoryItem.setProductCount(Convert.ToInt32(txtProductCount.Text));
            inventoryItem.setItemsOnHold(Convert.ToInt32(txtItemsOnHold.Text));
            inventoryItem.setUnitPrice(Convert.ToDouble(txtUnitPrice.Text));
            inventoryItem.setSalePrice(Convert.ToDouble(txtSalePrice.Text));
            inventoryItem.setShortDescription(txtShortDescription.Text);
            inventoryItem.setLongDescription(txtLongDescription.Text);
            if (ImageFileUpload.PostedFile.ContentType == "image/jpeg" || ImageFileUpload.PostedFile.ContentType == "image/png")
            {
                String filename = Path.GetFileName(ImageFileUpload.FileName);
                ImageFileUpload.SaveAs(Server.MapPath("~/Graphics/" + filename));
                inventoryItem.setImageUrl(ImageFileUpload.FileName);
                success = InventoryManager.insertNewItem(inventoryItem);
            }
            else
            {
                lblMsg.Text = "There is a problem with your image. It must be .jpg or .png. Please try again.";
            }
            if (success)
            {
                InventoryPurchaseInfo purchaseInfo = new InventoryPurchaseInfo();
                InventoryItem item = InventoryManager.getItemByName(txtProductName.Text);

                purchaseInfo.inventoryItemId = item.getInventoryId();

                purchaseInfo.manufacturerId = Convert.ToInt32(ddlManufacturer.SelectedValue);
                purchaseInfo.minInventory = Convert.ToInt32(txtMinumInventory.Text);

                success = PurchaseManager.addNewInventoryPurchaseInfo(purchaseInfo);
            }
            if (success)
            {
                lblMsg.Text = "Item successfuly added.";
            }

        }
    }
 private void setUpdateItem(InventoryItem updateItem)
 {
     updateItem.setProductName(txtProductName.Text);
     updateItem.setProductCount(Convert.ToInt32(txtProductCount.Text));
     updateItem.setItemsOnHold(Convert.ToInt32(txtItemsOnHold.Text));
     updateItem.setUnitPrice(Convert.ToDouble(txtUnitPrice.Text));
     updateItem.setSalePrice(Convert.ToDouble(txtSalePrice.Text));
     updateItem.setShortDescription(txtShortDescription.Text);
     updateItem.setLongDescription(txtLongDescription.Text);
 }