Example #1
0
        private static Response getUsersResponse()
        {
            int usersCount = 0;

            string[] users = readUsersFile(ref usersCount);

            string users_response = "";

            for (int i = 0; i < users.Length; i++)
            {
                users_response += users[i];
            }

            /*Console.WriteLine("[Response Users Count]: " + usersCount);
             * Console.WriteLine("[Response]: " + users_response);*/
            Response.ResponseDetails responseDetails =
                new Response.ResponseDetails((int)RESPONSE_TYPE.USERS,
                                             usersCount.ToString(),
                                             0.ToString(),
                                             users_response,
                                             String.Empty);
            return(new Response(200, responseDetails));
        }
Example #2
0
        private static Response getQuestionsResponse()
        {
            int questionsCount = 0;

            string[] questions = readQuestionsFile(ref questionsCount);

            string questions_response = "";

            for (int i = 0; i < questions.Length; i++)
            {
                questions_response += questions[i];
            }

            /*Console.WriteLine("[Response Questions Count]: " + questionsCount);
             * Console.WriteLine("[Response]: " + questions_response);*/
            Response.ResponseDetails responseDetails =
                new Response.ResponseDetails((int)RESPONSE_TYPE.QUESTIONS,
                                             0.ToString(),
                                             questionsCount.ToString(),
                                             String.Empty,
                                             questions_response);

            return(new Response(200, responseDetails));
        }