public IActionResult GetTourEntities(TourEntitiesParam tourEntitiesParam)
        {
            model = new TourEntitiesViewModel();

            if (!string.IsNullOrEmpty(tourEntitiesParam.TourType) && tourEntitiesParam.TourType == "TE")
            {
                model = GetDynamicTourEntities(tourEntitiesParam);
                model = model != null ? model : new TourEntitiesViewModel();
                model.DynamicTourEntity = model.DynamicTourEntity != null && model.DynamicTourEntity.Count > 0 ? model.DynamicTourEntity : new List <DynamicTourEntity>();
                return(PartialView("_TourEntities", model));
            }
            else
            {
                TourEntitiesGetReq tourEntitiesGetReq = new TourEntitiesGetReq()
                {
                    QRFID = tourEntitiesParam.QRFID, Type = tourEntitiesParam.Type, PositionID = tourEntitiesParam.PositionID
                };
                model = positionMapping.GetTourEntities(_configuration, token, tourEntitiesGetReq);

                if (model != null && model.PaxSlabDetails != null && model.PaxSlabDetails.PaxSlabs.Count > 0)
                {
                    var tourentitycnt = model.TourEntities.GroupBy(a => new { a.Type, a.PaxSlab, a.PositionID }).Select(m => new { m.Key.Type, m.Key.PaxSlab, m.Key.PositionID, TECount = m.Count() });

                    return(Json(new { PositionNotExists = model.PositionNotExists, PaxSlabs = model.PaxSlabDetails.PaxSlabs, TourEntity = model.TourEntities, QRFId = model.QRFID, TourEntityCnt = tourentitycnt, ResponseStatus = model.ResponseStatus, RoomList = model.AutoCompleteTextBox }));
                }
                else
                {
                    return(Json(new { PositionNotExists = new List <string>(), PaxSlabs = new PaxSlabs(), TourEntities = new TourEntities(), QRFId = model.QRFID, TourEntityCnt = "", ResponseStatus = model.ResponseStatus, RoomList = new List <AutoCompleteTextBox>() }));
                }
            }
        }
Esempio n. 2
0
        public async Task <TourEntitiesGetRes> GetTourEntities(TourEntitiesGetReq tourEntitiesGetReq, string ticket)
        {
            TourEntitiesGetRes tourEntitiesGetRes = new TourEntitiesGetRes();

            tourEntitiesGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceTourEntity:GetTourEntities"), tourEntitiesGetReq, typeof(TourEntitiesGetRes), ticket);

            return(tourEntitiesGetRes);
        }
 public TourEntitiesViewModel GetDynamicTourEntities(TourEntitiesParam tourEntitiesParam)
 {
     model = new TourEntitiesViewModel();
     try
     {
         TourEntitiesGetReq tourEntitiesGetReq = new TourEntitiesGetReq()
         {
             QRFID = tourEntitiesParam.QRFID, GetType = tourEntitiesParam.TourType
         };
         model = positionMapping.GetDynamicTourEntities(_configuration, token, tourEntitiesGetReq);
     }
     catch (Exception ex)
     {
         throw;
     }
     return(model);
 }
Esempio n. 4
0
        public async Task <TourEntitiesGetRes> GetDynamicTourEntities([FromBody] TourEntitiesGetReq request)
        {
            var response = new TourEntitiesGetRes();

            try
            {
                if (request != null && !string.IsNullOrEmpty(request.QRFID))
                {
                    response = await _positionRepository.GetDynamicTourEntities(request);
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "QRF ID can not be Null/Zero.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message;
            }

            return(response);
        }