protected void btnAdd_Click(object sender, EventArgs e) { Product yeniürün = new Product(); yeniürün.ProductName = txtProduct.Text; yeniürün.Discontinued = Convert.ToBoolean(txtDiscontinued.Text); _productManagementBLL.AddProduct(yeniürün); RefreshDataSource(); Literal1.Text = "<h1>Ekleme Başarılı</h1>"; }
protected void btnNewProduct_Click(object sender, EventArgs e) { int effectedRowCount = 0; int inputPrice = 0; if (!int.TryParse(txtQuantity.Text, out inputPrice)) { ltlState.Text = "Doğru türde veri giriniz (TamSayı)"; } else { _productManagementBLL.AddProduct(txtProductName.Text, Convert.ToInt32(ddlSupplier.SelectedValue), Convert.ToInt32(ddlCategory.SelectedValue), txtQuantity.Text, Convert.ToBoolean(txtDiscontinued.Text), out effectedRowCount); ltlState.Text = string.Format("<h1>{0} satır etkilendi.</h1>", effectedRowCount.ToString()); } }