Exemplo n.º 1
0
        /// <summary>
        /// 用户登录
        /// </summary>
        private DialogResult Login()
        {
            DialogResult result = DialogResult.Cancel;

            using (FrmLogin frmLogin = new FrmLogin())
            {
                if ((result = frmLogin.ShowDialog()) == DialogResult.OK)
                {
                    if (AppContext.LoginUser != null)
                    {
                        this.btnLogin.Visible    = false;
                        this.lblUserName.Text    = AppContext.LoginUser.UserName;
                        this.lblUserName.Tag     = AppContext.LoginUser;
                        this.lblUserName.Visible = true;
                    }
                }
            }
            return(result);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 用户登录
 /// </summary>
 private DialogResult Login()
 {
     DialogResult result = DialogResult.Cancel;
     using (FrmLogin frmLogin = new FrmLogin())
     {
         if ((result = frmLogin.ShowDialog()) == DialogResult.OK)
         {
             if (AppContext.LoginUser != null)
             {
                 this.btnLogin.Visible = false;
                 this.lblUserName.Text = AppContext.LoginUser.UserName;
                 this.lblUserName.Tag = AppContext.LoginUser;
                 this.lblUserName.Visible = true;
             }
         }
     }
     return result;
 }