コード例 #1
0
    public static usrInfo GetOUsrInfo(string usr)
    {
        usrInfo       info = new usrInfo();
        SqlDataReader read = SQLOpen("SELECT * FROM usersTable WHERE username1='" + usr + "'");

        if (read.HasRows == false)
        {
            read.Close();
            return(info);
        }
        read.Read();
        info.id        = read["userID"].ToString();
        info.username  = read["username1"].ToString();
        info.password  = read["password1"].ToString();
        info.firstname = read["firstname1"].ToString();
        info.lastname  = read["lastname1"].ToString();
        info.address   = read["address1"].ToString();
        info.city      = read["city1"].ToString();
        info.state     = read["state1"].ToString();
        info.zip       = read["zip1"].ToString();
        info.type      = read["type1"].ToString();
        info.address2  = read["address2"].ToString();
        info.city2     = read["city2"].ToString();
        info.state2    = read["state2"].ToString();
        info.zip2      = read["zip2"].ToString();
        return(info);
    }
コード例 #2
0
 public static usrInfo GetOUsrInfo(string usr)
 {
     usrInfo info = new usrInfo();
     SqlDataReader read = SQLOpen("SELECT * FROM usersTable WHERE username1='" + usr + "'");
     if (read.HasRows == false)
     {
         read.Close();
         return info;
     }
     read.Read();
     info.id = read["userID"].ToString();
     info.username = read["username1"].ToString();
     info.password = read["password1"].ToString();
     info.firstname = read["firstname1"].ToString();
     info.lastname = read["lastname1"].ToString();
     info.address = read["address1"].ToString();
     info.city = read["city1"].ToString();
     info.state = read["state1"].ToString();
     info.zip = read["zip1"].ToString();
     info.type = read["type1"].ToString();
     info.address2 = read["address2"].ToString();
     info.city2 = read["city2"].ToString();
     info.state2 = read["state2"].ToString();
     info.zip2 = read["zip2"].ToString();
     return info;
 }
コード例 #3
0
        public bool validate([FromBody] usrInfo usrname)
        {
            var rng      = new Random();
            var model    = new BorgWarnerMisSQLContext();
            var usr      = usrname.username;
            var testData = model.Database.SqlQuery <usrDBO>($"select Password from dbo.tblWebUser where UsrName='{usr}' ").ToList();

            if (testData.Count == 0)
            {
                return(false);
            }
            //前端密文解密
            // string oriText = await _services.InvokeAsync<string>("./src/scripts/decrypt",usrname.happyword);
            // string testORI = DecryptByAES(usrname.happyword,"secretkey1234567");
            var validate = PasswordHasher.VerifyHashedPassword(usrname.happyword, testData[0].Password);

            return(validate);
        }
コード例 #4
0
ファイル: Data.cs プロジェクト: nikhilp2/SoftwareDesign
 public static usrInfo GetUsrInfo(string sID)
 {
     usrInfo info = new usrInfo();
     SqlDataReader read = SQLOpen("SELECT * FROM users WHERE session='" + sID + "'");
     read.Read();
     info.id = read["userID"].ToString();
     info.username = read["username"].ToString();
     info.password = read["password"].ToString();
     info.firstname = read["firstname"].ToString();
     info.lastname = read["lastname"].ToString();
     info.address = read["address"].ToString();
     info.city = read["city"].ToString();
     info.state = read["state"].ToString();
     info.zip = read["zip"].ToString();
     info.type = read["type"].ToString();
     info.email = read["email"].ToString();
     info.OrgID = read["OrgID"].ToString();
     return info;
 }
コード例 #5
0
    public static usrInfo GetUsrInfo(string sID)
    {
        usrInfo       info = new usrInfo();
        SqlDataReader read = SQLOpen("SELECT * FROM users WHERE session='" + sID + "'");

        read.Read();
        info.id        = read["userID"].ToString();
        info.username  = read["username"].ToString();
        info.password  = read["password"].ToString();
        info.firstname = read["firstname"].ToString();
        info.lastname  = read["lastname"].ToString();
        info.address   = read["address"].ToString();
        info.city      = read["city"].ToString();
        info.state     = read["state"].ToString();
        info.zip       = read["zip"].ToString();
        info.type      = read["type"].ToString();
        info.email     = read["email"].ToString();
        info.OrgID     = read["OrgID"].ToString();
        return(info);
    }