private void dgCompanyRecord_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { try { this.Hide(); DataGridViewRow dr = dgCompanyRecord.SelectedRows[0]; CompanyInfoUI aCompanyInformationUi = new CompanyInfoUI(); aCompanyInformationUi.Show(); aCompanyInformationUi.txtiD.Text = dr.Cells[0].Value.ToString(); aCompanyInformationUi.txtName.Text = dr.Cells[1].Value.ToString(); aCompanyInformationUi.txtContactPerson.Text = dr.Cells[2].Value.ToString(); aCompanyInformationUi.txtContactNo.Text = dr.Cells[3].Value.ToString(); aCompanyInformationUi.txtAltrContactNo.Text = dr.Cells[4].Value.ToString(); aCompanyInformationUi.txtAddress.Text = dr.Cells[5].Value.ToString(); aCompanyInformationUi.txtEmail.Text = dr.Cells[6].Value.ToString(); aCompanyInformationUi.btnDelete.Enabled = true; aCompanyInformationUi.btnUpdate.Enabled = true; aCompanyInformationUi.btnSave.Enabled = false; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CompanyRecordUI_FormClosing(object sender, FormClosingEventArgs e) { CompanyInfoUI aCompanyInformationUi = new CompanyInfoUI(); aCompanyInformationUi.Show(); }
private void companyInformationToolStripMenuItem_Click(object sender, EventArgs e) { CompanyInfoUI aUi = new CompanyInfoUI(); aUi.Show(); }