private string DeleteBusTicket(string from, string to, string travelCompany, string dateAndTime) { BusTicket ticket = new BusTicket(from, to, travelCompany, dateAndTime); string result = this.DeleteTicket(ticket); if (result.Contains(GlobalConstants.Deleted)) { this.busTicketsCount--; } return result; }
protected string AddBusTicket(string from, string to, string travelCompany, string dateTime, string price) { BusTicket ticket = new BusTicket(from, to, travelCompany, dateTime, price); string key = ticket.DataKey; string result; if (this.ticketsByDataKey.ContainsKey(key)) { result = GlobalConstants.Duplicated + ticket.Type.ToString().ToLower(); } else { this.ticketsByDataKey.Add(key, ticket); string fromToKey = ticket.FromToKey; this.ticketsByFromToKey.Add(fromToKey, ticket); this.ticketsByDateAndTime.Add(ticket.DateAndTime, ticket); result = ticket.Type + " " + GlobalConstants.Created; this.busTicketsCount++; } return result; }