private void button3_Click(object sender, RoutedEventArgs e) { try { EWEManagerService.EWEManagerServiceClient Client = ServiceClient.GetClient(); Epi.Web.Enter.Common.Message.PreFilledAnswerRequest Request = new Epi.Web.Enter.Common.Message.PreFilledAnswerRequest(); Guid OrganizationGuid = new Guid(passwordBox1.Password); Guid SurveyGuid = new Guid(SurveyId.Text); Guid ParentId; if (!string.IsNullOrEmpty(this.ParentId.Text)) { ParentId = new Guid(this.ParentId.Text); } else { ParentId = Guid.Empty; } Guid ResponseId = new Guid(this.ResponseId.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.UserId = 2; Request.AnswerInfo.OrganizationKey = OrganizationGuid; Request.AnswerInfo.SurveyId = SurveyGuid; Request.AnswerInfo.ParentRecordId = ParentId; Request.AnswerInfo.ResponseId = ResponseId; // Request.AnswerInfo Request.AnswerInfo.SurveyQuestionAnswerList = Values; var Result = Client.SetSurveyAnswer(Request); 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"); } }
public Epi.Web.Enter.Common.Message.PreFilledAnswerResponse SetSurveyAnswer(Epi.Web.Enter.Common.Message.PreFilledAnswerRequest pRequestMessage) { return(base.Channel.SetSurveyAnswer(pRequestMessage)); }