private string ReplaceCoveringNoteTableOfContents(string CoveringNote, ProposalIncludeRegions Regions) { StringBuilder builder = new StringBuilder(); string response, txtReplace, txtSearch = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"table\" style=\"width:773px\">"; string tdFormat = "\n\t\t\t<td><img alt=\"Blue Correct Icon\" src=\"/resources/images/proposal-report/correct-blue-icon.jpg\" /></td>\n\t\t\t<td>{0}</td>"; int startIndex = CoveringNote.IndexOf(txtSearch); if (startIndex > -1) { txtReplace = CoveringNote.Substring(startIndex, (CoveringNote.IndexOf("</table>", startIndex) - startIndex + 8)); builder.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"table\" style=\"width:773px\">\n\t<tbody>\n\t\t<tr>"); builder.AppendFormat(tdFormat, "Departure Dates / Costs"); builder.AppendFormat(tdFormat, "Inclusions / Exclusions / Notes"); if (Regions.RegionMap) { builder.AppendFormat(tdFormat, "Map of the Region"); } builder.Append("\n\t\t</tr>\n\t\t<tr>"); if (Regions.SuggestedHotels) { builder.AppendFormat(tdFormat, "Information on the suggested hotel list"); } if (Regions.ItineraryBrief) { builder.AppendFormat(tdFormat, "Your Itinerary in Brief"); } if (Regions.ItineraryDetail) { builder.AppendFormat(tdFormat, "Your Itinerary in Detail"); } builder.Append("\n\t\t</tr>\n\t</tbody>\n</table>"); response = CoveringNote.Replace(txtReplace, builder.ToString()); } else { response = CoveringNote; } return(response); }
public IActionResult SaveProposalTerms(string QRFID, string ProposalId, string txtTerms, ProposalIncludeRegions ProposalIncludeRegions) { string UserName = HttpContext.Request.Cookies["UserName"] ?? ckUserName; #region Set Proposal by Proposal Id ProposalSetReq request = new ProposalSetReq(); ProposalSetRes response = new ProposalSetRes(); request.Proposal.QRFID = QRFID; request.Proposal.ProposalId = ProposalId; request.Proposal.Terms = txtTerms ?? ""; request.Proposal.ProposalIncludeRegions = ProposalIncludeRegions; request.Proposal.EditUser = UserName; request.Proposal.CreateUser = UserName; response = coProviders.SetProposal(request, token).Result; #endregion if (response.ResponseStatus.Status.ToLower() == "success") { return(Json(new { responseText = "success" })); } else { return(Content("Error")); } }