Esempio n. 1
0
        public bool ChangeAccessType(string id, accessTimeType type)
        {
            int index = users.FindIndex(delegate(User u)
            {
                return(u.ID == id);
            });

            if (index == -1)
            {
                return(false);
            }
            users[index].AccessType = type;
            return(true);
        }
        /// <summary>
        /// ChangeTimeAccessType - replace the AccessTimeType of the given location
        /// </summary>
        /// <param name="lc - location"></param>
        /// <param name="pswd- password"></param>
        /// <returns> true if password change is made</returns>
        public bool ChangeTimeAccessType(int lc, accessTimeType type)
        {
            KeyPassword keyPasswrd = null;

            foreach (KeyPassword kp in keypasswords)
            {
                if (kp.loc == lc)
                {
                    keyPasswrd = kp;
                    break;
                }
            }
            if (keyPasswrd == null)
            {
                Program.logEvent("KeyPassword - no location found" + lc.ToString());
                return(false);   ///location not found - what happened here
            }
            else
            {
                keyPasswrd.accessTimeIntType = (int)type;
                return(true);
            }
        }
 public bool SetAccessTimeType(int loc, accessTimeType type)
 {
     return(keyPassWordList.ChangeTimeAccessType(loc, type));
 }
 public bool ChangeUserTimeAccessType(string ID, accessTimeType type)
 {
     return(UsersList.ChangeAccessType(ID, type));
 }