public HttpResponseMessage EditSubmission(Submission submission) { var errors = new List <string>(); var quotes = new List <Quote>(); var savedSubmission = this.SubmissionModule.UpdateSubmission(SubmissionModuleHelpers.SetupWording(submission), out errors, out quotes); if (errors.Count == 0 && submission.AuditTrails != null) { foreach (var auditTrail in submission.AuditTrails .Where(at => at.Description.Length > "World Check requested for insured name: ".Length)) { this.AuditTrailModule.Audit(auditTrail.Source, submission.Id.ToString(), auditTrail.Title, auditTrail.Description); } } return(this.Request.CreateResponse(errors.Count == 0 ? HttpStatusCode.OK : HttpStatusCode.BadRequest, new { Submission = savedSubmission, Error = new Dictionary <string, string[]> { { "Subscribe", errors.ToArray() } } })); }
public HttpResponseMessage UpdateSubmissionTrigger(string polId) { var errors = new List <string>(); var quotes = new List <Quote>(); var submission = this.SubmissionModule.GetSubmissionByPolId(polId); var savedSubmission = submission; if (submission != null) { savedSubmission = this.SubmissionModule.UpdateSubmission(SubmissionModuleHelpers.SetupWording(submission), out errors, out quotes); } return(this.Request.CreateResponse(errors.Count == 0 ? HttpStatusCode.OK : HttpStatusCode.BadRequest, new { Submission = savedSubmission, Error = new Dictionary <string, string[]> { { "Subscribe", errors.ToArray() } } })); }