Exemplo n.º 1
0
        /// <summary>
        /// Adds the wagon.
        /// </summary>
        /// <param name="o">The o.</param>
        /// <returns></returns>
        private EntryLog AddWagon(Operation o)
        {
            EntryLog entryLog = null;

            if (o.AddsMerchandise)
            {
                entryLog = this.AddMerchandiseWagon(o.Value);
            }
            if (o.AddsPassenger)
            {
                entryLog = this.AddPassengerWagon(o.Value);
            }
            return(entryLog);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Transactions the specified o.
        /// </summary>
        /// <param name="o">The o.</param>
        /// <returns></returns>
        public string Transaction(Operation o)
        {
            EntryLog entryLog = null;

            if (o.ItsAdding)
            {
                entryLog = this.AddWagon(o);
            }
            if (o.ItsRemoving)
            {
                entryLog = this.RemoveWagon(o.Value);
            }
            this.JournalLog.Add(entryLog);
            return(entryLog.Message);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Adds the specified entry log.
 /// </summary>
 /// <param name="entryLog">The entry log.</param>
 public void Add(EntryLog entryLog)
 {
     this.EntryLogs.Add(entryLog);
 }