private void SetAccessType(Program.GlobalAccessType type)
        {
            Program.GLOBAL_ACCESS_TYPE = type;

            CommonTasks.WriteValueToConfigurationFile("globals", "globalAccessType", ((int)type).ToString());
            Program.logEvent("Access Type changed to " + type.ToString());
        }
 /// <summary>
 /// buttonDrop_Click - drop key at this location
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonDrop_Click(object sender, EventArgs e)
 {
     resetTimer();
     if (KeyLocation == -1)
     {
         Program.ShowErrorMessage(LanguageTranslation.BOX_LOCATION_NOT_SET, 3000);
         return;
     }
     CommonTasks.OpenKeyBox(KeyLocation, false);
     Program.logEvent("Box " + KeyLocation + " Opened By Administrator");
 }
        private void buttonAdminConfig3_Click(object sender, EventArgs e)
        {
            try
            {
                string result = getResult(Program.CONFIG_ADMIN_PWORD_3);

                Program.CONFIG_ADMIN_PWORD_3 = result;
                textBoxAdminConfig3.Text     = result;
                CommonTasks.WriteValueToConfigurationFile("configurableadminpasswords", "adminpassword3", result);
                Program.logEvent("Configurable Admin Password 3 Set: " + result);
            }
            catch (Exception ex)
            {
                Program.logDebug("ChangeAdminPassWordForm:buttonAdminConfig3_Click exception " + ex.Message);
                throw new Exception("ChangeAdminPassWordForm:buttonAdminConfig3_Click exception " + ex.Message);
            }
        }
示例#4
0
        /// <summary>
        /// SimpleAccess - simple access matchs a saved access code - 6 digits with digits entered here
        /// </summary>
        private void keyLocationChange()
        {
            try
            {
                string boxNumber = CommonTasks.GetLocationFromKeypad();
                resetTimer();
                if (String.IsNullOrEmpty(boxNumber))
                {
                    Program.ShowErrorMessage(LanguageTranslation.INVALID_LOCATION, 3000);
                    return;
                }
                //check to see if this is a valid location
                int loc = -1;  //initialize as invalid

                if (CommonTasks.ValidBoxNumber(boxNumber))
                {
                    loc = CommonTasks.FindLocationNumber(boxNumber); //location number is 1-Max - box numbers are different sequence
                }

                // if this was not a valid box number - then location will be -1
                if (loc == -1)
                {
                    Program.ShowErrorMessage(LanguageTranslation.INVALID_LOCATION, 3000);
                    return;
                }
                // the admin task has password at location 0
                else if (loc == 0) // this the admin location - use different task to change admin password
                {
                    Program.ShowErrorMessage(LanguageTranslation.USE_CHANGE_ADMIN_PWORD, 3000);
                    return;
                }
                else
                {
                    TimeOutOff();
                    KeyLocationChangeTasksForm keyLocChangeDlg = new KeyLocationChangeTasksForm(loc);

                    keyLocChangeDlg.ShowDialog();
                    resetTimer();
                }
            }
            catch (Exception ex)
            {
                Program.logError("Admin dialogs - SimpleAccess -change access task  exception " + ex.Message);
            }
        }
示例#5
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");
            }
        }
示例#6
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);
        }
示例#7
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);
            }
        }
示例#8
0
        /// <summary>
        /// buttonOpenDoor_Click - will open a locked door for an admin, give access to the keys without
        ///                     using access codes or cards.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonOpenDoor_Click(object sender, EventArgs e)
        {
            TimeOutOff();
            try
            {
                string boxNumber = CommonTasks.GetLocationFromKeypad();

                if (String.IsNullOrEmpty(boxNumber))
                {
                    Program.ShowErrorMessage(LanguageTranslation.INVALID_BOX_NUMBER, 3000);
                    return;
                }
                //check to see if this is a valid location
                int loc = -1;  //initialize as invalid

                if (CommonTasks.ValidBoxNumber(boxNumber))
                {
                    loc = CommonTasks.FindLocationNumber(boxNumber); //location number is 1-Max - box numbers are different sequence
                }

                // if this was not a valid box number - then location will be -1
                if (loc == -1)
                {
                    Program.ShowErrorMessage(LanguageTranslation.INVALID_BOX_NUMBER, 3000);
                    return;
                }
                else
                {
                    CommonTasks.OpenKeyBox(loc, false);
                    Program.logEvent("Box " + loc + " Opened by Admin");
                }
                resetTimer();
            }
            catch (Exception ex)
            {
                Program.logEvent("Admin dialogs - Open door task  exception " + ex.Message);
            }
        }
        public KeyLocationChangeTasksForm(int Location)   // this is the location in database and lock number
            : base(Program.TIMEOUT_INTERVAL)
        {
            InitializeComponent();
            buttonChangeAccessCode.Text         = LanguageTranslation.ACCESS_CODE;
            buttonChangeCardNumber.Text         = LanguageTranslation.CARD_NUMBER;
            buttonChangeAccessRestrictions.Text = LanguageTranslation.ACCESS_RESTRICTIONS;
            buttonChangeRFIDTag.Text            = LanguageTranslation.RFID_TAG;
            buttonExit.Text         = LanguageTranslation.CANCEL;
            buttonDrop.Text         = LanguageTranslation.OPEN_DOOR;
            buttonApplyChanges.Text = LanguageTranslation.APPLY_CHANGES;

            boxNumber = CommonTasks.FindBoxNumber(Location);

            this.label1.Text = LanguageTranslation.PRESS_BUTTON_MODIFY_BOX + " " + boxNumber.ToString() + " " + LanguageTranslation.INFORMATION;
            KeyLocation      = Location;

            buttonChangeCardNumber.Enabled = false;
            textBoxCardNumber.Enabled      = false;
            buttonChangeRFIDTag.Visible    = false;
            textBoxRFID.Visible            = false;

            SetTextBoxes();
        }