コード例 #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);
        }
コード例 #2
0
        /// <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);
            }
        }
コード例 #3
0
 public bool SetAccessTimeType(int loc, accessTimeType type)
 {
     return(keyPassWordList.ChangeTimeAccessType(loc, type));
 }
コード例 #4
0
 public bool ChangeUserTimeAccessType(string ID, accessTimeType type)
 {
     return(UsersList.ChangeAccessType(ID, type));
 }