//возвращает список маршрутов
        public TransportItem[] GetRoutes(string cityFrom, string cityTo, DateTime fromId, Guid guid)
        {
            Transports[]  currentTransport = transportDalacess.GetRoutes(cityFrom, cityTo, fromId, guid);
            TransportItem transportItem    = new TransportItem();

            foreach (Transports transportItemContractData in currentTransport)
            {
                transportItem = new TransportItem();
                TranslateTransportDALtoTransportContractData(transportItemContractData, transportItem);
                transportItems.Add(transportItem);
            }
            transportItemsArray = transportItems.ToArray();
            return(transportItemsArray);
        }
 public void TranslateTransportDALtoTransportContractData(Transports transportDAL, TransportItem transportContractData)
 {
     transportContractData.TransportItemID = transportDAL.transportTypeId;
     transportContractData.RouteItem       = new TRoutesItemEntity()
     {
         ArrivalItem   = (DateTime)transportDAL.tRoutes.arrival,
         DepartureItem = (DateTime)transportDAL.tRoutes.departure,
         FromCityItem  = new CitesItemEntity()
         {
             CityName = transportDAL.tRoutes.Cities.city
         },
         ToCityItem = new CitesItemEntity()
         {
             CityName = transportDAL.tRoutes.Cities1.city
         },
         PriceItem = (int)transportDAL.tRoutes.price
     };
     transportContractData.TransportsTypeItem = new TransportTypeItem()
     {
         TransportTypeNameItem = transportDAL.TransportType.transportType1
     };
     transportContractData.SeatsCountItem     = (int)transportDAL.seatsCount;
     transportContractData.Number             = transportDAL.number;
     transportContractData.CarriageNumberItem = (int)transportDAL.carriageNumber;//номер вагона
     transportContractData.CostItem           = (int)transportDAL.cost;
 }