예제 #1
0
        public int AddUser(UserCLS user)
        {
            if (_Users.Count == 0)
            {
                _JWT_TimeExpirationTimer = new Timer(new TimerCallback(CheckJWTAgeing), null, 1000, 1000);
            }

            if (!_Users.ContainsKey(user.UserName))
            {
                _Users.Add(user.UserName, user);
            }
            return(200);
        }
예제 #2
0
        public int CompareTo(object obj)
        {
            int res = 1;

            if (obj == null)
            {
                res = 1;
            }
            else
            {
                UserCLS otherUser = obj as UserCLS;
                if (otherUser != null)
                {
                    if (this._UserName == otherUser._UserName && this._UserName == otherUser._Password)
                    {
                        res = 0;
                    }
                }
            }
            return(res);
        }
예제 #3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Login login = new Login();

            login.ShowDialog();
            UserCLS user = new UserCLS();

            if (login.DialogResult.HasValue && login.DialogResult.Value)
            {
                user.UserName       = login.user.UserName;
                user.Password       = login.user.Password;
                user.JWT            = login.user.JWT;
                user.JWT_CreateTime = DateTime.Now;
            }

            else
            {
                MessageBox.Show("User clicked Cancel");
            }

            _Manager.AddUser(user);
            _ts.GetWebPageSourceAsync();
        }