public UserMessageFilter(IUserBll userBll,
                          IUpdateInfoBll updateInfoBll, IHangUpTimeBll hangUpTimeBll)
 {
     _userBll            = userBll;
     _updateInfoBll      = updateInfoBll;
     _hangUpTimeBll      = hangUpTimeBll;
     _updateInfoCtreator = clientType => _updateInfoBll.Get(clientType);
 }
Exemple #2
0
        void btnLogin_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(stbAccount.SkinTxt.Text))
            {
                errorProvider.SetError(stbAccount, "请您输入帐号后再登录!");
                return;
            }

            if (string.IsNullOrEmpty(stbPassword.SkinTxt.Text))
            {
                errorProvider.SetError(stbPassword, "请您输入密码后再登录!");
                return;
            }

            var user = new User
            {
                Account  = stbAccount.SkinTxt.Text,
                Password = stbPassword.SkinTxt.Text,
                IsClient = _isClient
            };

            if (LoginCfg != null)
            {
                if (LoginCfg.RememberPassword && !_useInputPassword)
                {
                    user.Password = LoginCfg.Password;
                }
            }

            bool isAutoLogin = !_useInputPassword && LoginCfg != null &&
                               (LoginCfg.RememberPassword || LoginCfg.AutoLogin);

            _globalApplicationData.ApplicationData.UpdateInfo = _updateInfoBll.Get();
            _userBll.Login(new LoginInfo
            {
                User       = user,
                UpdateInfo = _globalApplicationData.ApplicationData.UpdateInfo
            }, isAutoLogin, _loginResponse);
        }