Esempio n. 1
0
        public ActionResult Edit(int id)
        {
            Itinerary          itinerary          = itineraryBL.GetItineraryById(id);
            ItineraryViewModel itineraryViewModel = AutoMapper.Mapper.Map <Itinerary, ItineraryViewModel>(itinerary);

            return(View(itineraryViewModel));
        }
Esempio n. 2
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (ItineraryViewModel.Trips.Count < 1)
     {
         ItineraryViewModel.LoadTrips();
     }
 }
Esempio n. 3
0
        public IActionResult SaveActivityList(ItineraryViewModel model)
        {
            try
            {
                ItinerarySetRes response = new ItinerarySetRes();
                ItinerarySetReq request  = new ItinerarySetReq();

                request.itinerary.ItineraryID   = model.Itinerary.ItineraryID;
                request.itinerary.ItineraryDays = model.Itinerary.ItineraryDays;
                request.QRFId         = model.MenuViewModel.QRFID;
                request.VoyagerUserId = ckLoginUser_Id;
                response = coProviders.SetItinerary(request, token).Result;

                if (response.ResponseStatus.Status.ToLower() == "success")
                {
                    TempData["success"] = "Details saved successfully";
                }
                else
                {
                    TempData["error"] = response.ResponseStatus.Status;
                }
                return(RedirectToAction("ActivityList", new { QRFId = model.MenuViewModel.QRFID }));
            }
            catch (System.Exception ex)
            {
                return(View());
            }
        }
Esempio n. 4
0
        public IActionResult SetConfirmBooking(DepatureInfoGetReq request)
        {
            HandoverViewModel model    = new HandoverViewModel();
            string            UserName = ckUserEmailId;
            string            msg      = "";
            string            status   = "";

            ConfirmBookingSetRes confirmBookingSetRes = handoverMapping.SetGoAheadConfirmMessage(token, request.QRFID, UserName, request.DepatureId);

            if (confirmBookingSetRes?.ResponseStatus?.Status?.ToLower() == "success")
            {
                foreach (var item in request.DepatureId)
                {
                    model = handoverMapping.SetConfirmBooking(token, request.QRFID, UserName, new List <long>()
                    {
                        item
                    });
                }
            }
            status = "Success";
            msg    = "Booking Confirmation done successfully.";
            return(Json(new
            {
                message = msg,
                msgstatus = status
            }));
        }
Esempio n. 5
0
 private async Task <ContentDialogResult> ShowContentDialog()
 {
     return(await ItineraryViewModel.ShowContentDialog(
                ResourceLoader.GetString("LocationDialogTitle"),
                ResourceLoader.GetString("LocationDialogContent"),
                ResourceLoader.GetString("LocationDialogClose")));
 }
        public ItineraryDetails(INavigation pageNavigation, ItineraryViewModel itineraryVm)
        {
            InitializeComponent();

            Title = itineraryVm.TripName;
            //TODO:
            BindingContext = viewModel = new ItineraryDetailsViewModel(pageNavigation, itineraryVm);
        }
        public ItineraryPage()
        {
            this.InitializeComponent();
            this.ItineraryVM = new ItineraryViewModel();

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
            SystemNavigationManager.GetForCurrentView().BackRequested += (object sender, BackRequestedEventArgs e) => this.NavigateToDetailPage(ItineraryVM.Trip);
        }
        public ItineraryDetails(INavigation pageNavigation, ItineraryViewModel itineraryVm)
        {
            InitializeComponent();
            /*NavigationPage.SetHasNavigationBar(*/

            //TODO:
            BindingContext = viewModel = new ItineraryDetailsViewModel(pageNavigation, itineraryVm);
        }
Esempio n. 9
0
        public IActionResult Handover(string QRFID)
        {
            HandoverViewModel model = new HandoverViewModel();

            model = handoverMapping.GetHandover(token, QRFID);
            model.DepatureInfo = handoverMapping.GetGoAheadDeparturesDetails(token, QRFID);

            return(View("Handover/Handover", model));
        }
Esempio n. 10
0
 public IActionResult ActivityList(string QRFID)
 {
     QRFID = string.IsNullOrEmpty(QRFID) ? Request.Query["QRFId"].ToString() : QRFID;
     model = GetSalesOfficerHeraderInfo(QRFID, "ActivityList");
     model.MenuViewModel.QRFID                   = QRFID;
     model.AgentApprovalHeaderButtons            = new AgentApprovalHeaderButtons();
     model.AgentApprovalHeaderButtons.QRFID      = QRFID;
     model.AgentApprovalHeaderButtons.QRFPriceID = model.COHeaderViewModel.QRFPriceID;
     return(View("ActivityList/ActivityList", model));
 }
Esempio n. 11
0
        public IActionResult AcceptSendToClient(string QRFID, string id, string emailid, string status)
        {
            //  DeleteAllCookies();
            OfflineMessageViewModel model = new OfflineMessageViewModel();

            model = agentApprovalMapping.AcceptSendToClient(new SendToClientGetReq {
                QRFPriceID = id, QRFID = QRFID, MailStatus = status, Document_Id = emailid
            });

            return(View("SendToClient/OfflineMessage", model));
        }
Esempio n. 12
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Travellist = (Travellist)e.Parameter;
            Travellist.SortItineraryByDate();

            DataContext = new ItineraryViewModel(Travellist, null);
            Ivm         = (ItineraryViewModel)DataContext;

            cmbDestinations.SelectedItem = determineNext();
            CalcRoute();
        }
Esempio n. 13
0
        public UpdateDestinationDialog(ItineraryViewModel ivm, Destination destination)
        {
            this.InitializeComponent();
            Destination = destination;
            Ivm         = ivm;

            NameTextBox.Text        = Destination.Name;
            StreetTextBox.Text      = Destination.Street;
            NrTextBox.Text          = Destination.Nr;
            CityTextBox.Text        = Destination.City;
            DescriptionTextBox.Text = Destination.Description;
            DatePicker.Date         = Destination.VisitTime.Date;
            TimePicker.Time         = Destination.VisitTime.TimeOfDay;
        }
Esempio n. 14
0
        public IActionResult AttachToMaster(string QRFID, string type = "")
        {
            AttachToMasterViewModel model = new AttachToMasterViewModel();

            model = handoverMapping.GetGoAhead(token, new GoAheadGetReq {
                QRFID = QRFID, GoAheadId = ""
            });
            if (!string.IsNullOrEmpty(type) && type == "partial")
            {
                return(PartialView("AttachToMaster/_AttachToMaster", model));
            }

            return(View("AttachToMaster/AttachToMaster", model));
        }
Esempio n. 15
0
        public ActionResult Update([Bind(Include = "ItineraryId,PackageId,HotelName,HotelLocation,SightSeeing,Meal,DayName,ImageSource,ImageFile,DetailedItinerary,Location")] ItineraryViewModel itineraryViewModel)
        {
            string fileName  = Path.GetFileNameWithoutExtension(itineraryViewModel.ImageFile.FileName);
            string extension = Path.GetExtension(itineraryViewModel.ImageFile.FileName);

            fileName = fileName + DateTime.Now.ToString("yymmssfff") + extension;
            itineraryViewModel.ImageSource = "~/Images/ItineraryImages/" + fileName;
            Itinerary itinerary = AutoMapper.Mapper.Map <ItineraryViewModel, Itinerary>(itineraryViewModel);

            fileName = Path.Combine(Server.MapPath("~/Images/ItineraryImages/"), fileName);
            itineraryViewModel.ImageFile.SaveAs(fileName);
            itineraryBL.UpdateItinerary(itinerary);
            return(RedirectToAction("ViewItinerary", new { id = itinerary.PackageId }));
        }
Esempio n. 16
0
        public ItineraryViewModel GetSalesOfficerHeraderInfo(string QRFID, string MenuName)
        {
            model = new ItineraryViewModel();
            model.MenuViewModel.QRFID    = QRFID;
            model.MenuViewModel.MenuName = MenuName;

            #region Get Costing Officer Tour Info Header By QRFId
            NewQuoteViewModel modelQuote = new NewQuoteViewModel();
            modelQuote.QRFID                    = QRFID;
            model.COHeaderViewModel             = cOCommonLibrary.GetCOTourInfoHeader(ref modelQuote, token);
            model.MenuViewModel.EnquiryPipeline = modelQuote.mdlMenuViewModel.EnquiryPipeline;
            #endregion
            return(model);
        }
Esempio n. 17
0
        public IActionResult GetGoAheadDepature(string QRFID, string GoAheadId, long depatureid)
        {
            Materialisation model = new Materialisation();

            if (depatureid > 0)
            {
                model = handoverMapping.GetGoAheadDepature(token, new GoAheadGetReq {
                    QRFID = QRFID, GoAheadId = GoAheadId, DepatureId = depatureid
                });
                model.GoAheadId   = GoAheadId;
                model.QRFID       = QRFID;
                model.DepartureId = depatureid;
            }
            return(PartialView("AttachToMaster/_Materialisation", model));
        }
Esempio n. 18
0
        public IActionResult Itinerary(string QRFID)
        {
            ItineraryViewModel model = new ItineraryViewModel();

            model.MenuViewModel.QRFID    = QRFID;
            model.MenuViewModel.MenuName = "Itinerary";

            #region Get Costing Officer Tour Info Header By QRFId
            NewQuoteViewModel modelQuote = new NewQuoteViewModel();
            modelQuote.QRFID                    = QRFID;
            model.COHeaderViewModel             = cOCommonLibrary.GetCOTourInfoHeader(ref modelQuote, token);
            model.MenuViewModel.EnquiryPipeline = modelQuote.mdlMenuViewModel.EnquiryPipeline;
            #endregion
            return(View(model));
        }
Esempio n. 19
0
        public IActionResult SetGoAheadNewDepartures(GoAheadNewDeptGetRes objGoAheadNewDeptGetRes)
        {
            GoAheadNewDeptSetRes model = new GoAheadNewDeptSetRes();
            string msg    = "";
            string status = "";

            model = handoverMapping.SetGoAheadNewDepartures(new GoAheadNewDeptSetReq()
            {
                ExisitingDepatures = new ExisitingDepatures()
                {
                    DepatureId = Convert.ToInt64(objGoAheadNewDeptGetRes.ExistDepartureId)
                },
                GoAheadId    = objGoAheadNewDeptGetRes.GoAheadId,
                QRFID        = objGoAheadNewDeptGetRes.QRFID,
                NewDepatures = objGoAheadNewDeptGetRes.NewDepatures,
                UserEmail    = ckUserEmailId
            }, token);

            if (!string.IsNullOrEmpty(model?.ResponseStatus?.Status))
            {
                status = model.ResponseStatus.Status;
                msg    = model.ResponseStatus.ErrorMessage;
                if (status.ToLower() == "error")
                {
                    TempData["error"] = msg;
                }
                else
                {
                    TempData["success"] = msg;
                }
            }
            else
            {
                status            = "Error";
                msg               = "New Departure dates not added.";
                TempData["error"] = msg;
            }

            return(Json(new
            {
                message = msg,
                msgstatus = status
            }));
        }
Esempio n. 20
0
        public IActionResult GetGoAheadNewDepature(string QRFID, string GoAheadId)
        {
            GoAheadNewDeptGetRes model = new GoAheadNewDeptGetRes();

            model = handoverMapping.GetGoAheadExistDepartures(new GoAheadGetReq()
            {
                GoAheadId = GoAheadId, QRFID = QRFID
            }, token);
            model.GoAheadId    = GoAheadId;
            model.QRFID        = QRFID;
            model.NewDepatures = new List <NewDepatures>()
            {
                new NewDepatures()
                {
                    DepatureDate = DateTime.Now
                }
            };
            return(PartialView("AttachToMaster/_AddDepartures", model));
        }
Esempio n. 21
0
        public IActionResult AgentAcceptSendToClient(string QRFID, string id, string status)
        {
            OfflineMessageViewModel model = new OfflineMessageViewModel();

            ViewData.Add("agentaccept", "true");
            if (status == "agentaccept")
            {
                status = "accepted";
                model  = agentApprovalMapping.AcceptSendToClient(new SendToClientGetReq {
                    QRFPriceID = id, QRFID = QRFID, MailStatus = status, Type = "agentaccept", UserName = ckUserName, UserEmailId = ckUserEmailId, VoyagerUserId = ckLoginUser_Id
                });
            }
            else
            {
                model.Status     = "invalid";
                model.MailStatus = "accepted";
            }
            return(View("SendToClient/OfflineMessage", model));
        }
Esempio n. 22
0
        // GET: Itinerary
        public ActionResult Index()
        {
            var bookingRef         = HttpContext.Session["BookingRef"] != null ? HttpContext.Session["BookingRef"].ToString() : "123456";
            var viewModel          = new ItineraryViewModel();
            var datamanager        = new DataManager();
            var bookingDetails     = datamanager.GetBookingDetails(bookingRef);
            var destinationDetails = datamanager.GetDestinationDetails(bookingDetails.DestinationId.ToString());
            var flights            = datamanager.GetFlightDetails(bookingDetails.DestinationId.ToString());
            var resorts            = datamanager.GetResortDetails(bookingDetails.ResortId.ToString());

            viewModel.ArrivalName               = flights.FlightTo;
            viewModel.DestinationName           = flights.FlightFrom;
            viewModel.OutboundDepartureDatetime = flights.OutboundDepartureFlightDate + " " + flights.OutboundDepartureFlightTime;
            viewModel.OutboundArrivalDateTime   = flights.OutboundArrivalFlightDate + " " + flights.OutboundArrivalFlightTime;
            viewModel.InboundDepartureTime      = flights.InboundDepartureFlightDate + " " + flights.InboundDepartureFlightTime;
            viewModel.InboundArrivalTime        = flights.InboundArrivalFlightDate + " " + flights.InboundArrivalFlightTime;
            viewModel.OutboundDuration          = flights.OutboundFlightDuration;
            viewModel.InboundDuration           = flights.InboundFlightDuration;
            viewModel.BoardBasis    = bookingDetails.BoardBasis;
            viewModel.HotelName     = resorts.ResortName;
            viewModel.HotelDuration = bookingDetails.Duration;
            return(View(viewModel));
        }
Esempio n. 23
0
        public IActionResult Itinerary(string QRFID)
        {
            if (UserRoles.Contains("Product Accountant"))
            {
            }
            else if (!UserRoles.Contains("Costing Officer"))
            {
                return(View("Unauthorize"));
            }

            ItineraryViewModel model = new ItineraryViewModel();

            model.MenuViewModel.QRFID    = QRFID;
            model.MenuViewModel.MenuName = "Itinerary";

            #region Get Costing Officer Tour Info Header By QRFId
            NewQuoteViewModel modelQuote = new NewQuoteViewModel();
            modelQuote.QRFID                    = QRFID;
            model.COHeaderViewModel             = cOCommonLibrary.GetCOTourInfoHeader(ref modelQuote, token);
            model.MenuViewModel.EnquiryPipeline = modelQuote.mdlMenuViewModel.EnquiryPipeline;
            #endregion
            return(View(model));
        }
 public AddDestinationDialog(ItineraryViewModel ivm)
 {
     this.InitializeComponent();
     Ivm = ivm;
 }
Esempio n. 25
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     Travellist  = (Travellist)e.Parameter;
     DataContext = new ItineraryViewModel(Travellist, lvDestinations);
     Ivm         = (ItineraryViewModel)DataContext;
 }
 public DeleteDestinationCommand(ItineraryViewModel ivm)
 {
     _viewModel = ivm;
 }
Esempio n. 27
0
        public IActionResult GetPricingSummary(string QRFID, long filterByDeparture = 0, long filterByPaxSlab = 0)
        {
            try
            {
                ItineraryViewModel model = new ItineraryViewModel();
                long defaultPaxSlabId    = 0;
                #region Dropdown Binding
                QRFDepartureDateGetReq objDepartureDatesReq = new QRFDepartureDateGetReq()
                {
                    QRFID = QRFID, date = (DateTime?)null
                };
                QRFDepartureDateGetRes objDepartureDatesRes = coProviders.GetDepartureDatesForCostingByQRF_Id(objDepartureDatesReq, token).Result;
                QRFPaxSlabGetReq       objPaxSlabReq        = new QRFPaxSlabGetReq()
                {
                    QRFID = QRFID
                };
                QRFPaxGetResponse objPaxSlabRes = coProviders.GetPaxSlabDetailsForCostingByQRF_Id(objPaxSlabReq, token).Result;
                model.PaxSlabList = (objPaxSlabRes.PaxSlabDetails.QRFPaxSlabs).Select(a => new AttributeValues {
                    AttributeValue_Id = a.PaxSlab_Id.ToString(), Value = a.From + "-" + a.To
                }).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();
                if (model.PaxSlabList != null && model.PaxSlabList.Count > 0)
                {
                    defaultPaxSlabId = Convert.ToInt32(model.PaxSlabList[0].AttributeValue_Id);
                }
                #endregion

                #region Get Costsheet by QRFId
                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 Main Tour Bindings
                List <QRFPkgAndNonPkgPrice> lstQrfPkg = new List <QRFPkgAndNonPkgPrice>();
                foreach (var a in response.QrfPackagePrice.OrderBy(x => x.Age))
                {
                    if (lstQrfPkg.Where(x => x.RoomName == a.RoomName && x.Age == a.Age).Count() <= 0)
                    {
                        lstQrfPkg.Add(new QRFPkgAndNonPkgPrice {
                            PaxSlabId = a.PaxSlab_Id, DisplayRoomName = a.RoomName, RoomName = a.RoomName, SellPrice = a.SellPrice, Age = a.Age, QRFCurrency = string.IsNullOrEmpty(a.QRFCurrency) ? "" : a.QRFCurrency.Substring(0, 3).ToUpper()
                        });
                    }
                }

                #region Sequencewise sorting and Sell Price Calculation
                foreach (var l in lstQrfPkg.OrderBy(x => x.Age))
                {
                    double singleSellPrice = response.QrfPackagePrice.Where(x => x.RoomName.ToUpper() == "SINGLE" && x.PaxSlab_Id == l.PaxSlabId).Select(y => y.SellPrice).FirstOrDefault();
                    double doubleSellPrice = response.QrfPackagePrice.Where(x => x.RoomName.ToUpper() == "DOUBLE" && x.PaxSlab_Id == l.PaxSlabId).Select(y => y.SellPrice).FirstOrDefault();
                    double twinSellPrice   = response.QrfPackagePrice.Where(x => x.RoomName.ToUpper() == "TWIN" && x.PaxSlab_Id == l.PaxSlabId).Select(y => y.SellPrice).FirstOrDefault();
                    double tripleSellPrice = response.QrfPackagePrice.Where(x => x.RoomName.ToUpper() == "TRIPLE" && x.PaxSlab_Id == l.PaxSlabId).Select(y => y.SellPrice).FirstOrDefault();

                    if (l.RoomName.ToUpper() == "TWIN")
                    {
                        l.SequenceNo = 1;
                    }
                    else if (l.RoomName.ToUpper() == "DOUBLE")
                    {
                        l.SequenceNo = 2;
                    }
                    else if (l.RoomName.ToUpper() == "SINGLE")
                    {
                        if (l.DisplayRoomName == "SINGLE")
                        {
                            l.DisplayRoomName = "SGL SUPPLEMENT";
                        }

                        var price = twinSellPrice != 0 ? twinSellPrice : doubleSellPrice;
                        l.SellPrice = singleSellPrice != 0 ? singleSellPrice - price : singleSellPrice;

                        l.SequenceNo = 3;
                    }
                    else if (l.RoomName.ToUpper() == "TRIPLE")
                    {
                        if (l.DisplayRoomName == "TRIPLE")
                        {
                            l.DisplayRoomName = "TPL REDUCTION";
                        }

                        var price = twinSellPrice != 0 ? twinSellPrice : doubleSellPrice;
                        l.SellPrice = tripleSellPrice != 0 ? price - tripleSellPrice : tripleSellPrice;

                        l.SequenceNo = 4;
                    }
                    else if (l.RoomName.ToUpper() == "CHILDWITHBED")
                    {
                        if (l.DisplayRoomName.Contains("CHILDWITHBED"))
                        {
                            string roomname = l.DisplayRoomName;
                            l.DisplayRoomName = Regex.Replace(roomname, "CHILDWITHBED", "C + B") + " Age : " + l.Age;
                        }
                        l.SequenceNo = 5;
                    }
                    else if (l.RoomName.ToUpper() == "CHILDWITHOUTBED")
                    {
                        if (l.DisplayRoomName.Contains("CHILDWITHOUTBED"))
                        {
                            string roomname = l.DisplayRoomName;
                            l.DisplayRoomName = Regex.Replace(roomname, "CHILDWITHOUTBED", "C - B") + " Age : " + l.Age;
                        }
                        l.SequenceNo = 6;
                    }
                    else if (l.RoomName.ToUpper() == "INFANT")
                    {
                        l.SequenceNo = 100;
                    }
                    else
                    {
                        l.SequenceNo = 80;
                    }
                }
                #endregion
                #endregion

                #region Supplement Bindings
                List <QRFPkgAndNonPkgPrice> lstSupplementHeaders = new List <QRFPkgAndNonPkgPrice>();
                List <QRFPkgAndNonPkgPrice> lstSupplements       = new List <QRFPkgAndNonPkgPrice>();

                foreach (var a in response.QrfNonPackagePrice)
                {
                    if (a.PositionKeepAs.ToUpper() == "SUPPLEMENT")
                    {
                        if (lstSupplementHeaders.Where(x => x.PositionId == a.PositionId).Count() <= 0)
                        {
                            lstSupplementHeaders.Add(new QRFPkgAndNonPkgPrice {
                                PaxSlabId = a.PaxSlab_Id, PaxSlab = a.PaxSlab, SellPrice = a.SellPrice, RoomName = a.RoomName, PositionKeepAs = a.PositionKeepAs, PositionType = a.PositionType, PositionId = a.PositionId, ProductName = a.ProductName, QRFCurrency = string.IsNullOrEmpty(a.QRFCurrency) ? "" : a.QRFCurrency.Substring(0, 3).ToUpper()
                            });
                        }
                    }
                }

                foreach (var a in response.QrfNonPackagePrice)
                {
                    if (a.PositionKeepAs.ToUpper() == "SUPPLEMENT")
                    {
                        lstSupplements.Add(new QRFPkgAndNonPkgPrice {
                            PaxSlabId = a.PaxSlab_Id, PaxSlab = a.PaxSlab, SellPrice = a.SellPrice, RoomName = a.RoomName, Age = a.Age, PositionKeepAs = a.PositionKeepAs, PositionType = a.PositionType, PositionId = a.PositionId, ProductName = a.ProductName, QRFCurrency = string.IsNullOrEmpty(a.QRFCurrency) ? "" : a.QRFCurrency.Substring(0, 3).ToUpper()
                        });
                    }
                }

                model.SupplementProductList = GetProductsForSupplement(lstSupplementHeaders);
                #endregion

                #region Optional Bindings
                List <QRFPkgAndNonPkgPrice> lstOptionalHeaders = new List <QRFPkgAndNonPkgPrice>();
                List <QRFPkgAndNonPkgPrice> lstOptionals       = new List <QRFPkgAndNonPkgPrice>();

                foreach (var a in response.QrfNonPackagePrice)
                {
                    if (a.PositionKeepAs.ToUpper() == "OPTIONAL")
                    {
                        if (lstOptionalHeaders.Where(x => x.PositionId == a.PositionId).Count() <= 0)
                        {
                            lstOptionalHeaders.Add(new QRFPkgAndNonPkgPrice {
                                PaxSlabId = a.PaxSlab_Id, PaxSlab = a.PaxSlab, SellPrice = a.SellPrice, RoomName = a.RoomName, PositionKeepAs = a.PositionKeepAs, PositionType = a.PositionType, PositionId = a.PositionId, ProductName = a.ProductName, QRFCurrency = a.QRFCurrency.Substring(0, 3).ToUpper()
                            });
                        }
                    }
                }

                foreach (var a in response.QrfNonPackagePrice)
                {
                    if (a.PositionKeepAs.ToUpper() == "OPTIONAL")
                    {
                        lstOptionals.Add(new QRFPkgAndNonPkgPrice {
                            PaxSlabId = a.PaxSlab_Id, PaxSlab = a.PaxSlab, SellPrice = a.SellPrice, RoomName = a.RoomName, Age = a.Age, PositionKeepAs = a.PositionKeepAs, PositionType = a.PositionType, PositionId = a.PositionId, ProductName = a.ProductName, QRFCurrency = a.QRFCurrency.Substring(0, 3).ToUpper()
                        });
                    }
                }
                model.OptionalProductList = GetProductsForOptional(lstOptionalHeaders);
                #endregion

                model.MainTourList = lstQrfPkg.OrderBy(x => x.SequenceNo).ToList();

                model.QRFNonPkgSupplementPositions = lstSupplementHeaders;
                model.SupplementList = lstSupplements;

                model.QRFNonPkgOptionalPositions = lstOptionalHeaders;
                model.OptionalList = lstOptionals;

                model.DepartureDate = filterByDeparture;
                model.PaxSlab       = filterByPaxSlab;

                return(PartialView("_PricingSummary", model));
            }
            catch (Exception ex)
            {
                throw;
                return(View());
            }
        }
Esempio n. 28
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;
            }
        }