private void btnEdit_Click(object sender, EventArgs e) { if (salesItemGridView.SelectedRows.Count > 0) { DataGridViewRow dataRow = salesItemGridView.SelectedRows[0]; int.TryParse(dataRow.Cells["id"].Value.ToString(), out int id); if (id < 0) { return; } var frmSalesItemAdd = new frmSalesItemAdd(this, userId, orderId, id); frmSalesItemAdd.ShowDialog(); } else { MessageBox.Show("Please select an order to update"); } }
private void dataRowDouble_Click(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } var dataRow = salesItemGridView.Rows[e.RowIndex]; int.TryParse(dataRow.Cells["id"].Value.ToString(), out int id); if (id < 0) { return; } var frmSalesItemAdd = new frmSalesItemAdd(this, userId, orderId, id); frmSalesItemAdd.ShowDialog(); }
private void btnAdd_Click(object sender, EventArgs e) { var frmSalesItemAdd = new frmSalesItemAdd(this, userId, orderId, true); frmSalesItemAdd.ShowDialog(); }