Exemple #1
0
        private void buttonAccessRestrictions_Click(object sender, EventArgs e)
        {
            ModifyAccessRestriction restrictions = new ModifyAccessRestriction(AccessRestrictionType.User, UserToModify.ID);

            restrictions.ShowDialog();

            if ((accessTimeType)UserToModify.accessTimeIntType == accessTimeType.LIMITED_USE)
            {
                textBoxAccessRestrictions.Text = LanguageTranslation.LIMITED_USES;
            }
            else if ((accessTimeType)UserToModify.accessTimeIntType == accessTimeType.TIME_PERIOD)
            {
                textBoxAccessRestrictions.Text = LanguageTranslation.TIME_PERIOD;
            }
            else if ((accessTimeType)UserToModify.accessTimeIntType == accessTimeType.TIME_PERIOD_LIMITED_USE)
            {
                textBoxAccessRestrictions.Text = LanguageTranslation.TIME_PERIOD_LIMITED_USES;
            }
            else
            {
                textBoxAccessRestrictions.Text = LanguageTranslation.ALWAYS_ON;
            }
        }
        private void buttonChangeAccessRestrictions_Click(object sender, EventArgs e)
        {
            ModifyAccessRestriction restrictions = new ModifyAccessRestriction(AccessRestrictionType.Keypassword, boxNumber.ToString());

            restrictions.ShowDialog();

            if (Program.passwordMgr.FindAccessTimeType(boxNumber) == accessTimeType.LIMITED_USE)
            {
                textBoxAccessRestrictions.Text = LanguageTranslation.LIMITED_USES;
            }
            else if (Program.passwordMgr.FindAccessTimeType(boxNumber) == accessTimeType.TIME_PERIOD)
            {
                textBoxAccessRestrictions.Text = LanguageTranslation.TIME_PERIOD;
            }
            else if (Program.passwordMgr.FindAccessTimeType(boxNumber) == accessTimeType.TIME_PERIOD_LIMITED_USE)
            {
                textBoxAccessRestrictions.Text = LanguageTranslation.TIME_PERIOD_LIMITED_USES;
            }
            else
            {
                textBoxAccessRestrictions.Text = LanguageTranslation.ALWAYS_ON;
            }
        }