private void btnAdd_Click(object sender, EventArgs e) { _productDal.Add(new Product { Name = tbxName.Text, UnitPrice = Convert.ToDecimal(tbxUnitPrice.Text), StockAmount = Convert.ToInt32(tbxStockAmount.Text) }); LoadProducts(); MessageBox.Show("Added Successfully!"); }
private void btnAdd_Click(object sender, EventArgs e) { _productDal.Add(new Product { Name = tbxName.Text.ToString(), UnitPrice = Convert.ToDecimal(tbxUnitPrice.Text), StockAmount = Convert.ToInt32(tbxStockAmount.Text) }); loadProducts(); }
private void btnAdd_Click(object sender, EventArgs e) { _prodcDal.Add(new Product() { Name = txtName.Text, UnitPrice = Convert.ToDecimal(txtUnitePrice.Text), StockAmount = Convert.ToInt32(txtStockAmount.Text) }); GetProductList(); MessageBox.Show("Products added!"); }
private void btnAdd_Click(object sender, EventArgs e) { _productDal.Add(new Product { Name = tbxAddName.Text, UnitPrice = Convert.ToDecimal(tbxAddUnitPrice.Text), StockAmount = Convert.ToInt32(tbxAddStockAmount.Text) }); ProductLoad(); MessageBox.Show("Added!!"); }
private void button1_Click(object sender, EventArgs e) { productDal.Add(new Products { Name = textBox1.Text, UnitPrice = Convert.ToInt32(textBox2.Text), StockAmount = Convert.ToInt32(textBox3.Text) }); FillGrid(); MessageBox.Show("Added"); }
private void button1_Click(object sender, EventArgs e) { _productDal.Add(new Product { Name = textBox1.Text, UnitPrice = Convert.ToDecimal(textBox2.Text), StockAmount = Convert.ToInt32(textBox3.Text) }); LoadProducts(); MessageBox.Show("Added!!"); }
private void btnAdd_Click(object sender, EventArgs e) { _productDal.Add(new Product { Name = tbxName.Text, UnitPrice = Convert.ToDecimal(tbxUnitPrice.Text), StockAmount = Convert.ToInt32(tbxStockAmount.Text) }); //load Product dgwProducts.DataSource = _productDal.GetAll(); MessageBox.Show("Added!"); }
private void btnAdd_Click(object sender, EventArgs e) { var prod = new Product { Name = tbxName.Text, UnitPrice = Convert.ToDecimal(tbxUnitPrice.Text), StockAmount = Convert.ToInt32(tbxStockAmount.Text), }; _productdal.Add(prod); _Refresh(); MessageBox.Show("Message Added!"); }
private void btnInsert_Click(object sender, EventArgs e) { _productDal.Add(new Product { Name = txtInsertName.Text, CategoryId = Convert.ToInt16(cmbInsertCategory.SelectedIndex), UnitPrice = Convert.ToDecimal(txtInsertPrice.Text), StockAmount = Convert.ToInt16(txtInsertStock.Text), Status = Convert.ToBoolean(chbInsertStatus.Checked), RegisterDate = DateTime.Now }); LoadProducts(); MessageBox.Show("Product Added. :)"); }
private void btnAdd_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtName.Text) && !string.IsNullOrEmpty(txtUnitPrice.Text) && !string.IsNullOrEmpty(txtStockAmount.Text)) { _productDal.Add(new Product { Name = txtName.Text, StockAmount = Convert.ToInt32(txtStockAmount.Text), UnitPrice = Convert.ToDecimal(txtUnitPrice.Text) }); LoadProducts(); AddProductFormTemizle(); MessageBox.Show("Product Added!"); } else { MessageBox.Show("Fill the Form!"); } }
private void btnAdd_Click(object sender, EventArgs e) { //Bu eski hali //Product product = new Product(); //product.Name = tbxName.Text; //product.StockAmount = Convert.ToInt32(tbxStockAmount.Text); //product.UnitPrice = Convert.ToDecimal(tbxStockAmount.Text); //_productDal.Add(product); //bu da yeni öğrendiğim _productDal.Add(new Product { Name = tbxName.Text, StockAmount = Convert.ToInt32(tbxStockAmount.Text), UnitPrice = Convert.ToDecimal(tbxStockAmount.Text) }); MessageBox.Show("Added!"); LoadProducts(); }