Exemplo n.º 1
0
        public override string ToString()
        {
            string departure = Departure.ToString();
            string arrival   = Arrival.ToString();

            return(StartCity + " [" + departure + "] --> " + EndCity + " [" + arrival + "]");
        }
Exemplo n.º 2
0
 public override string ToString()
 {
     return(Id + ";" +
            LocationFrom?.ToString() + ";" +
            LocationTo?.ToString() + ";" +
            Departure.ToString("dd-MM-yyyy HH:mm") + ";" +
            Arrival.ToString("dd-MM-yyyy HH:mm") + ";" +
            DistanceMiles.ToString() + ";" +
            Price?.ToString());
 }
        public override string ToString()
        {
            var results = new StringBuilder();

            results.AppendLine("Departs " + Departure.ToString());
            results.AppendLine("Arrives " + Arrival.ToString());
            results.AppendLine("Plane " + PlaneType);
            results.AppendLine("Buis.Class avail. " + HasBusinessClass);

            return(results.ToString());
        }
 public override string ToString()
 {
     return(string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}",
                          Number,
                          DepartureFrom,
                          ArrivalIn,
                          Departure.TimeOfDay.ToString("hh':'mm"),
                          Departure.ToString().Split(' ')[0],
                          Arrival.TimeOfDay.ToString("hh':'mm"),
                          Arrival.ToString().Split(' ')[0],
                          CountPlaces,
                          Program.GetStopStations(StopStation)));
 }
Exemplo n.º 5
0
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            if (this.Arrival.Date < DateTime.Now.Date)
            {
                yield return(new ValidationResult("Не може да бъде направена резервация за предходна дата.", new List <string>()
                {
                    Arrival.ToString()
                }));
            }

            if (this.Arrival >= this.Departure)
            {
                yield return(new ValidationResult("Датата на пристигане трябва да бъде преди датата на заминаване.", new List <string>()
                {
                    Arrival.ToString(), Departure.ToString()
                }));
            }
        }