private void btnVote_Click(object sender, EventArgs e) { oVotersLogin = new DataAccess.VotersLogin(); string sStatus = oVotersLogin.GetVotersStatus(sVoters_ID, sPassword); if (sStatus.Trim() != "ACTIVE") { oFrmMsgBox = new Forms.frmMessageBox("YOU HAVE ALREADY VOTED. PLEASE COME AGAIN THANK YOU."); oFrmMsgBox.MessageType = Forms.frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); return; } xFrm = new Forms.frmCandidate(sVoters_ID); Form_Load(xFrm); }
private void btnLogin_Click(object sender, EventArgs e) { oVotersLogin = new DataAccess.VotersLogin(); if (lblStatus.Text == "OPEN") { if (oVotersLogin.IsLogin(txtUsername.Text.Trim(), txtPassword.Text.Trim())) { string sStatus = oVotersLogin.GetVotersStatus(txtUsername.Text, txtPassword.Text); if (sStatus.Trim() != "ACTIVE") { oFrmMsgBox = new Forms.frmMessageBox("YOU HAVE ALREADY VOTED. PLEASE COME AGAIN THANK YOU."); oFrmMsgBox.MessageType = Forms.frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); return; } this.ShowInTaskbar = false; this.Hide(); oMainForm = new MAIN(txtUsername.Text, txtPassword.Text); oMainForm.ShowDialog(); } else { oFrmMsgBox = new Forms.frmMessageBox("PLEASE ENTER CORRECT USERNAME AND PASSWORD."); oFrmMsgBox.MessageType = Forms.frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); txtUsername.Focus(); } } else { oFrmMsgBox = new Forms.frmMessageBox("VOTING SCHEDULE WAS CLOSE."); oFrmMsgBox.MessageType = Forms.frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); } }