Ejemplo n.º 1
0
 /// <summary>
 /// Replace Train by Id
 /// </summary>
 /// <param name="id"></param>
 /// <param name="train"></param>
 /// <returns></returns>
 public static bool ReplaceTrain(int id, Trains train)
 {
     try
     {
         database.trains[id] = train;
         return(true);
     }
     catch (Exception ex)
     {
         Log.Message("ReplaceTrain(int id, Trains train)", ex);
         return(false);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Add new Train to Databse
 /// </summary>
 /// <param name="train"></param>
 /// <returns></returns>
 public static bool AddTrain(Trains train)
 {
     try
     {
         //if(database.trains.Count >= 1)
         //    database.trains.Add(database.trains.Count +1, train);
         //else
         database.trains.Add(database.trains.Count, train);
         return(true);
     }
     catch (Exception ex)
     {
         Log.Message("AddTrain:", ex);
         return(false);
     }
 }