private void btnSubmit_Click(object sender, EventArgs e) { String strAdminID = tbAdminID.Text; String strPassword = tbPassword.Text; strAdminID.Trim(); strPassword.Trim(); if (strAdminID.Equals("")) { MessageBox.Show("Kindly provide Admin ID.", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (strPassword.Equals("")) { MessageBox.Show("Kindly provide Password for validation.", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try { DBConnect DB = new DBConnect(); if (DB.OpenConnection()) { DB.CloseConnection(); if (!DB.ValidateAdmin(strAdminID, strPassword)) { MessageBox.Show("Invalid Userid OR Password", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } else { DB.CloseConnection(); return; } }catch (Exception e1) { return; } SATSystem.getInstance().bValidAdmin = true; SATSystem.getInstance().Initate(); if (frmLoading1 == null) { frmLoading1 = new frmLoading(); frmLoading1.strMessage = "Validating Admin Credential..."; frmLoading1.FormBorderStyle = FormBorderStyle.None; frmLoading1.FormClosed += frmLoading1_FormClosed; frmLoading1.Show(); } else { frmLoading1.Activate(); } }
private void btnRFID_Click(object sender, EventArgs e) { SATSystem.getInstance().mRFIDTagID = ""; SATSystem.getInstance().mExitCode = 0; SATSystem.getInstance().frmRFIDReader1.ShowDialog(); tbRFID.Text = SATSystem.getInstance().mRFIDTagID; SATSystem.getInstance().mRFIDTagID = ""; SATSystem.getInstance().mExitCode = 0; }
private void btnRFID_Click(object sender, EventArgs e) { SATSystem.getInstance().mRFIDTagID = ""; SATSystem.getInstance().mExitCode = 0; SATSystem.getInstance().frmRFIDReader1.ShowDialog(); string strRFID = SATSystem.getInstance().mRFIDTagID; SATSystem.getInstance().mRFIDTagID = ""; SATSystem.getInstance().mExitCode = 0; DBConnect DB = new DBConnect(); string[] student1 = new string[16]; student1 = DB.SelectStudentByRFID(strRFID); if (student1[3].Equals("Male")) { rbMale.Checked = true; } else if (student1[3].Equals("Female")) { rbFemale.Checked = true; } else { MessageBox.Show("No Student is associated with this RFID Card.", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } tbRFID.Text = strRFID; tbRollNumber.Text = student1[0]; tbName.Text = student1[1]; tbAge.Text = student1[2]; tbClass.Text = student1[4]; tbDept.Text = student1[5]; tbAcademicYear.Text = student1[6]; tbFatherName.Text = student1[7]; tbFatherContact.Text = student1[8]; tbFatherOcc.Text = student1[9]; tbMotherName.Text = student1[10]; tbMotherContact.Text = student1[11]; tbMotherOcc.Text = student1[12]; tbAddress1.Text = student1[13]; tbAddress2.Text = student1[14]; tbCity.Text = student1[15]; tbPupilID.Text = student1[16]; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //SATSystem satSystem = new SATSystem(); //satSystem.Start(); Application.Run(new frmSplashScreen()); Application.Run(new frmLogin()); if (SATSystem.getInstance().bValidAdmin) { Application.Run(new frmLandingScreen()); } }
private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { SATSystem.getInstance().mExitCode = 1; if (frmLoading1 == null) { frmLoading1 = new frmLoading(); frmLoading1.strMessage = "Student RFID Card Identified";// +SATSystem.getInstance().mRFIDTagID; frmLoading1.FormBorderStyle = FormBorderStyle.None; frmLoading1.FormClosed += frmLoading1_FormClosed; frmLoading1.Show(); } else { frmLoading1.Activate(); } }
public void StartAttendance() { SATSystem.getInstance().mExitCode = 0; while (SATSystem.getInstance().mExitCode != 2) { SATSystem.getInstance().mRFIDTagID = ""; SATSystem.getInstance().mExitCode = 0; do { SATSystem.getInstance().frmRFIDReader1.ShowDialog(); }while ((SATSystem.getInstance().mExitCode != 1) && (SATSystem.getInstance().mExitCode != 2)); if (SATSystem.getInstance().mExitCode == 1) { SATSystem.getInstance().mExitCode = 0; string strDate = DateTime.Now.ToString("ddMMyyyy"); DBConnect DB = new DBConnect(); string status = DB.InsertAttendance(strDate, SATSystem.getInstance().mRFIDTagID); if (status.Equals("Error")) { MessageBox.Show("Invalid RFID Card", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (status.Equals("ErrorDuplicate")) { //MessageBox.Show("Invalid RFID Card", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error); //return; } else { //MessageBox.Show("Attendance Marked" + SATSystem.getInstance().mRFIDTagID, "SAT System", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else if (SATSystem.getInstance().mExitCode == 2) { return; } } }
private void WorkThreadFunction(object sender, DoWorkEventArgs e) { nfc_target_t target = new nfc_target_t(); while ((libnfc.initiator_select_passive_target(ref target)) == false) { ; } string sUID = ""; for (int i = 0; i < target.nti.nai.szUidLen; i++) { sUID += Convert.ToString(target.nti.nai.abtUid[i], 16).PadLeft(2, '0'); } SATSystem.getInstance().mRFIDTagID = sUID; SATSystem.getInstance().mExitCode = 1; System.Media.SystemSounds.Beep.Play(); System.Threading.Thread.Sleep(1000); }
public void Initate() { SATSystem.getInstance().frmRFIDReader1 = new frmRFIDReader(); }
private void btnExit_Click(object sender, EventArgs e) { SATSystem.getInstance().mExitCode = 2; this.Close(); }
private void recordAttendanceToolStripMenuItem_Click(object sender, EventArgs e) { SATSystem.getInstance().StartAttendance(); }
/// <summary> /// record Attendance /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnRecordAttendance_Click(object sender, EventArgs e) { //string strDate = DateTime.Now.ToString("ddMMyyyy"); //MessageBox.Show("strDate : " + strDate, "SAT System", MessageBoxButtons.OK, MessageBoxIcon.Information); SATSystem.getInstance().StartAttendance(); }