Esempio n. 1
0
        public IHttpActionResult CheckFlights(string flight_code, string flight_date)
        {
            ReturnObject <Flight> ret = new ReturnObject <Flight>();

            try
            {
                if (string.IsNullOrEmpty(flight_code))
                {
                    throw new ArgumentException("flight code", nameof(flight_code));
                }

                if (string.IsNullOrEmpty(flight_date))
                {
                    throw new ArgumentException("flight date", nameof(flight_date));
                }


                var srv = new FlightService(orderDB);
                ret.Data        = srv.CheckFlights(flight_code, flight_date);
                ret.totalCount  = 1;
                ret.isCompleted = true;
            }
            catch (Exception e)
            {
                ret.SetMessage(e);
                ret.Tracking = new ReturnTracking();
            }


            return(Ok(ret));
        }