Esempio n. 1
0
        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&nbsp;Dates&nbsp;/&nbsp;Costs");
                builder.AppendFormat(tdFormat, "Inclusions&nbsp;/&nbsp;Exclusions&nbsp;/&nbsp;Notes");
                if (Regions.RegionMap)
                {
                    builder.AppendFormat(tdFormat, "Map&nbsp;of&nbsp;the&nbsp;Region");
                }
                builder.Append("\n\t\t</tr>\n\t\t<tr>");
                if (Regions.SuggestedHotels)
                {
                    builder.AppendFormat(tdFormat, "Information&nbsp;on&nbsp;the&nbsp;suggested&nbsp;hotel&nbsp;list");
                }
                if (Regions.ItineraryBrief)
                {
                    builder.AppendFormat(tdFormat, "Your&nbsp;Itinerary&nbsp;in&nbsp;Brief");
                }
                if (Regions.ItineraryDetail)
                {
                    builder.AppendFormat(tdFormat, "Your&nbsp;Itinerary&nbsp;in&nbsp;Detail");
                }
                builder.Append("\n\t\t</tr>\n\t</tbody>\n</table>");

                response = CoveringNote.Replace(txtReplace, builder.ToString());
            }
            else
            {
                response = CoveringNote;
            }
            return(response);
        }
Esempio n. 2
0
        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"));
            }
        }