private void btnCreateNew_Click(object sender, EventArgs e) { //Insert ComEdit frmInsCom = new ComEdit(); frmInsCom.ShowDialog(); if (frmInsCom.success) { ComList = SelectComRecs(); FillDataGridView(dgvComRecs, ComList); } }
private void tsmiUpd_Click(object sender, EventArgs e) { //Update if (dgvComRecs.SelectedRows.Count > 0) { int Id = Convert.ToInt32(dgvComRecs.SelectedRows[0].Cells["com_Id"].Value.ToString()); Company com = ComList.Where(i => i.Id == Id).First(); ComEdit frmUpdCom = new ComEdit(com); frmUpdCom.ShowDialog(); if (frmUpdCom.success) { ComList = SelectComRecs(); FillDataGridView(dgvComRecs, ComList); } } }