private void bNewContract_Click(object sender, EventArgs e) { AddEditContractForm contractForm = new AddEditContractForm(true, -1, customerId); var result = contractForm.ShowDialog(); if (result == DialogResult.OK) { ContractRepository repository = new ContractRepository(); radGridView1.DataSource = repository.getContractsByCustomerId(customerId).ToList(); } }
private void radGridView1_CellDoubleClick(object sender, GridViewCellEventArgs e) { if (e.RowIndex != -1) { int contractId = Convert.ToInt32(radGridView1.Rows[e.RowIndex].Cells[0].Value.ToString()); AddEditContractForm contractForm = new AddEditContractForm(false, contractId, customerId); var result = contractForm.ShowDialog(); if (result == DialogResult.OK) { ContractRepository repository = new ContractRepository(); radGridView1.DataSource = repository.getContractsByCustomerId(customerId).ToList(); } } }