/// <summary> /// 根据账号密码获取用户实体 /// </summary> /// <param name="uaccount">账号</param> /// <param name="upassword">密码</param> /// <returns></returns> public CzarUsers FindUserByuAccount(string uaccount, string upassword) { using (var connection = new SqlConnection(DbConn)) { string sql = @"SELECT * from CzarUsers where uAccount=@uaccount and uPassword=upassword and uStatus=1"; var result = connection.QueryFirstOrDefault <CzarUsers>(sql, new { uaccount, upassword = SecretHelper.ToMD5(upassword) }); return(result); } }