private void GridViewProduct_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { int id = Convert.ToInt32(GridViewProduct.CurrentRow.Cells["IdProduct"].Value); Product product = logic.GetProductById(id); txtProductId.Text = product.IdProduct.ToString(); txtProductName.Text = product.Name; txtPrice.Text = product.Price.ToString(); }
public Product GetProductById(int id) { GetDataLogic logic = new GetDataLogic(); return(logic.GetProductById(id)); }