protected void AddProductButton_Click(object sender, EventArgs e) { if (IsValid) { BLProduct newProduct = new BLProduct { playFirstName = tbxFirstName.Text, playLastName = tbxLastName.Text, teamID = ddlTeam.SelectedValue, prodDescription = tbxDescription.Text, prodPrice = Convert.ToDouble(tbxPrice.Text), jerNumber = Convert.ToInt32(tbxJerNumber.Text), image = new [] { fuImgFront.FileName, fuImgBack.FileName }, stock = new[] { tbxSmall.Text == "" ? 0 : Convert.ToInt32(tbxSmall.Text), tbxMedium.Text == "" ? 0 : Convert.ToInt32(tbxMedium.Text), tbxLarge.Text == "" ? 0 : Convert.ToInt32(tbxLarge.Text), tbxXLge.Text == "" ? 0 : Convert.ToInt32(tbxXLge.Text), tbxXXL.Text == "" ? 0 : Convert.ToInt32(tbxXXL.Text) } }; uploadImageFile(fuImgFront); uploadImageFile(fuImgBack); if (BLProduct.addProduct(newProduct)) { Response.Redirect("~/UL/AdminItemManagement"); } else { Response.Redirect("~/UL/AdminItemManagementInsert"); } } }