public static JToken GetTopics()
        {
            using (SqlConnection conn = DbConnectionFactory.CreateSqlConnection())
                using (SqlCommand command = new SqlCommand("SubForum_Select", conn))
                {
                    command.CommandType = CommandType.StoredProcedure;

                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        return(JsonUtils.CreateJsonArrayFromSqlReader(reader));
                    }
                }
        }
Example #2
0
        public static JToken GetThreads(int topicId)
        {
            using (SqlConnection conn = DbConnectionFactory.CreateSqlConnection())
                using (SqlCommand command = new SqlCommand("Thread_Select", conn))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@SubForumID", topicId);

                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        return(JsonUtils.CreateJsonArrayFromSqlReader(reader));
                    }
                }
        }
Example #3
0
        public static JToken GameInfo(string username)
        {
            using (SqlConnection conn = DbConnectionFactory.CreateSqlConnection())
                using (SqlCommand command = new SqlCommand("GameInfo", conn))
                {
                    command.CommandType = CommandType.StoredProcedure;

                    command.Parameters.AddWithValue("@Username", username);

                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        return(JsonUtils.CreateJsonArrayFromSqlReader(reader));
                    }
                }
        }
Example #4
0
        public static JToken GetUsers(int userId)
        {
            using (SqlConnection conn = DbConnectionFactory.CreateSqlConnection())
                using (SqlCommand command = new SqlCommand("Users_Select", conn))
                {
                    command.CommandType = CommandType.StoredProcedure;

                    //if (!string.IsNullOrEmpty(clientIdentifier))
                    command.Parameters.AddWithValue("@UserID", userId);

                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        return(JsonUtils.CreateJsonArrayFromSqlReader(reader));
                    }
                }
        }