Пример #1
0
        // transfer serialized data contract to business wcf contract
        // links:
        //  how to generate durians: https://sql2x.org
        //  docLink: http://sql2x.org/documentationLink/6a251e13-1f76-48af-af34-18c592706874
        // parameters:
        //  dataContract: from durian ansi sql select statement
        public List <FlightHistoryContract> FlightHistoryFromDal(List <FlightHistoryData> dataList)
        {
            var list = new List <FlightHistoryContract>();

            foreach (FlightHistoryData data in dataList)
            {
                var contract = new FlightHistoryContract();
                DataToContract(data, contract);
                list.Add(contract);
            }

            return(list);
        }
Пример #2
0
 // transfer serialized data contract to business wcf contract
 // links:
 //  how to generate durians: https://sql2x.org
 //  docLink: http://sql2x.org/documentationLink/6140089a-d7c9-4e92-b385-f6fd91026820
 // parameters:
 //  dalFlightHistory: from durian ansi sql select statement
 //  dataContract: business wcf contract
 public void DataToContract(FlightHistoryData dalFlightHistory, FlightHistoryContract dataContract)
 {
     dataContract.DateTime = dalFlightHistory.DateTime;
     dataContract.FlightId = dalFlightHistory.FlightId;
     dataContract.AirlineIdentifierCode          = dalFlightHistory.AirlineIdentifierCode;
     dataContract.AirlineName                    = dalFlightHistory.AirlineName;
     dataContract.FlightNumber                   = dalFlightHistory.FlightNumber;
     dataContract.AircraftTypeName               = dalFlightHistory.AircraftTypeName;
     dataContract.DepartureAirportIdentifierCode = dalFlightHistory.DepartureAirportIdentifierCode;
     dataContract.DepartureAirportName           = dalFlightHistory.DepartureAirportName;
     dataContract.ArrivalAirportIdentifierCode   = dalFlightHistory.ArrivalAirportIdentifierCode;
     dataContract.ArrivalAirportName             = dalFlightHistory.ArrivalAirportName;
     dataContract.FromDateTime                   = dalFlightHistory.FromDateTime;
     dataContract.UntilDateTime                  = dalFlightHistory.UntilDateTime;
     dataContract.SegmentCount                   = dalFlightHistory.SegmentCount;
 }