Пример #1
0
        protected void btnSubmit_click(object sender, EventArgs e)
        {
            CRM.Data.Entities.SecUser user = SecUserManager.GetByUserName(txtUserName.Text.Trim());
            if (user.UserName != null && user.Password != null)
            {
                string password = SecurityManager.Decrypt(user.Password);

                if (user.UserId > 0 && password.Equals(txtPassword.Text.Trim()))
                {
                    lblError.Visible = false;


                    DoAuthenticate(user);
                }
                else
                {
                    lblError.Visible = true;
                    lblError.Text    = "Invalid User Name or Password!";
                    createLoginLog(user.UserId, false);
                }
            }
            else
            {
                lblError.Visible = true;
                lblError.Text    = "Invalid User Name or Password!";
                return;
            }
        }