コード例 #1
0
        public string DeleteBusTicket(string from, string to, string travelCompany, DateTime dateTime)
        {
            var    ticket = new BusTicket(from, to, travelCompany, dateTime);
            string result = this.DeleteTicketByUniqueKey(ticket.UniqueKey);

            return(result);
        }
コード例 #2
0
        public string DeleteBusTicket(string departureTown, string arrivalTown, string travelCompany, DateTime departureDateTime)
        {
            var ticket = new BusTicket(departureTown, arrivalTown, travelCompany, departureDateTime);
            var result = this.DeleteTicket(ticket);

            return(result);
        }
コード例 #3
0
        public string AddBusTicket(string from, string to, string travelCompany, DateTime dateTime, decimal price)
        {
            var    ticket = new BusTicket(from, to, travelCompany, dateTime, price);
            string result = this.AddTicket(ticket);

            return(result);
        }
コード例 #4
0
        public string DeleteBusTicket(string from, string to, string travelCompany, DateTime dateTime)
        {
            BusTicket ticket = new BusTicket(from, to, travelCompany, dateTime);

            string result = this.DeleteTicketByUniqueKey(ticket.UniqueKey);

            return result;
        }
コード例 #5
0
        public string AddBusTicket(string from, string to, string travelCompany, DateTime dateTime, decimal price)
        {
            BusTicket ticket = new BusTicket(from, to, travelCompany, dateTime, price);

            string result = this.AddTicket(ticket);

            return result;
        }
 public void CreateBusTicketExpectNewTicket()
 {
     BusTicket ticketBus = new BusTicket("Pavlikeni", "Razgrad", "TransAll", "27.01.2015 21:20", "12.60");
     Assert.AreEqual("Pavlikeni", ticketBus.From);
     Assert.AreEqual("Razgrad", ticketBus.To);
     Assert.AreEqual("TransAll", ticketBus.Company);
     Assert.AreEqual(DateTime.Parse("27.01.2015 21:20"), ticketBus.DateAndTime);
     Assert.AreEqual((decimal)12.60, ticketBus.Price);
 }
コード例 #7
0
        public string AddBusTicket(
            string departureTown,
            string arrivalTown,
            string travelCompany,
            DateTime departureDateTime,
            decimal price)
        {
            var    ticket = new BusTicket(departureTown, arrivalTown, travelCompany, departureDateTime, price);
            string result = this.AddTicket(ticket);

            return(result);
        }
        private string DeleteBusTicket(string from, string to, string company, string dateTime)
        {
            var ticket = new BusTicket(from, to, company, dateTime);
            var result = this.DeleteTicket(ticket);

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

            return result;
        }
        protected string CreateBusTicket(string from, string to, string company, string dateTime, string price)
        {
            var ticket = new BusTicket(from, to, company, dateTime, price);
            var key = ticket.Key;
            string result;

            if (this.tickets.ContainsKey(key))
            {
                result = "Duplicated " + ticket.Type.ToLower();
            }
            else
            {
                this.tickets.Add(key, ticket);
                var fromToKey = ticket.FromToKey;
                this.ticketMultiDictionary.Add(fromToKey, ticket);
                result = ticket.Type + " created";
            }

            if (result.Contains("created"))
            {
                this.BusTicketsCount++;
            }

            return result;
        }
コード例 #10
0
ファイル: TicketCatalog.cs プロジェクト: tormibg/SoftUni-1
        public string DeleteBusTicket(string from, string to, string travelCompany, DateTime dateTime)
        {
            var ticket = new BusTicket(from, to, travelCompany, dateTime);
            string result = this.DeleteTicket(ticket);
            if (result.Contains("deleted"))
            {
                this.BusTicketsCount--;
            }

            return result;
        }
コード例 #11
0
ファイル: TicketCatalog.cs プロジェクト: tormibg/SoftUni-1
        public string AddBusTicket(string from, string to, string travelCompany, DateTime dateTime, decimal price)
        {
            var ticket = new BusTicket(from, to, travelCompany, dateTime, price);
            string operationResult = this.AddTicket(ticket);

            if (operationResult.Contains("added"))
            {
                this.BusTicketsCount++;
            }

            return operationResult;
        }