Esempio n. 1
0
        public AirlineCarrierFlight Find(string CarrierId, DateTime FlightDate, string FlightNo)
        {
            _carrierid  = CarrierId;
            _flightdate = FlightDate;
            _flightno   = FlightNo;

            AirlineCarrierFlight flight = new AirlineCarrierFlight();
            int i = 0;

            if (_instance == null)
            {
                _instance = new AirlineCarrierFlights();
                //_instance.GetCarrierFlights(_carrierid,_flightdate);
            }
            else
            {
                _instance.ClearItems();
            }
            _instance.GetCarrierFlights(_carrierid, _flightdate);
            while (i < _instance.Count)
            {
                if (_instance.Items[i].CarrierFlightNo == _flightno.TrimEnd().TrimStart())
                {
                    flight = _instance.Items[i];
                    break;
                }
                i += 1;
            }



            return(flight);
        }
Esempio n. 2
0
        //public AirlineCarrierFlight GetCarrierFlight(string CarrierID, DateTime FlightDate, string FlightNo)
        //{
        //    _carrierid = CarrierID;
        //    _flightdate = FlightDate;
        //    _flightno = FlightNo;

        //    DataTable dt = new DataTable();
        //    dt = DABase.Instance.ExecSP(cn_spGetCarrierFlight, DABase.Instance.Parameter(cn_pmCarrierID, _carrierid), DABase.Instance.Parameter(cn_pmFlightDate, _flightdate.ToShortDateString()), DABase.Instance.Parameter(cn_pmFlightNo, _flightno));
        //    AirlineCarrierFlight flight;
        //    flight = new AirlineCarrierFlight(dt.Rows[0]);

        //    return flight;

        //}
        public AirlineCarrierFlights GetCarrierFlights(string CarrierID, DateTime FlightDate)
        {
            _carrierid  = CarrierID;
            _flightdate = FlightDate;
            DataTable dt = new DataTable();

            dt = DABase.Instance.ExecSP(cn_spGetCarrierFlights, DABase.Instance.Parameter(cn_pmCarrierID, _carrierid), DABase.Instance.Parameter(cn_pmFlightDate, _flightdate.ToShortDateString()));

            if (_instance == null)
            {
                _instance = new AirlineCarrierFlights();
                //_instance.GetCarrierFlights(_carrierid,_flightdate);
            }
            else
            {
                _instance.ClearItems();
            }
            foreach (DataRow dr in dt.Rows)
            {
                AirlineCarrierFlight flight;
                flight = new AirlineCarrierFlight(dr);
                _instance.Add(flight);
            }
            ;
            return(_instance);

            {
            }
        }
Esempio n. 3
0
        public AirlineCarrierFlights ListAllCarrierFlights(DateTime FlightDate)
        {
            _flightdate = FlightDate;
            DataTable dt = new DataTable();

            dt = DABase.Instance.ExecSP(cn_spListAll, DABase.Instance.Parameter(cn_pmFlightDate, _flightdate));

            if (_instance == null)
            {
                _instance = new AirlineCarrierFlights();
                //_instance.GetCarrierFlights(_carrierid,_flightdate);
            }
            else
            {
                _instance.ClearItems();
            }
            foreach (DataRow dr in dt.Rows)
            {
                AirlineCarrierFlight flight;
                flight = new AirlineCarrierFlight(dr);
                _instance.Add(flight);
            }
            ;
            return(_instance);

            {
            }
        }