public AmendmentController(IConfiguration configuration) : base(configuration) { _configuration = configuration; cOCommonLibrary = new COCommonLibrary(configuration); coProviders = new COProviders(_configuration); agentProviders = new AgentProviders(_configuration); }
public ItineraryController(IConfiguration configuration) : base(configuration) { _configuration = configuration; cOCommonLibrary = new COCommonLibrary(configuration); coProviders = new COProviders(_configuration); objMasterProviders = new MasterProviders(_configuration); }
public AgentApprovalController(IConfiguration configuration) : base(configuration) { _configuration = configuration; cOCommonLibrary = new COCommonLibrary(configuration); coProviders = new COProviders(_configuration); agentApprovalMapping = new AgentApprovalMapping(_configuration); }
public HandoverController(IConfiguration configuration) : base(configuration) { _configuration = configuration; cOCommonLibrary = new COCommonLibrary(configuration); coProviders = new COProviders(_configuration); handoverMapping = new HandoverMapping(_configuration); }
public GuesstimateController(IConfiguration configuration) : base(configuration) { _configuration = configuration; cOCommonLibrary = new COCommonLibrary(configuration); qrfSummaryProviders = new QRFSummaryProviders(_configuration); qrfSummaryMapping = new QRFSummaryMapping(_configuration); coProviders = new COProviders(_configuration); masterProviders = new MasterProviders(_configuration); }
public QRFSummaryController(IConfiguration configuration) : base(configuration) { _configuration = configuration; qrfSummaryProviders = new QRFSummaryProviders(_configuration); qrfSummaryMapping = new QRFSummaryMapping(_configuration); positionProviders = new PositionProviders(_configuration); masterProviders = new MasterProviders(_configuration); coProviders = new COProviders(_configuration); agentProviders = new AgentProviders(_configuration); operationsProviders = new OperationsProviders(_configuration); }
public ProposalController(IConfiguration configuration) : base(configuration) { _configuration = configuration; cOCommonLibrary = new COCommonLibrary(configuration); coProviders = new COProviders(_configuration); positionProviders = new PositionProviders(_configuration); itineraryMapper = new ItineraryMapper(_configuration); loginProviders = new LoginProviders(_configuration); agentProviders = new AgentProviders(_configuration); objSalesProvider = new SalesProviders(_configuration); operationsProviders = new OperationsProviders(_configuration); }
public COHeaderViewModel GetProposalDocumentHeaderDetails(string QRFID, HttpRequest request, HttpResponse response, string token) { COHeaderViewModel model = new COHeaderViewModel(); //if (string.IsNullOrEmpty(request.Cookies["TourName"])) //{ QuoteAgentGetReq objQRFAgentRequest = new QuoteAgentGetReq() { QRFID = QRFID }; COProviders objCOProvider = new COProviders(_configuration); ProposalDocumentGetRes objProposalRes = objCOProvider.GetProposalDocumentHeaderDetails(objQRFAgentRequest, token).Result; NewQuoteViewModel modelQuote = new NewQuoteViewModel { QRFID = QRFID }; model = GetCOTourInfoHeader(ref modelQuote, token); //model.SystemEmail = objProposalRes.SystemEmail; //model.SystemPhone = objProposalRes.SystemPhone; model.SystemEmail = model.SalesPerson ?? ""; model.SystemPhone = model.SalesPersonMobile ?? ""; model.SystemWebsite = objProposalRes.SystemWebsite ?? ""; //response.Cookies.Append("SystemEmail", objProposalRes.SystemEmail); //response.Cookies.Append("SystemPhone", objProposalRes.SystemPhone); //response.Cookies.Append("SystemWebsite", objProposalRes.SystemWebsite); //response.Cookies.Append("TravelDate", model.TravelDate.ToString()); //response.Cookies.Append("TourName", model.TourName); //response.Cookies.Append("ContactPerson", model.ContactPerson); //response.Cookies.Append("AgentName", model.AgentName); //response.Cookies.Append("PaxCount", model.Pax.ToString()); //} //else //{ // model.SystemEmail = request.Cookies["SystemEmail"]; // model.SystemPhone = request.Cookies["SystemPhone"]; // model.SystemWebsite = request.Cookies["SystemWebsite"]; // model.TravelDate = Convert.ToDateTime(request.Cookies["TravelDate"]); // model.TourName = request.Cookies["TourName"]; // model.ContactPerson = request.Cookies["ContactPerson"]; // model.AgentName = request.Cookies["AgentName"]; // model.Pax = Convert.ToInt32(request.Cookies["PaxCount"]); //} return(model); }
public CostsheetController(IConfiguration configuration) : base(configuration) { _configuration = configuration; cOCommonLibrary = new COCommonLibrary(configuration); coProviders = new COProviders(_configuration); }
public ProposalDocumentViewModel ProposalDocumentData() { string QRFID = Request.Query["QRFId"]; ProposalDocumentViewModel model = new ProposalDocumentViewModel(); if (!string.IsNullOrEmpty(QRFID)) { try { #region fetching all data from service COProviders objCOProvider = new COProviders(_configuration); QuoteAgentGetReq objQRFAgentRequest = new QuoteAgentGetReq() { QRFID = QRFID }; ProposalDocumentGetRes objProposalRes = objCOProvider.GetProposalDocumentDetailsByQRFID(objQRFAgentRequest, token).Result; model.COHeaderViewModel = COCommonLibrary.GetProposalDocumentHeaderDetails(QRFID, Request, Response, token); model.Itinerary = objProposalRes.Itinerary; model.Proposal = objProposalRes.Proposal; model.QRFQuote = objProposalRes.QRFQuote; model.ProductImages = objProposalRes.ProductImages; model.GenericImages = objProposalRes.GenericImages; model.CountryImageInitial = _configuration.GetValue <string>("SystemSettings:CountryImageInitial"); model.URLinitial = model.COHeaderViewModel.URLinitial = HttpContext.Request.Scheme + "://" + HttpContext.Request.Host.Value; model.RoutingCities.AddRange(objProposalRes.Itinerary.ItineraryDays.Select(a => a.City + "," + a.Country)); model.RoutingCities.AddRange(objProposalRes.Itinerary.ItineraryDays.Select(a => a.ToCityName + "," + a.ToCountryName)); model.RoutingCities = model.RoutingCities.Distinct().ToList(); model.RoutingCities.RemoveAll(a => string.IsNullOrEmpty(a) || a == ","); model.Itinerary.ItineraryDays.ForEach(a => a.Hotel = a.Hotel.Where(b => b.IsDeleted == false).ToList()); model.Itinerary.ItineraryDays.ForEach(a => a.Meal = a.Meal.Where(b => b.IsDeleted == false).ToList()); if (model.Proposal != null && model.Proposal.ProposalIncludeRegions == null) { model.Proposal.ProposalIncludeRegions = new ProposalIncludeRegions(); } #endregion #region creating dates list for date range DateTime date; string month; var list = new List <ProposalDepartDate>(); foreach (var item in model.QRFQuote.Departures.OrderBy(a => a.Date)) { date = Convert.ToDateTime(item.Date); month = date.ToString("MMMM"); list.Add(new ProposalDepartDate { Day = date.Day.ToString(), Month = month, Year = date.Year.ToString() }); } var list2 = new List <ProposalDepartDate>(); foreach (var item in list) { month = item.Month + " " + item.Year; if (list2.Where(a => a.Month == month).Count() > 0) { list2.Where(a => a.Month == month).FirstOrDefault().Day += (", " + item.Day); } else { list2.Add(new ProposalDepartDate { Month = month, Day = item.Day }); } } model.DatesList = list2; #endregion #region google maps section StaticMap._configuration = _configuration; //GeocoderLocation geocoder = StaticMap.Locate(model.QRFQuote.AgentProductInfo.Destination.Split('|')[1]); string mapURL = "https://maps.googleapis.com/maps/api/staticmap?center={0}&zoom=3&size=233x206&maptype=roadmap&key=GoogleAPIKey&markers=color:red|label:AA|{0}"; mapURL = string.Format(mapURL, model.QRFQuote.AgentProductInfo.Destination.Split('|')[1]); if (StaticMap.RenderImage(mapURL, QRFID + "_ProposalDocument_smallmap.png", out string output)) { model.SmallMapURL = output; } mapURL = "https://maps.googleapis.com/maps/api/staticmap?size=773x682&maptype=roadmap&key=GoogleAPIKey"; foreach (string city in model.RoutingCities) { //geocoder = StaticMap.Locate(city); mapURL += "&markers=color:red|label:AA|{0}"; mapURL = string.Format(mapURL, city); } if (StaticMap.RenderImage(mapURL, QRFID + "_ProposalDocument_bigmap.png", out output)) { model.BigMapURL = output; } string ProdId = ""; for (int i = 0; i < model.Itinerary.ItineraryDays.Count; i++) { for (int j = 0; j < model.Itinerary.ItineraryDays[i].Hotel.Count; j++) { if (!string.IsNullOrEmpty(model.Itinerary.ItineraryDays[i].Hotel[j].Lat) && !string.IsNullOrEmpty(model.Itinerary.ItineraryDays[i].Hotel[j].Long) && model.Itinerary.ItineraryDays[i].Hotel[j].IsDeleted == false) { ProdId = !string.IsNullOrEmpty(model.Itinerary.ItineraryDays[i].Hotel[j].HotelId) ? model.Itinerary.ItineraryDays[i].Hotel[j].HotelId : model.Itinerary.ItineraryDays[i].Hotel[j].PositionId; mapURL = "https://maps.googleapis.com/maps/api/staticmap?zoom=10&size=284x191&maptype=roadmap&key=GoogleAPIKey"; mapURL += "&markers=color:red|label:AA|{0},{1}"; mapURL = string.Format(mapURL, model.Itinerary.ItineraryDays[i].Hotel[j].Lat, model.Itinerary.ItineraryDays[i].Hotel[j].Long); if (StaticMap.RenderImage(mapURL, ProdId + "_ProposalDocument_hotelmap.png", out output)) { model.Itinerary.ItineraryDays[i].Hotel[j].HotelMapURL = output; } } } } #endregion #region Proposal Terms string templatePath = _configuration.GetValue <string>("Pages:ProposalTermsTemplate"); var pathToFile = Path.Combine(Directory.GetCurrentDirectory(), templatePath); var builder = new StringBuilder(); using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile)) { builder.Append(SourceReader.ReadToEnd()); model.Proposal.Terms += Environment.NewLine + builder.ToString(); } #endregion #region fetching hotel images from expedia string HotelMapImage; List <ArrProductResources> HotelRes = new List <ArrProductResources>(); foreach (var days in model.Itinerary.ItineraryDays) { foreach (var hotel in days.Hotel) { if (hotel.ProdResources != null) { HotelRes = hotel.ProdResources.Where(a => a.ResourceType == "Image").OrderBy(a => a.OrderNr).ToList(); } if (hotel.ProdResources == null || HotelRes == null || HotelRes.Count < 1 || (HotelRes.Count > 0 && string.IsNullOrEmpty(HotelRes[0].ImageSRC))) { if (StaticMap.RenderExpediaImage(hotel.HotelCode, ProdId + "_ProposalDocument_hotelimage.png", out output)) { HotelMapImage = output; } } } } #endregion #region replacing image urls from resources to ImageResources foreach (var ItineraryDay in model.Itinerary.ItineraryDays) { if (ItineraryDay.Hotel != null) { foreach (var Hotel in ItineraryDay.Hotel) { if (Hotel.ProdResources != null) { foreach (var ProdResource in Hotel.ProdResources) { if (ProdResource.ImageSRC != null) { ProdResource.ImageSRC = ProdResource.ImageSRC.Replace("resources/", "ImageResources/"); } } } } } } #endregion #region Get Hotel Summary details from Itinerary ProposalGetReq req = new ProposalGetReq(); ProposalGetRes res = new ProposalGetRes(); req.QRFID = QRFID; res = objCOProvider.GetHotelSummaryByQrfId(req, token).Result; var hotellist = res.Hotels; model.HotelList = hotellist.Select(x => new Hotel { HotelName = x.HotelName, Location = string.IsNullOrWhiteSpace(x.Location) ? "" : x.Location.Split(',')[0], Stars = x.Stars, Duration = x.Duration }).ToList(); #endregion } catch (Exception ex) { throw; //Console.WriteLine(ex.Message); } } return(model); }
public ProposalLibrary(IConfiguration configuration) { _configuration = configuration; coProviders = new COProviders(_configuration); cOCommonLibrary = new COCommonLibrary(configuration); }
public COCommonLibrary(IConfiguration configuration) { _configuration = configuration; salesQuoteLibrary = new SalesQuoteLibrary(_configuration); coProviders = new COProviders(_configuration); }