コード例 #1
0
    public Guid CheckUserPassword(string UserName, string Password)
    {
        if (!header.VerifyCredentials(header.UserName, header.Password, header.Type))
        {
            return(Guid.Empty);
        }

        Guid result = Guid.Empty;

        try
        {
            //string SQL = string.Format(@"SELECT TOP 1 [UserID]
            //    FROM [WSAF].[dbo].[DepartmentUserView2] WHERE [UserName]='{0}'", UserName);

            //string ID = DataAccess.ExecuteSql("Wicresoft.Framework.ConnectionString", SQL).Tables[0].Rows[0][0].ToString();

            Wicresoft.Framework.Organization.User user = Wicresoft.Framework.Organization.OrganizationPublicHelper.GetUserInfo(UserName);
            //user.ID

            UserLogin userLogin = AuthenticationHelper.GetUserLogin(user.ID, AuthenticationHelper.GetDefaultDomain().ID);

            if (AuthenticationHelper.CheckUserPassword(ConfigurationManager.AppSettings["FiledName"].ToString() + @"\" + UserName, Password) == Guid.Empty)
            {
                return(result);
            }
            else
            {
                return(user.ID);
            }
        }
        catch (Exception ex)
        {
            return(result);
        }
    }