Esempio n. 1
0
 private void btnSelect_Click(object sender, EventArgs e)
 {
     if (dgvProducts.SelectedRows.Count > 0)
     {
         this.Product = lstProducts.Products.FirstOrDefault(c => c.ID == Guid.Parse(dgvProducts.SelectedRows[0].Cells[0].Value.ToString()));
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
     else
     {
         MessageBox.Show("Select a Product");
     }
 }
Esempio n. 2
0
 private void btnNewProduct_Click(object sender, EventArgs e)
 {
     Product product = new Product();
     product.Name = txtProductName.Text;
 }
Esempio n. 3
0
 private void btnSelectProduct_Click(object sender, EventArgs e)
 {
     SelectProduct productForm = new SelectProduct();
     productForm.lstProducts = lstProduct;
     if (productForm.ShowDialog() == DialogResult.OK)
     {
         this.product = productForm.Product;
         txtProduct.Text = this.product.Name;
     }
 }