private void btnEdit_Click(object sender, EventArgs e) { if (orderGridView.SelectedRows.Count > 0) { DataGridViewRow dataRow = orderGridView.SelectedRows[0]; int.TryParse(dataRow.Cells["id"].Value.ToString(), out int id); if (id < 0) { return; } var frmPurchaseOrderAdd = new frmPurchaseOrderAdd(this, userId, id); frmPurchaseOrderAdd.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 = orderGridView.Rows[e.RowIndex]; int.TryParse(dataRow.Cells["id"].Value.ToString(), out int id); if (id < 0) { return; } var frmPurchaseOrderAdd = new frmPurchaseOrderAdd(this, userId, id); frmPurchaseOrderAdd.ShowDialog(); }
private void btnAdd_Click(object sender, EventArgs e) { var frmPurchaseOrderAdd = new frmPurchaseOrderAdd(this, userId); frmPurchaseOrderAdd.ShowDialog(); }