Ejemplo n.º 1
0
        public IActionResult GetSupplierPrice(string QRFID, long DepartureId = 0, long PaxSlabId = 0, string PositionId = null, string SupplierId = null)
        {
            try
            {
                #region Get Guesstimate by QRFId
                GuesstimateGetRes response = new GuesstimateGetRes();
                GuesstimateGetReq request  = new GuesstimateGetReq();
                request.QRFID       = QRFID;
                request.DepartureId = DepartureId;
                request.PaxSlabId   = PaxSlabId;
                request.PositionId  = PositionId;
                request.SupplierId  = SupplierId;
                request.LoginUserId = ckUserEmailId;

                if (DepartureId == 0)
                {
                    QRFDepartureDateGetReq objDepartureDatesReq = new QRFDepartureDateGetReq()
                    {
                        QRFID = QRFID, date = (DateTime?)null
                    };
                    QRFDepartureDateGetRes objDepartureDatesRes = coProviders.GetDepartureDatesForCostingByQRF_Id(objDepartureDatesReq, token).Result;
                    request.DepartureId = objDepartureDatesRes.DepartureDates[0].Departure_Id;
                }
                if (PaxSlabId == 0)
                {
                    QRFPaxSlabGetReq objPaxSlabReq = new QRFPaxSlabGetReq()
                    {
                        QRFID = QRFID
                    };
                    QRFPaxGetResponse objPaxSlabRes = coProviders.GetPaxSlabDetailsForCostingByQRF_Id(objPaxSlabReq, token).Result;
                    request.PaxSlabId = objPaxSlabRes.PaxSlabDetails.QRFPaxSlabs[0].PaxSlab_Id;
                }

                response = coProviders.GetSupplierPrice(request, token).Result;
                #endregion
                return(Json(response));
            }
            catch (Exception ex)
            {
                return(View());
            }
        }