コード例 #1
0
ファイル: Form1.cs プロジェクト: hilal-bstn/AdoNetDemo
 private void btnAdd_Click_1(object sender, EventArgs e)
 {
     _productDal.Add(new Product {
         Name = tbxName.Text, UnitPrice = Convert.ToDecimal(tbxUnitPrice.Text), StockAmount = Convert.ToInt32(tbxStockAmount.Text)
     });
     MessageBox.Show("Product Added");
     LoadPRoducts();
 }
コード例 #2
0
 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();
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: afetaghayeva/AdoNetDemo
 private void btnAdd_Click(object sender, EventArgs e)
 {
     _productDal.Add(new Product()
     {
         Name         = tbxAddName.Text,
         UnitPrice    = Convert.ToDecimal(tbxAddUnitPrice.Text),
         UnitsInStock = Convert.ToInt32(tbxAddUnitPrice.Text)
     });
     LoadProducts();
     MessageBox.Show("Product Added!!");
 }
コード例 #4
0
 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)
     });
     ShowAllItems();
     MessageBox.Show("Product Successfully Added :)");
 }
コード例 #5
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     _productdal.Add(new Product
     {
         Name        = tbxName.Text,
         UnitPrice   = Convert.ToInt32(tbxUnitPrice.Text),
         StockAmount = Convert.ToInt32(tbxStockAmount.Text)
     });
     MessageBox.Show("product added");
     TabloGetir();
 }
コード例 #6
0
ファイル: Form1.cs プロジェクト: grknclsr/AdoNetDemo
 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)
     });
     dgwProducts.DataSource = _productDal.GetAll();
     MessageBox.Show("Product Added!");
 }
コード例 #7
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     _productDal.Add(new Product
     {
         Name        = tbxName.Text,
         UnitPrice   = Convert.ToDecimal(tbxUnitePrice.Text),
         StockAmount = Convert.ToInt32(tbxStockAmount.Text)
     });
     LoadProducts();                 /// anlık olarak eklemeş olduk
     MessageBox.Show(" Product Added !");
 }
コード例 #8
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     _productDal.Add(new Product
     {
         Name        = tbxName.Text,
         UnitPrice   = decimal.Parse(tbxUnitPrice.Text),
         StockAmount = int.Parse(tbxStockAmount.Text)
     });
     MessageBox.Show("Product added!");
     LoadProducts();
 }
コード例 #9
0
 private void button1_Click(object sender, EventArgs e)
 {
     _productDal.Add(new Product
     {
         Name        = tbxName.Text,
         UnitPrice   = Convert.ToDecimal(tbxuUnitPrice.Text),
         StockAmount = Convert.ToInt32(tbxStockAmount.Text),
     });
     LoadProducts();
     MessageBox.Show("Product added!");
 }
コード例 #10
0
ファイル: Form1.cs プロジェクト: emirozgur/cSharpCourse
        //(95)//////////////////////// ÜRÜN EKLEME İŞLEMİNİN YAZILMASI //////////////////////////////

        private void btnAdd_Click(object sender, EventArgs e)       //(95)Ekleme butonu eventi
        {
            _productDal.Add(new Product                             //(95) Ekleme metodu parametre göndereceğinden Product sınıfına propertyleri kullanmak üzere instance edildi.
            {
                Name        = tbxName.Text,                         //(95)Textboxlardan veriler çekildi ,convert edilerek property nesnelerine atandı
                UnitPrice   = Convert.ToDecimal(tbxUnitPrice.Text), //(95)
                StockAmount = Convert.ToInt32(tbxStockAmount.Text)  //(95)
            });

            LoadProducts();

            MessageBox.Show("Product Added!");
        }
コード例 #11
0
 private void btnInsert_Click(object sender, EventArgs e)
 {
     _productDal.Add(new Product
     {
         ProducName  = textProductName.Text,
         UnitePrice  = Convert.ToDecimal(textUnitePrice.Text),
         StockAmount = Convert.ToInt32(textStockAmount.Text)
     }
                     );
     TextClear();
     LoadProducts();
     MessageBox.Show("Product Added!");
 }
コード例 #12
0
        private void btnInsert_Click(object sender, EventArgs e)
        {
            _productDal.Add(new Product
            {
                Name         = txtInsertName.Text,
                CategoryId   = cmbInsertCategory.SelectedIndex,
                UnitPrice    = Convert.ToDecimal(txtInsertPrice.Text),
                StockAmount  = Convert.ToInt32(txtInsertStock.Text),
                Status       = chbInsertStatus.Checked,
                RegisterDate = DateTime.Now
            });

            LoadProducts();
            MessageBox.Show("Product Added!");
        }
コード例 #13
0
 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!");
     }
 }