Example #1
0
        public string AddTrainTicket(string from, string to, DateTime dateAndTime, decimal regularPrice, decimal studentPrice)
        {
            TrainTicket ticket = new TrainTicket(from, to, dateAndTime, regularPrice, studentPrice);

            string result = this.AddTicket(ticket);
            if (result.Contains("added"))
            {
                this.trainTicketsCount++;
            }

            return result;
        }
Example #2
0
        public string DeleteTrainTicket(string from, string to, DateTime dateAndTime)
        {
            TrainTicket ticket = new TrainTicket(from, to, dateAndTime, 0, 0);
            string result = this.DeleteTicket(ticket);

            if (result.Contains("deleted"))
            {
                this.trainTicketsCount--;
            }

            return result;
        }