public IActionResult Activities()
        {
            ActivitiesViewModel model = new ActivitiesViewModel();

            try
            {
                string QRFID      = Request.Query["QRFId"].ToString();
                string SaveType   = Request.Query["SaveType"].ToString();
                string PositionId = Request.Query["PositionId"];
                bool   IsClone    = Convert.ToBoolean(Request.Query["IsClone"]);
                model.QRFID = QRFID;
                model.MenuViewModel.QRFID      = QRFID;
                model.MenuViewModel.PositionId = PositionId;
                PositionGetReq positionGetReq = new PositionGetReq {
                    QRFID = QRFID
                };
                if (!string.IsNullOrEmpty(PositionId) && PositionId.Substring(0, 8) != "00000000")
                {
                    positionGetReq.PositionId = PositionId;
                }
                positionGetReq.ProductType.Add(new ProductType {
                    ProdType = "Attractions"
                });
                positionGetReq.ProductType.Add(new ProductType {
                    ProdType = "Sightseeing - CityTour"
                });
                positionGetReq.IsClone = IsClone;

                PositionGetRes positionGetRes = positionProviders.GetPosition(positionGetReq, token).Result;
                positionMapping.ActivitiesGet(positionGetRes, null, ref model, token);

                if (string.IsNullOrEmpty(PositionId))
                {
                    if (!string.IsNullOrEmpty(SaveType) && SaveType.ToLower() == "full")
                    {
                        model.SaveType = "success";
                        return(PartialView("_Activities", model));
                    }
                    else
                    {
                        return(View(model));
                    }
                }
                else
                {
                    return(PartialView("_Activities", model));
                }
            }
            catch (Exception ex)
            {
                throw;
                Console.WriteLine(ex.Message);
                return(View(model));
            }
        }
Example #2
0
        public IActionResult Rail()
        {
            RailViewModel model = new RailViewModel();

            try
            {
                string QRFID      = Request.Query["QRFId"].ToString();
                string SaveType   = Request.Query["SaveType"].ToString();
                string PositionId = Request.Query["PositionId"];
                bool   IsClone    = Convert.ToBoolean(Request.Query["IsClone"]);

                model.QRFID = QRFID;
                model.MenuViewModel.QRFID      = QRFID;
                model.MenuViewModel.PositionId = PositionId;

                PositionGetReq positionGetReq = new PositionGetReq {
                    QRFID = QRFID, IsClone = IsClone
                };
                if (!string.IsNullOrEmpty(PositionId) && PositionId.Substring(0, 8) != "00000000")
                {
                    positionGetReq.PositionId = PositionId;
                }
                positionGetReq.ProductType.Add(new ProductType {
                    ProdType = "Train"
                });
                PositionGetRes positionGetRes = positionProviders.GetPosition(positionGetReq, token).Result;

                positionMapping.RailGet(positionGetRes, ref model, token);
                if (string.IsNullOrEmpty(PositionId))
                {
                    if (!string.IsNullOrEmpty(SaveType) && SaveType.ToLower() == "full")
                    {
                        model.SaveType = "success";
                        return(PartialView("_Rail", model));
                    }
                    else
                    {
                        return(View(model));
                    }
                }
                else
                {
                    return(PartialView("_Rail", model));
                }
            }
            catch (Exception ex)
            {
                return(View(model));
            }
        }
        //[Route("Quote/Accomodation")]
        public IActionResult Accomodation()
        {
            string QRFID = Request.Query["QRFId"].ToString();
            string PositionId = Request.Query["PositionId"].ToString();
            bool IsClone = Convert.ToBoolean(Request.Query["IsClone"]);
            string SuccessMessage = Request.Query["SuccessMessage"].ToString();
            string ErrorMessage = Request.Query["ErrorMessage"].ToString();

            ViewBag.MenuName = "Accomodation";
            model = new AccomodationViewModel();
            model.MenuViewModel.QRFID = QRFID;
            model.MenuViewModel.PositionId = PositionId;

            #region Get Quote Tour Info Header By QRFId
            NewQuoteViewModel modelQuote = new NewQuoteViewModel();
            modelQuote.QRFID = model.MenuViewModel.QRFID;
            model.TourInfoHeaderViewModel = posLibrary.GetSalesTourInfoHeader(ref modelQuote, token);
            #endregion

            positionGetReq = new PositionGetReq();
            positionGetReq.QRFID = QRFID;
            positionGetReq.PositionId = PositionId;
            positionGetReq.ProductType.Add(new ProductType { ProdType = "Hotel" });
            positionGetReq.IsClone = IsClone;

            positionGetRes = positionProviders.GetPosition(positionGetReq, token).Result;

            model = accomoMapping.AccomodationGet(positionGetRes, ref model, token);

            if (!(string.IsNullOrEmpty(SuccessMessage)))
                TempData["success"] = SuccessMessage;

            if (!(string.IsNullOrEmpty(ErrorMessage)))
                TempData["error"] = ErrorMessage;

            if (string.IsNullOrEmpty(PositionId))
            {
                if (string.IsNullOrEmpty(SuccessMessage) && string.IsNullOrEmpty(ErrorMessage))
                    return View(model);
                else
                    return PartialView("_Accomodation", model);
            }
            else
                return PartialView("_Accomodation", model);
        }
Example #4
0
        public IActionResult Others()
        {
            OthersViewModel model = new OthersViewModel();

            try
            {
                string ReturnView  = "";
                string QRFID       = Request.Query["QRFId"].ToString();
                string SaveType    = Request.Query["SaveType"].ToString();
                string PositionId  = Request.Query["PositionId"];
                string ProductType = Request.Query["ProductType"];
                bool   IsClone     = Convert.ToBoolean(Request.Query["IsClone"]);
                model.OthersLocalGuide.QRFID   = QRFID;
                model.MenuViewModel.QRFID      = QRFID;
                model.MenuViewModel.PositionId = PositionId;
                if (ProductType.ToLower() == "guide")
                {
                    model.MenuViewModel.MenuName = "LocalGuide";
                }
                PositionGetReq positionGetReq = new PositionGetReq {
                    QRFID = QRFID, IsClone = IsClone
                };
                if (!string.IsNullOrEmpty(PositionId) && PositionId.Substring(0, 8) != "00000000")
                {
                    positionGetReq.PositionId = PositionId;
                }
                else
                {
                    if (string.IsNullOrEmpty(ProductType) || ProductType.ToLower() == "guide")
                    {
                        positionGetReq.ProductType.Add(new ProductType {
                            ProdType = "Guide"
                        });
                        positionGetReq.ProductType.Add(new ProductType {
                            ProdType = "Assistant"
                        });
                    }
                    else if (!string.IsNullOrWhiteSpace(ProductType) && (ProductType.ToLower() == "other" || ProductType.ToLower() == "fee"))
                    {
                        positionGetReq.ProductType.Add(new ProductType {
                            ProdType = "Other"
                        });
                        positionGetReq.ProductType.Add(new ProductType {
                            ProdType = "Fee"
                        });
                    }
                    else
                    {
                        positionGetReq.ProductType.Add(new ProductType {
                            ProdType = ProductType
                        });
                    }
                }

                PositionGetRes positionGetRes = positionProviders.GetPosition(positionGetReq, token).Result;

                SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                NewQuoteViewModel modelQuote   = new NewQuoteViewModel {
                    QRFID = model.MenuViewModel.QRFID
                };
                bool GetStatus = quoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref modelQuote);
                if (GetStatus)
                {
                    model.TourInfoHeaderViewModel = modelQuote.TourInfoHeaderViewModel;
                }

                positionMapping.OthersLocalGuideGet(positionGetRes, ref model, token);

                switch (string.IsNullOrEmpty(ProductType) ? "" : ProductType.ToLower())
                {
                case "guide": ReturnView = "_OthersLocalGuide"; break;

                case "visa": ReturnView = "_OthersVisa"; break;

                case "insurance": ReturnView = "_OthersInsurance"; break;

                case "other": ReturnView = "_OthersMiscellaneous"; break;

                default: ReturnView = "_OthersLocalGuide"; break;
                }

                if (string.IsNullOrEmpty(PositionId) || PositionId.Substring(0, 8) == "00000000")
                {
                    if (!string.IsNullOrEmpty(SaveType) && SaveType.ToLower() == "full")
                    {
                        model.OthersLocalGuide.SaveType = "success";
                        return(PartialView(ReturnView, model.OthersLocalGuide));
                    }
                    else
                    {
                        return(View(model));
                    }
                }
                else
                {
                    return(PartialView(ReturnView, model.OthersLocalGuide));
                }
            }
            catch (Exception ex)
            {
                return(View(model));
            }
        }