Beispiel #1
0
        public async static Task <Result[]> GetVoteResultByIDAsync(int surveyID)
        {
            GetVoteResultResponse res = CallBackendSync <GetVoteResultResponse>(false, "getvoteresultbyid/" + surveyID, null);

            if (res == null)
            {
                return(new Result[0]);
            }

            if (!string.IsNullOrEmpty(res.ExceptionMessage))
            {
                throw new Exception(res.ExceptionMessage);
            }
            return(res.Results);
        }
Beispiel #2
0
        /// <summary>
        /// Gets the vote result.
        /// </summary>
        /// <returns>The vote result.</returns>
        /// <param name="survey">Survey.</param>
        public async static Task <Result[]> GetVoteResultAsync(Survey survey)
        {
            GetVoteResultResponse res = CallBackendSync <GetVoteResultResponse>(true, "getvoteresult", survey);

            if (res == null)
            {
                return(new Result[0]);
            }

            if (!string.IsNullOrEmpty(res.ExceptionMessage))
            {
                throw new Exception(res.ExceptionMessage);
            }
            return(res.Results);
        }