private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { AddEditDkCodeForm af = new AddEditDkCodeForm(); af.ShowDialog(); if (af.WasDbUpdated) { using (TenderContext tc = new TenderContext()) { codesList = new BindingList <DkCode>(tc.DkCodes.OrderBy(p => p.Code).ToList()); dkCodesTable.DataSource = codesList; } wasDbUpdated = true; } }
private void dkCodesTable_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DkCode selectedCode = dkCodesTable.SelectedRows[0].DataBoundItem as DkCode; AddEditDkCodeForm af = new AddEditDkCodeForm(selectedCode); af.ShowDialog(); if (af.WasDbUpdated) { using (TenderContext tc = new TenderContext()) { codesList = new BindingList <DkCode>(tc.DkCodes.OrderBy(p => p.Code).ToList()); dkCodesTable.DataSource = codesList; } wasDbUpdated = true; } }