Esempio n. 1
0
        private void InitializationTaxopark(string[] Path)
        {
            Passenger      passenger      = new Passenger();
            SmallCargo     smallCargo     = new SmallCargo();
            BigCargo       bigCargo       = new BigCargo();
            FrozenBigCargo frozenBigCargo = new FrozenBigCargo();
            LiquidBigCargo liquidBigCargo = new LiquidBigCargo();

            InitializationPassenger(passenger, Path[0]);
            InitializationSmallCargo(smallCargo, Path[1]);
            InitializationBigCargo(bigCargo, Path[4]);
            InitializationLiquidBigCargo(liquidBigCargo, Path[2]);
            InitializationFrozenBigCargo(frozenBigCargo, Path[3]);
            //using (StreamReader stream = new StreamReader(Path[i], System.Text.Encoding.Default))
            //{
            //    while (!stream.EndOfStream)
            //    {
            //        string Buffer = stream.ReadLine();
            //        string[] CarInformation = Buffer.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            //        InitializationAbstractCarsInformation(passenger, CarInformation);
            //        InitializationPassenger(passenger, CarInformation);
            //        PassengerCars.Add(passenger);
            //        passenger = new Passenger();
            //    }
            //}
        }
Esempio n. 2
0
 private void InitializationBigCargo(BigCargo bigCargo, string Path)
 {
     using (StreamReader stream = new StreamReader(Path, System.Text.Encoding.Default))
     {
         while (!stream.EndOfStream)
         {
             string   Buffer         = stream.ReadLine();
             string[] CarInformation = Buffer.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
             InitializationAbstractCarsInformation(bigCargo, CarInformation);
             bigCargo.PropLoadCapacity    = Convert.ToDouble(CarInformation[7]);
             bigCargo.PropTotalVolum      = Convert.ToInt32(CarInformation[8]);
             bigCargo.PropAmountTrailer   = Convert.ToInt32(CarInformation[9]);
             bigCargo.PropAmountEuroPalet = Convert.ToInt32(CarInformation[10]);
             bigCargo.PropTypeTrailer     = CarInformation[11];
             BigCargoCars.Add(bigCargo);
             Cars.Add(bigCargo);
             bigCargo = new BigCargo();
         }
     }
 }