private void btnCandidate_Click(object sender, EventArgs e) { IsDBExists(); ClearControls(); oElection = new DataAccess.SystemFunction(); if (!oElection.IsElectionCodeActive()) { oFrmMsgBox = new Forms.frmMessageBox("THERE IS NO ACTIVE ELECTION TICKET NUMBER. PLEASE OPEN FIRST TO START. THANK YOU. CLICK : UTILITY ELECTION TICKET NO"); oFrmMsgBox.MessageType = Forms.frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); return; } xFrm = new Forms.frmCandidateList(); Form_Load(xFrm); }
private void btnLock_Click(object sender, EventArgs e) { oDatabase = new DataAccess.SystemFunction(); if (!oDatabase.IsDatabaseExits()) { oFrmMsgBox = new Forms.frmMessageBox("DATABASE DOES NOT EXISTS. PLEASE RESTORE FIRST THE DATABASE. THANK YOU"); oFrmMsgBox.MessageType = Forms.frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); Maintenance.frmBackupRestoreDB oFrmDB = new Maintenance.frmBackupRestoreDB(); oFrmDB.ShowDialog(); return; } ClearControls(); Forms.frmLock oFrm = new Forms.frmLock(eVariable.sPassword); oFrm.ShowDialog(); }
void LoadRecords() { try { oGenerateKey = new DataAccess.SystemFunction(); dgDetails.Rows.Clear(); foreach (DataRow row in oGenerateKey.getGeneratedKey("STUDENT ID", tbxSearch.Text).Rows) { dgDetails.Rows.Add(row["ID"], row["VOTERS_ID"], row["GENERATED_KEY"], row["DATE_ADDED"], "ROLLY", row["ELECTION_CODE"], row["STATUS"]); } lblTotalRecords.Text = dgDetails.Rows.Count.ToString(); } catch (Exception ex) { } }
private void btnGenerate_Click(object sender, EventArgs e) { oStudent = new DataAccess.Student(); oElection = new DataAccess.SystemFunction(); if (!oElection.IsElectionCodeActive()) { oFrmMsgBox = new Forms.frmMessageBox("THERE IS NO ACTIVE ELECTION TICKET NUMBER. PLEASE OPEN FIRST TO START. THANK YOU. CLICK : UTILITY ELECTION TICKET NO"); oFrmMsgBox.MessageType = Forms.frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); return; } foreach (DataRow row in oElection.getElectionCode("", "").Rows) { sElectionCode = row["CODE"].ToString(); } foreach (DataRow row in oStudent.getStudent("", "").Rows) { oKeyGenerator = new CommonFunction.CommonFunction(); oGenerateKey = new DataAccess.SystemFunction(); oMGenerateKey = new Model.GenerateKey(); oMGenerateKey.GENERATED_KEY = oKeyGenerator.GetAssortedString(5); oMGenerateKey.VOTERS_ID = row["STUDENT_ID"].ToString(); oMGenerateKey.DATED_ADDED = DateTime.Now.ToString("yyyy-MM-dd"); oMGenerateKey.ELECTION_CODE = sElectionCode; oMGenerateKey.STATUS = "ACTIVE"; if (!oGenerateKey.IsKeyExists(oMGenerateKey.VOTERS_ID)) { oGenerateKey.InsertKey(oMGenerateKey); } } LoadRecords(); }
void GetVotingSchedule() { oVotingSched = new DataAccess.SystemFunction(); foreach (DataRow row in oVotingSched.GetVotingSchedule().Rows) { dDateEnd = row["DATE_END"].ToString(); dDateStart = row["DATE_START"].ToString(); tTimeStart = row["TIME_START"].ToString(); tTimeEnd = row["TIME_END"].ToString(); sStatus = row["STATUS"].ToString().Trim(); } if (sStatus != "CLOSED") { if (Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")) > Convert.ToDateTime(dDateEnd)) { oVotingSched.UpdateScheduleStatus(); } } lblCurrentDate.Text = DateTime.Now.ToString("yyyy-MM-dd h:mm:ss tt"); GetScheduleStatus(); }