public HttpResponseMessage GetFuelQuote(PartnerServiceIntegrationGetQuoteRequest model)
        {
            if (!CheckAccount(model))
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, badResponse));
            }

            FuelOrderPricingsCollection quotes = new FuelOrderPricingsCollection();

            foreach (string ICAO in model.ICAO.Split(','))
            {
                FuelOrderPricingsCollection quote = new FuelOrderPricingsCollection();

                if (ICAO != "")
                {
                    quotes.AddRange(FuelOrderPricingsService.GetQuoteForLocation(model.AdminClientID, model.CustClientID,
                                                                                 ICAO, model.TailNumber));
                }
            }

            ItemsResponse <FuelOrderPricings> response = new ItemsResponse <FuelOrderPricings>();

            response.Items = quotes;
            return(Request.CreateResponse(response));
        }
Exemple #2
0
        public HttpResponseMessage GetQuoteForLocation(GetQuoteForLocationRequest model)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
            ItemsResponse <FuelOrderPricings> response = new ItemsResponse <FuelOrderPricings>();

            response.Items = FuelOrderPricingsService.GetQuoteForLocation(model.AdminClientID, model.CustClientID, model.ICAO, model.TailNumber);
            return(Request.CreateResponse(response));
        }