private void searchbtn_Click(object sender, EventArgs e) { if (customernametb.Text != "" && contacttb.Text != "" && addresstb.Text != "" && typecb.Text != "") { if (contacttb.TextLength == 11) { MessageBox.Show(lc.assignMembership(customernametb.Text, contacttb.Text, addresstb.Text, Convert.ToInt32(typecb.SelectedValue))); } else { MessageBox.Show("ContactNo Must be of 11 digits", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Please fill properly the required Fields", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } }