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