private void btnEntry_Click(object sender, EventArgs e) { if (cmbServiceClassCode.SelectedIndex == -1 || txtCompname.Text == string.Empty || txtCompidentification.Text == string.Empty || cmbStandardentryclasscode.SelectedIndex == -1 || txtOrgstatuscode.Text == string.Empty || txtODFIidentification.Text == string.Empty || txtBatchno.Text == string.Empty) { MessageBox.Show("Insufficient Data to Proceed"); if (Convert.ToBoolean(DialogResult.OK)) { this.Show(); } } string s = cmbStandardentryclasscode.SelectedItem.ToString(); try { if (s == "CCD") { frmEntryDetails frmentry = new frmEntryDetails(s); frmentry.ShowDialog(this); } else { frmEntryDetails frmentry = new frmEntryDetails(s); frmentry.ShowDialog(this); } } catch (Exception ex) { } }