private void btnProductChoose_Click(object sender, EventArgs e) { ProductChoose productChoose = new ProductChoose(); if (productChoose.ShowDialog() == DialogResult.OK) { txtProductId.Text = productChoose.Id.ToString(); txtPrice.Text = productChoose.PurchasePrice.ToString(); } }
private void btnProductChoose_Click(object sender, EventArgs e) { ProductChoose productChoose = new ProductChoose(); productChoose.Action = "Export"; if (productChoose.ShowDialog() == DialogResult.OK) { txtProductId.Text = productChoose.Id.ToString(); txtQuantity.Maximum = (decimal)db.Products.SingleOrDefault(x => x.Id == productChoose.Id).Quantity; txtPrice.Text = productChoose.Price.ToString(); } }