Beispiel #1
0
        private void buttonEmail_Click(object sender, EventArgs e)
        {
            LongNameEntryForm IDForm = new LongNameEntryForm(30, false, true);

            IDForm.DialogTitle   = LanguageTranslation.ENTER_EMAIL_ADDRESS; //just simple name at first
            IDForm.InitialString = "";
            IDForm.UsePeriod     = true;
            IDForm.UseAtSign     = true;
            IDForm.UseUnderscore = true;
            IDForm.ShowDialog();

            if (IDForm.Ok)
            {
                if (emailCheck(IDForm.Description))
                {
                    Program.logEvent("User entered Email Address: " + IDForm.Description);
                    textBoxEmail.Text = IDForm.Description;
                }
                else
                {
                    Program.logEvent("Email Address: " + IDForm.Description + " Not Formatted Properly");
                    Program.ShowErrorMessage(LanguageTranslation.EMAIL_ADDRESS_NOT_FORMATTED, 4000);
                }
            }
            else
            {
                Program.logEvent("User cancelled email address change");
            }
        }
Beispiel #2
0
        private void buttonID_Click(object sender, EventArgs e)
        {
            LongNameEntryForm IDForm = new LongNameEntryForm(Program.USER_ID_LENGTH, false, false);

            IDForm.UseSpaceBar = true;
            IDForm.DialogTitle = LanguageTranslation.ENTER_NEW_ID;
            IDForm.ShowDialog();

            if (IDForm.Ok)
            {
                Program.logEvent("User entered new user ID: " + IDForm.Description);

                if (!Program.userMgr.IsUnique(IDForm.Description))
                {
                    Program.logEvent("The user ID Number entered is not unique. User not added");
                    Program.ShowErrorMessage(LanguageTranslation.ID_NUM_NOT_UNIQUE, 3000);
                    return;
                }
                textBoxID.Text = IDForm.Description;
            }
            else
            {
                Program.logEvent("User cancelled ID change");
            }
        }
Beispiel #3
0
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     try
     {
         Program.logEvent("User selected to delete a user");
         LongNameEntryForm IDEntry = new LongNameEntryForm(Program.USER_ID_LENGTH, false, false);
         IDEntry.InitialString = "";
         IDEntry.DialogTitle   = LanguageTranslation.ENTER_USER_ID_DELETE;
         IDEntry.ShowDialog();
         Program.logEvent("User selected for deletion ID Number: " + IDEntry.Description);
         if (Program.userMgr.RemoveUser(IDEntry.Description))
         {
             Program.logEvent("User deleted with ID Number: " + IDEntry.Description);
             Program.userMgr.SaveFile();
             threeDArrayCreateAndSort();
         }
         else
         {
             if (!IDEntry.Ok)
             {
                 Program.ShowErrorMessage(LanguageTranslation.USER_NOT_EXIST, 4000);
             }
             Program.logEvent("User with ID Number " + IDEntry.Description + " does not exist");
         }
     }
     catch (Exception ex)
     {
         throw new Exception("AddUsersForm:AddUser exception: " + ex.Message);
     }
 }
Beispiel #4
0
        /// <summary>
        /// This listener responds to ID scanner errors and then cancels out of this form.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        internal void IDScanner_SnapshellMessage(object sender, SnapShell_Driver_Lic.SnapshellMessageArgs e)
        {
            //Program.ShowErrorMessage("ID Scanner Error\r\nContact Admin", 5000);
            Program.ShowErrorMessage(LanguageTranslation.ID_SCANNER_ERROR, 3000);
            Program.logEvent(e.Message);

            if (ScanType == "BARCODE" && !manualLicenseEntered)
            {
                LongNameEntryForm LicenseEntry = new LongNameEntryForm(20, false, false);
                LicenseEntry.DialogTitle = LanguageTranslation.ENTER_LICENSE_NUMBER;
                LicenseEntry.ShowDialog();

                manualLicenseEntered = true;
                if (pictureBox1.Image != null)
                {
                    pictureBox1.Image.Dispose();
                }

                if (!LicenseEntry.Ok)
                {
                    buttonCancel_Click(this, null);
                }
                else
                {
                    licensenum = '`' + LicenseEntry.Description;
                    this.Close();
                }
            }
            else
            {
                buttonCancel_Click(this, null);
            }
        }
Beispiel #5
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            Program.logEvent("User selected to add a new user");
            try
            {
                YesNoForm doAnotherDlg = new YesNoForm(LanguageTranslation.ADD_ANOTHER_USER);
                do
                {
                    string IDNumber = "";

                    //need to add swipe feature  TBD

                    LongNameEntryForm IDForm = new LongNameEntryForm(Program.USER_ID_LENGTH, false, false);
                    IDForm.UseSpaceBar = true;
                    IDForm.DialogTitle = LanguageTranslation.ENTER_ID;
                    IDForm.ShowDialog();

                    if (IDForm.Ok)
                    {
                        IDNumber = IDForm.Description;
                        Program.logEvent("User entered new user ID: " + IDNumber);

                        if (!Program.userMgr.IsUnique(IDNumber))
                        {
                            Program.logEvent("The user ID Number entered is not unique. User not added");
                            Program.ShowErrorMessage(LanguageTranslation.ID_NUM_NOT_UNIQUE, 3000);
                            return;
                        }
                    }
                    else
                    {
                        Program.logEvent("User cancelled addition");
                        return;
                    }

                    User user = new User(IDNumber);
                    AddUser(user);
                    Program.ShowErrorMessage(LanguageTranslation.USER_ADDED, 2500);

                    ModifyUsersForm ModifyNewUser = new ModifyUsersForm(user);
                    ModifyNewUser.ShowDialog();

                    doAnotherDlg.ShowDialog();
                } while (doAnotherDlg.YesResult);

                Program.userMgr.SaveFile();

                threeDArrayCreateAndSort();
            }
            catch (Exception ex)
            {
                throw new Exception("AddUsersForm:AddUser exception: " + ex.Message);
            }
        }
Beispiel #6
0
        private void buttonFirstName_Click(object sender, EventArgs e)
        {
            LongNameEntryForm IDForm = new LongNameEntryForm(20, false, true);

            IDForm.DialogTitle   = LanguageTranslation.ENTER_FIRST_NAME; //just simple name at first
            IDForm.InitialString = "";
            IDForm.ShowDialog();

            if (IDForm.Ok)
            {
                Program.logEvent("User entered first name: " + IDForm.Description);
                textBoxFirstName.Text = IDForm.Description;
            }
            else
            {
                Program.logEvent("User cancelled first name change");
            }
        }
Beispiel #7
0
        private void buttonGroup_Click(object sender, EventArgs e)
        {
            LongNameEntryForm GroupForm = new LongNameEntryForm(30, false, true);

            GroupForm.DialogTitle   = LanguageTranslation.ENTER_GROUP_NAME; //just simple name at first
            GroupForm.InitialString = "";
            GroupForm.ShowDialog();

            if (GroupForm.Ok)
            {
                Program.logEvent("User entered Group name: " + GroupForm.Description);
                textBoxGroup.Text = GroupForm.Description;
            }
            else
            {
                Program.logEvent("User cancelled Group name change");
            }
        }
Beispiel #8
0
        private void buttonDepartment_Click(object sender, EventArgs e)
        {
            LongNameEntryForm DepartmentForm = new LongNameEntryForm(30, false, true);

            DepartmentForm.DialogTitle   = LanguageTranslation.ENTER_DEPARTMENT_NAME; //just simple name at first
            DepartmentForm.InitialString = "";
            DepartmentForm.ShowDialog();

            if (DepartmentForm.Ok)
            {
                Program.logEvent("User entered Department name: " + DepartmentForm.Description);
                textBoxDepartment.Text = DepartmentForm.Description;
            }
            else
            {
                Program.logEvent("User cancelled Department name change");
            }
        }
Beispiel #9
0
        private void buttonChangeTextMsgNumber_Click(object sender, EventArgs e)
        {
            TimeOutOff();
            LongNameEntryForm buttonChangeAdminTextMsg = new LongNameEntryForm(10, false, false, LanguageTranslation.NEW_ADMIN_TXT_NUMBER);

            buttonChangeAdminTextMsg.InitialString = Program.TEXTTO_ADDRESS.Split('@')[0];
            buttonChangeAdminTextMsg.ShowDialog();
            resetTimer();

            if (buttonChangeAdminTextMsg.Ok)
            {
                string result = buttonChangeAdminTextMsg.Description;

                Program.TEXTTO_ADDRESS = result;

                CommonTasks.WriteValueToConfigurationFile("textmsg", "textToAddress", result + "@vtext.com");
            }
        }
Beispiel #10
0
        private void buttonBiometricEnrollment_Click(object sender, EventArgs e)
        {
            string data; bool screenOK;

            TimeOutOff();
            if (Program.locationdata.AdminScreenList.Contains(AdminScreenType.BiometricEnrollmentHID))
            {
                HIDCardReader HIDEntry = new HIDCardReader();
                HIDEntry.ShowDialog();
                screenOK = !HIDEntry.Cancelled;
                data     = HIDEntry.Data;
            }
            else
            {
                LongNameEntryForm IDEntry = new LongNameEntryForm(Program.PASSWORD_SIZE, false, false);
                IDEntry.DialogTitle = LanguageTranslation.ID_BIOMETRIC_ENROLLING;;
                IDEntry.ShowDialog();
                screenOK = IDEntry.Ok;
                data     = IDEntry.Description;
            }
            resetTimer();

            if (!screenOK)
            {
                return;
            }

            TimeOutOff();
            BiometricEnrollmentForm Enroll = new BiometricEnrollmentForm(data);


            if (Program.biometricMgr.FindFingerprint(data) == null)
            {
                Enroll.labelUserID.Text = LanguageTranslation.ENROLLED_FINGERPRINT_COUNT + data +
                                          " = 0";
            }
            else
            {
                Enroll.labelUserID.Text = LanguageTranslation.ENROLLED_FINGERPRINT_COUNT + data +
                                          " = " + Program.biometricMgr.FindFingerprint(data).Count;
            }
            Enroll.ShowDialog();
            resetTimer();
        }
Beispiel #11
0
        /// <summary>
        /// NOT BEING USED FOR NOW DUE TO SECURITY CONCERNS. IT IS BELIEVED TO BE TOO EASY FOR USERS TO USE SOMEONE ELSE'S LICENSE
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonManualEntry_Click(object sender, EventArgs e)
        {
            LongNameEntryForm EnterDriverFirstName = new LongNameEntryForm(20, false, false, LanguageTranslation.DRIVER_FIRST_NAME);

            EnterDriverFirstName.ShowDialog();

            if (!EnterDriverFirstName.Ok)
            {
                Program.ShowErrorMessage(LanguageTranslation.MANUAL_ID_CANCELLED, 3000);
                Program.logEvent("Manual Driver First Name Entry Cancelled");
                cancelled = true;
                this.Close();
            }

            LongNameEntryForm EnterDriverLastName = new LongNameEntryForm(20, false, false, LanguageTranslation.DRIVER_LAST_NAME);

            EnterDriverLastName.ShowDialog();

            if (!EnterDriverLastName.Ok)
            {
                Program.ShowErrorMessage(LanguageTranslation.MANUAL_ID_CANCELLED, 3000);
                Program.logEvent("Manual Driver Last Name Entry Cancelled");
                cancelled = true;
                this.Close();
            }

            LongNameEntryForm EnterDriverNumber = new LongNameEntryForm(20, false, false, LanguageTranslation.DRIVER_NUMBER);

            EnterDriverNumber.ShowDialog();

            if (!EnterDriverNumber.Ok)
            {
                Program.ShowErrorMessage(LanguageTranslation.MANUAL_ID_CANCELLED, 3000);
                Program.logEvent("Manual Driver Number Entry Cancelled");
                cancelled = true;
                this.Close();
            }

            firstname  = EnterDriverFirstName.Description;
            lastname   = EnterDriverLastName.Description;
            licensenum = EnterDriverNumber.Description;
            this.Close();
        }
Beispiel #12
0
        private void buttonSrvMngNumber_Click(object sender, EventArgs e)
        {
            TimeOutOff();
            LongNameEntryForm numberNameDlg = new LongNameEntryForm(SERVICE_NUMBER_MAX_SIZE, false, false);

            numberNameDlg.DialogTitle = LanguageTranslation.SERVICE_MGR_PHONE_NUMBER;

            numberNameDlg.InitialString = Program.SERVICE_MANAGER_NUMBER;

            numberNameDlg.UseSpaceBar = true;

            numberNameDlg.ShowDialog();
            resetTimer();
            string result = numberNameDlg.Description;

            Program.SERVICE_MANAGER_NUMBER = result;

            CommonTasks.WriteValueToConfigurationFile("globals", "serviceManagerPhone", result);
        }
Beispiel #13
0
        private void buttonChangeAdminEmail_Click(object sender, EventArgs e)
        {
            TimeOutOff();
            LongNameEntryForm buttonChangeAdminEmail = new LongNameEntryForm(250, false, false, LanguageTranslation.NEW_ADMIN_EMAIL);

            buttonChangeAdminEmail.InitialString = Program.TO_ADDRESS;
            buttonChangeAdminEmail.UseAtSign     = true;
            buttonChangeAdminEmail.UsePeriod     = true;
            buttonChangeAdminEmail.ShowDialog();
            resetTimer();

            if (buttonChangeAdminEmail.Ok)
            {
                string result = buttonChangeAdminEmail.Description;

                Program.TO_ADDRESS = result;

                CommonTasks.WriteValueToConfigurationFile("email", "emailToAddress", result);
            }
        }
Beispiel #14
0
        private void buttonChange_Click(object sender, EventArgs e)
        {
            try
            {
                Program.logEvent("User selected to modify a user");
                LongNameEntryForm IDEntry = new LongNameEntryForm(Program.USER_ID_LENGTH, false, false);
                IDEntry.InitialString = "";
                IDEntry.DialogTitle   = LanguageTranslation.ENTER_USER_ID_MODIFY;
                IDEntry.ShowDialog();
                Program.logEvent("User selected for modification ID Number: " + IDEntry.Description);

                User moduser = Program.userMgr.GetUser(IDEntry.Description);
                if (moduser != null)
                {
                    ModifyUsersForm ModForm = new ModifyUsersForm(moduser);
                    ModForm.ShowDialog();
                    if (!ModForm.Cancelled)
                    {
                        Program.logEvent("User modified with ID Number: " + IDEntry.Description);
                        threeDArrayCreateAndSort();
                    }
                    else
                    {
                        Program.logEvent("User modification cancelled");
                    }
                }
                else
                {
                    if (!IDEntry.Ok)
                    {
                        Program.ShowErrorMessage(LanguageTranslation.USER_NOT_EXIST, 4000);
                    }
                    Program.logEvent("User with ID Number " + IDEntry.Description + " does not exist");
                }
            }
            catch (Exception ex)
            {
                throw new Exception("AddUsersForm:AddUser exception: " + ex.Message);
            }
        }
        private void buttonChangeRFIDTag_Click(object sender, EventArgs e)
        {
            string rfidNumber = Program.passwordMgr.FindGenericData(KeyLocation);

            if (String.IsNullOrEmpty(rfidNumber))
            {
                rfidNumber = "000000";
            }

            TimeOutOff();
            LongNameEntryForm keyNumberDlg = new LongNameEntryForm(Program.GENERIC_DATA_FIELD_LENGTH, false, false, LanguageTranslation.ENTER_RFID_TAG);

            keyNumberDlg.ShowDialog();
            resetTimer();

            if (!keyNumberDlg.Ok)
            {
                Program.ShowErrorMessage(LanguageTranslation.RFID_NUMBER_CANCELLED, 3000);
                return;
            }

            textBoxRFID.Text = keyNumberDlg.Description;
        }
Beispiel #16
0
        private void buttonConfirm_Click(object sender, EventArgs e)
        {
            resetTimer();
            try
            {
                buttonManualEntry.Enabled = false;
                if (!namecheck && !numbercheck) //If you arent onto the Driver name or Driver number check, you are asking for
                {                               //confirmation that the user has placed their ID.
                    buttonCancel.Visible  = false; buttonCancel.Update();
                    buttonConfirm.Visible = false; buttonConfirm.Update();
                    textBox1.Text         = LanguageTranslation.SCANNING_WAIT; textBox1.Refresh();


                    IDScanner.ScanLicense("temp.jpg", Program.IMAGE_SCAN_RESOLUTION); //Scan the licence

                    textBox1.Text = LanguageTranslation.PROCESSING_ID;
                    //Bitmap licenseimage = new Bitmap("temp.jpg");
                    pictureBox1.Image = new Bitmap("temp.jpg");
                    textBox1.Refresh();

                    if (ScanType == "BARCODE")
                    {
                        Barcodedata = IDScanner.ProcessLicenseBarcode("temp.jpg");

                        if (Barcodedata == null)
                        {
                            Program.ShowErrorMessage(LanguageTranslation.BARCODE_SCANNING_ERROR, 5000);
                            Program.logEvent("Barcode scanning Error: Barcodedata is null");
                            Program.SqlManager.ErrorDatabaseEntry("", "", DateTime.Now.ToString(), Program.KIOSK_ID, 0, "Barcode scanning Error: Barcodedata is null", "", 0);

                            LongNameEntryForm LicenseEntry = new LongNameEntryForm(20, false, false);
                            LicenseEntry.DialogTitle = LanguageTranslation.ENTER_LICENSE_NUMBER;
                            LicenseEntry.ShowDialog();

                            if (!LicenseEntry.Ok)
                            {
                                buttonCancel_Click(this, null);
                            }
                            else
                            {
                                licensenum = '`' + LicenseEntry.Description;
                                if (pictureBox1.Image != null)
                                {
                                    pictureBox1.Image.Dispose();
                                }
                                this.Close();
                            }
                            return;
                        }
                        else if (Barcodedata.NameFirst == "" && Barcodedata.NameLast == "" && Barcodedata.license == "")
                        {
                            Program.ShowErrorMessage(LanguageTranslation.BARCODE_SCANNING_ERROR, 5000);
                            Program.logEvent("Barcode scanning Error: Barcodedata is Empty, likely because of license being wrong way on scanner or not on scanner at all");
                            Program.SqlManager.ErrorDatabaseEntry("", "", DateTime.Now.ToString(), Program.KIOSK_ID, 0, "Barcode scanning Error: Barcodedata is Empty, likely because of license being wrong way on scanner or not on scanner at all", "", 0);

                            if (!manualLicenseEntered)
                            {
                                LongNameEntryForm LicenseEntry = new LongNameEntryForm(20, false, false);
                                LicenseEntry.DialogTitle = LanguageTranslation.ENTER_LICENSE_NUMBER;
                                LicenseEntry.ShowDialog();

                                if (!LicenseEntry.Ok)
                                {
                                    buttonCancel_Click(this, null);
                                }
                                else
                                {
                                    licensenum = '`' + LicenseEntry.Description;
                                    if (pictureBox1.Image != null)
                                    {
                                        pictureBox1.Image.Dispose();
                                    }
                                    this.Close();
                                }
                            }
                            else
                            {
                                this.Close();
                            }
                            return;
                        }

                        firstname  = Barcodedata.NameFirst;
                        lastname   = Barcodedata.NameLast;
                        licensenum = Barcodedata.license;
                    }
                    else //if scan type is IMAGE
                    {
                        IDdata = IDScanner.ProcessLicense(); //Extract data from the license

                        if (IDdata == null)
                        {
                            //Program.ShowErrorMessage("Error While Processing ID:\r\nTransaction Cancelled", 5000);
                            Program.ShowErrorMessage(LanguageTranslation.PROCESSING_ID_ERROR, 4000);
                            buttonCancel_Click(this, null);
                            return;
                        }

                        firstname  = IDdata.NameFirst;
                        lastname   = IDdata.NameLast;
                        licensenum = IDdata.license;
                    }

                    buttonCancel.Visible  = true;
                    buttonConfirm.Visible = true;
                    textBox1.Focus();

                    buttonConfirm.Text = LanguageTranslation.CONFIRM;
                    textBox1.Text      = LanguageTranslation.CONFIRM_NAME + firstname + "\r\n" + lastname;
                    namecheck          = true;
                }
                else if (!numbercheck) //This confirms that the ID name is correct
                {
                    textBox1.Text = LanguageTranslation.CONFIRM_LICENSE + licensenum;
                    numbercheck   = true;
                }
                else //this confirms that the ID number is correct
                {
                    Program.ShowErrorMessage(LanguageTranslation.ID_SCAN_CONFIRMED, 4000);
                    pictureBox1.Image.Dispose();
                    this.Close();
                }
            }

            catch (Exception ex)
            {
                Program.ShowErrorMessage(LanguageTranslation.SCANNING_ID_ERROR, 3000);
                Program.logEvent("IDScanInput Error: " + ex.Message);
                Program.SqlManager.ErrorDatabaseEntry("", "", DateTime.Now.ToString(), Program.KIOSK_ID, 0, "IDScanInput Error:" + ex.Message, "", 0);
                pictureBox1.Image.Dispose();
                buttonCancel_Click(this, null);
                return;
            }
        }