Esempio n. 1
0
 /// <summary>
 /// 联线登录。
 /// </summary>
 /// <param name="userName"></param>
 /// <param name="password"></param>
 private void OnlineVerify(string userName, string password)
 {
     TeaClientServicePoxyFactory.Instance(this.CoreService, new RaiseChangedHandler(delegate(string content)
     {
         this.OnMessageEvent(MessageType.Normal, content);
     })).Authentication(EnumUserAuthen.Teacher, userName, password, new UserAuthenticationHandler(delegate(LocalUserInfo userInfo, Exception e)
     {
         if (e != null)
         {
             this.OnMessageEvent(MessageType.PopupWarn, e.Message);
             this.SetControlsEnabledStatus(true);
             return;
         }
         if (this.data == null)
         {
             this.data = new LocalUserInfoCollection();
         }
         this.data.Add(userInfo);
         this.data.Serialize();
         this.SetControlsEnabledStatus(true);
         this.LoginSuccess(userInfo);
     }));
 }
Esempio n. 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LoginWindow_Load(object sender, EventArgs e)
        {
            this.CoreService.ForceQuit = false;
            this.OnMessageEvent(MessageType.Normal, string.Empty);
            this.OnToolTipEvent(this.ddlUserAccount, "任课教师帐号!");
            this.OnToolTipEvent(this.txtUserPassword, "任课教师密码!");

            this.data = LocalUserInfoCollection.DeSerialize();
            if (this.data != null)
            {
                this.ddlUserAccount.BeginUpdate();
                this.ddlUserAccount.DataSource = data;
                this.ddlUserAccount.DisplayMember = "UserAccount";
                this.ddlUserAccount.ValueMember = "UserAccount";
                this.ddlUserAccount.EndUpdate();
            }
        }