Exemplo n.º 1
0
        async Task <(bool, SurveyResponseDTO)> SaveSingleChoiceResponse()
        {
            if (SingleOptionAnswer == Guid.Empty)
            {
                ValidationMessage = "Please select a response";
                return(false, null);
            }
            var cmd = new SurveyResponseSingleOptionResponseCmd(SurveyResponse.SurveyResponseId,
                                                                Response.Question.QuestionId,
                                                                SingleOptionAnswer);
            var response = await SurveyResponseClient.SingleOptionResponse(cmd);

            if (response.Result == CommandSubmitExecutionResult.Fail)
            {
                ValidationMessage = response.Messages.FirstOrDefault();
                return(false, null);
            }
            return(true, response.EntityQry);
        }
Exemplo n.º 2
0
        public async Task <CommandSubmitResult <SurveyResponseDTO> > SingleOptionResponse(SurveyResponseSingleOptionResponseCmd cmd)
        {
            string url = $"{_baseUrl}addsingleoptionresponse";

            return(await PostCmd(cmd, url));
        }