예제 #1
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)
     });
     LoadProducts();
     MessageBox.Show("Added Successfully!");
 }
예제 #2
0
 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();
 }
예제 #3
0
 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!");
 }
예제 #4
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();
     MessageBox.Show("Added!!");
 }
예제 #5
0
 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");
 }
예제 #6
0
 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!!");
 }
예제 #7
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)
     });
     //load Product
     dgwProducts.DataSource = _productDal.GetAll();
     MessageBox.Show("Added!");
 }
예제 #8
0
        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!");
        }
예제 #9
0
        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. :)");
        }
예제 #10
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!");
     }
 }
예제 #11
0
        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();

        }