Пример #1
0
 public bool AddTransport(PassengerTransport trensport)
 {
     try
     {
         List<Transport> listTrans;
         if(transport!=null)
              listTrans = transport.ToList();
         else{
             listTrans = new List<Transport>();
         }
         listTrans.Add(trensport);
         this.transport = listTrans.ToArray();
         return true;
     }
     catch
     {
         return false;
     }
 }
Пример #2
0
 public bool LetGo(PassengerTransport trensport)
 {
     if (transport!=null)
     foreach (Transport e in transport)
     {
         if (e == trensport || trensport.GosNum == e.GosNum) //не знаю как лучше
         {
             //if(e.InPark!=true)
             //{
             //    throw new ArgumentException();
             //    return false;
             //}
             e.InPark = false;
             return true;
         }
     }
     return false;
 }