private void OpenAddEdit(int companyId) { frmCompanyAddUpdate frmCompanyAddUpdate = new frmCompanyAddUpdate(companyId, txtSearch.Text); frmCompanyAddUpdate.IsInChildMode = true; frmCompanyAddUpdate.FormClosed -= frmCompanyAddUpdate_FormClosed; frmCompanyAddUpdate.FormClosed += frmCompanyAddUpdate_FormClosed; frmCompanyAddUpdate.ShowDialog(); }
private void txtSearch_TextChanged(object sender, EventArgs e) { try { ExtensionMethods.GridSelectionOnSearch(dgvCompanyList, "CompanyName", txtSearch.Text, this.lblSearchStatus); if (dgvCompanyList.Rows.Count == 0) { if (DialogResult.Yes == MessageBox.Show(Constants.Messages.NotExists, Constants.Messages.Confirmation, MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { frmCompanyAddUpdate form = new frmCompanyAddUpdate(0, txtSearch.Text); form.IsInChildMode = true; form.FormClosed += frmCompanyAddUpdate_FormClosed; form.ShowDialog(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }