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>() })); } } }
public IActionResult GetTourEntitiesAllowances(TourEntitiesParam tourEntitiesParam) { model = new TourEntitiesViewModel(); try { model = GetDynamicTourEntities(tourEntitiesParam); } catch (Exception ex) { throw; } return(PartialView("_TourEntities_Allowances", model)); }
public IActionResult TourEntities() { model = new TourEntitiesViewModel(); try { TourEntitiesParam tourEntitiesParam = new TourEntitiesParam(); tourEntitiesParam.QRFID = Request.Query["QRFId"]; model = GetDynamicTourEntities(tourEntitiesParam); } catch (Exception ex) { throw; } return(View(model)); }
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); }