private void checkButton_Click(object sender, EventArgs e) { int status = CenterHandler.GetCenterStatus(LoginHandler.CenterId); if (status == 1) { if (nidTextBox.Text != "") { try { long nid = long.Parse(nidTextBox.Text); int voterStatus = VoterHandler.CheckStatus(nid); if (voterStatus == 0) { MessageBox.Show("Cannot find the NID."); } else if (voterStatus == 1) { MessageBox.Show("Valid NID."); } else if (voterStatus == 2) { MessageBox.Show("Valid NID and Processed, but did not vote"); } else if (voterStatus == 3) { MessageBox.Show("Vote Completed"); } } catch (Exception ex) { MessageBox.Show("Enter proper NID."); } } else { MessageBox.Show("Enter proper NID."); } } else if (status == 2) { MessageBox.Show("Center is blocked."); } else { MessageBox.Show("Election is not going on currently."); } }