Example #1
0
        public async Task <bool> UpdateResponseAsync(string value, int respondentId, int questionId)
        {
            var responsesAccessor = new ResponsesAccessor(_dbContext);
            var response          = await responsesAccessor.UpdateResponseAsync(value, respondentId, questionId);

            return(response);
        }
Example #2
0
        public async Task <PredictionHouseDB.Responses> AddResponseAsync(PredictionHouseDB.Responses newResponse)
        {
            var responsesAccessor = new ResponsesAccessor(_dbContext);

            PredictionHouseDB.Responses addedResponse = await responsesAccessor.AddResponseAsync(newResponse);

            return(addedResponse);
        }
Example #3
0
        public async Task <ResponsesListResponse> GetResponsesByYearList(int year)
        {
            ResponsesListResponse response = new ResponsesListResponse();

            try
            {
                var responsesAccessor = new ResponsesAccessor(_dbContext);
                response.Data = await responsesAccessor.GetResponsesByYearList(year);

                response.Success = true;
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }