Exemplo n.º 1
0
        private void button3_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                SurveyManagerServiceV2.ManagerServiceV2Client Client  = ServiceClient.GetClientV2();
                Epi.Web.Common.Message.PreFilledAnswerRequest Request = new Epi.Web.Common.Message.PreFilledAnswerRequest();
                Guid OrganizationGuid = new Guid(passwordBox1.Password);
                Guid SurveyGuid       = new Guid(SurveyId.Text);
                Guid UserPublishKey   = new Guid(this.UserPublishKey.Text);

                Dictionary <string, string> Values = new Dictionary <string, string>();

                foreach (var item in listView1.Items)
                {
                    Values.Add(((System.Data.DataRowView)(item)).Row[0].ToString(), ((System.Data.DataRowView)(item)).Row[1].ToString());
                }

                Request.AnswerInfo.OrganizationKey          = OrganizationGuid;
                Request.AnswerInfo.SurveyId                 = SurveyGuid;
                Request.AnswerInfo.UserPublishKey           = UserPublishKey;
                Request.AnswerInfo.SurveyQuestionAnswerList = Values;
                var Result = Client.SetSurveyAnswer(Request);

                this.Url = Result.SurveyResponseUrl + "/" + Result.SurveyResponsePassCode;

                if (Result.Status == "Success")
                {
                    this.Result.AppendText("\nResponse Id: " + Result.SurveyResponseID);
                    this.Result.AppendText("\nResponse URL: " + Result.SurveyResponseUrl);
                    this.Result.AppendText("\nPass Code: " + Result.SurveyResponsePassCode);
                }
                else
                {
                    if (Result.ErrorMessageList.Count() > 0)
                    {
                        foreach (var item in Result.ErrorMessageList)
                        {
                            this.Result.AppendText("\n" + item.Key + " : " + item.Value);
                        }
                    }
                }
            }
            catch (Exception ex)

            {
                this.Result.AppendText("An Error occurred  while trying to insert a response");
            }
        }
Exemplo n.º 2
0
 public Epi.Web.Common.Message.PreFilledAnswerResponse SetSurveyAnswer(Epi.Web.Common.Message.PreFilledAnswerRequest pRequestMessage)
 {
     return(base.Channel.SetSurveyAnswer(pRequestMessage));
 }
Exemplo n.º 3
0
 public System.Threading.Tasks.Task <Epi.Web.Common.Message.PreFilledAnswerResponse> SetSurveyAnswerAsync(Epi.Web.Common.Message.PreFilledAnswerRequest pRequestMessage)
 {
     return(base.Channel.SetSurveyAnswerAsync(pRequestMessage));
 }