示例#1
0
        public IActionResult GetPaxRange(string QRFID)
        {
            NewQuoteViewModel model = new NewQuoteViewModel();

            try
            {
                bool GetStatus = false;
                SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                if (!string.IsNullOrEmpty(QRFID))
                {
                    model.QRFID = QRFID;
                    model.mdlQuoteDateRangeViewModel.QRFID = QRFID;
                    GetStatus = quoteLibrary.GetQRFPaxSlabDetails(_configuration, token, ref model);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return(PartialView("_QuotePaxRange", model.mdlQuotePaxRangeViewModel));
        }
示例#2
0
        public IActionResult GetItinerary(string QRFID, string filterByDay = null, string filterByServiceType = null, long filterByDeparture = 0, long filterByPaxSlab = 0)
        {
            try
            {
                ItineraryViewModel model = new ItineraryViewModel();

                #region Get Quote Info By QRFId
                NewQuoteViewModel modelQuote = new NewQuoteViewModel();
                modelQuote.QRFID = QRFID;
                SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                bool GetStatus = false;
                GetStatus = quoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref modelQuote);
                if (GetStatus)
                {
                    model.TourInfoHeaderViewModel       = modelQuote.TourInfoHeaderViewModel;
                    model.MenuViewModel.EnquiryPipeline = modelQuote.mdlMenuViewModel.EnquiryPipeline;
                }
                #endregion

                #region Get Itinerary Details by QRFId
                itineraryGetReq          = new ItineraryGetReq();
                itineraryGetReq.QRFID    = QRFID;
                itineraryGetReq.editUser = ckUserEmailId;
                itineraryGetRes          = coProviders.GetItineraryDetails(itineraryGetReq, token).Result;
                model.Itinerary          = itineraryGetRes.Itinerary;
                #endregion

                #region Get Costsheet by QRFId
                NewQuoteViewModel modelQuote1 = new NewQuoteViewModel();
                bool GetStatus1 = false;
                SalesQuoteLibrary quoteLibrary1 = new SalesQuoteLibrary(_configuration);
                if (!string.IsNullOrEmpty(QRFID))
                {
                    modelQuote1.QRFID = QRFID;
                    GetStatus1        = quoteLibrary1.GetQRFPaxSlabDetails(_configuration, token, ref modelQuote1);
                }
                SalesProviders          objSalesProvider     = new SalesProviders(_configuration);
                DepartureDateGetRequest objDepartureDatesReq = new DepartureDateGetRequest()
                {
                    QRFID = QRFID, date = (DateTime?)null
                };
                DepartureDateGetResponse objDepartureDatesRes = objSalesProvider.GetDepartureDatesForQRFId(objDepartureDatesReq, token).Result;
                model.PaxSlabList = (modelQuote1.mdlQuotePaxRangeViewModel.QuotePaxSlabDetails).Select(a => new AttributeValues {
                    AttributeValue_Id = a.PaxSlabId.ToString(), Value = a.PaxSlabFrom + "-" + a.PaxSlabTo
                }).ToList();
                model.DepartureDatesList = (objDepartureDatesRes.DepartureDates).Select(a => new AttributeValues {
                    AttributeValue_Id = a.Departure_Id.ToString(), Value = Convert.ToDateTime(a.Date).ToString("dd MMM yy")
                }).ToList();
                long            defaultPaxSlabId = Convert.ToInt32(model.PaxSlabList[0].AttributeValue_Id);
                CostsheetGetReq request          = new CostsheetGetReq();
                CostsheetGetRes response         = new CostsheetGetRes();
                request.QRFID       = QRFID;
                request.DepartureId = filterByDeparture == 0 ? objDepartureDatesRes.DepartureDates[0].Departure_Id : filterByDeparture;
                request.PaxSlabId   = filterByPaxSlab == 0 ? defaultPaxSlabId : filterByPaxSlab;
                response            = coProviders.GetCostsheet(request, token).Result;
                #endregion

                #region Price Per Person Binding
                List <ItineraryDaysInfo>    lstDays      = itineraryGetRes.Itinerary.ItineraryDays.ToList();
                List <QRFPkgAndNonPkgPrice> lstPositions = new List <QRFPkgAndNonPkgPrice>();

                foreach (var a in lstDays)
                {
                    List <ItineraryDescriptionInfo> lstdes = a.ItineraryDescription.Where(x => x.KeepAs.ToUpper() != "INCLUDED").ToList();
                    foreach (var k in response.QrfNonPackagePrice.Where(y => y.RoomName.ToUpper() == "ADULT"))
                    {
                        foreach (var l in lstdes)
                        {
                            if (l.PositionId == k.PositionId)
                            {
                                lstPositions.Add(new QRFPkgAndNonPkgPrice {
                                    QRFCurrency = string.IsNullOrEmpty(k.QRFCurrency) ? "" : k.QRFCurrency.Substring(0, 3).ToUpper(), SellPrice = k.SellPrice, PositionId = k.PositionId, PositionKeepAs = k.PositionKeepAs, PaxSlabId = k.PaxSlab_Id, ProductName = k.ProductName, RoomName = k.RoomName
                                });
                            }
                        }
                    }
                }

                model.ListNonQrfPkgPositions = lstPositions;
                #endregion

                #region Filter Dropdown Bindings
                model.DayList         = GetDays(itineraryGetRes.Itinerary.ItineraryDays);
                model.ServiceTypeList = GetProductTypes(model.Itinerary.ItineraryDays);
                #endregion

                #region Date Binding
                if (filterByDay == "Day")
                {
                    filterByDay = null;
                }

                if (filterByServiceType == "Service Type")
                {
                    filterByServiceType = null;
                }

                if (!string.IsNullOrEmpty(filterByDay))
                {
                    model.Itinerary.ItineraryDays = model.Itinerary.ItineraryDays.Where(x => x.Day == filterByDay).ToList();
                }

                if (!string.IsNullOrEmpty(filterByServiceType))
                {
                    for (int i = 0; i < model.Itinerary.ItineraryDays.Count; i++)
                    {
                        model.Itinerary.ItineraryDays[i].ItineraryDescription = model.Itinerary.ItineraryDays[i].ItineraryDescription.Where(x => x.ProductType == filterByServiceType).ToList();
                    }
                }
                model.Days          = filterByDay;
                model.Services      = filterByServiceType;
                model.DepartureDate = filterByDeparture;
                model.PaxSlab       = filterByPaxSlab;
                #endregion

                return(PartialView("_Itinerary", model));
            }
            catch (Exception ex)
            {
                throw;
            }
        }