示例#1
0
        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));
            }
        }