예제 #1
0
 public RoutingSlip(Guid id, params string[] destinations) : this()
 {
     Id           = id;
     destinations = destinations ?? new string[0];
     foreach (var destination in destinations)
     {
         Itinerary.Add(new ProcessingStep {
             Address = destination
         });
     }
 }
 private void Initialize()
 {
     Itinerary.Add(string.Format("{0,-20} {1,20} {2,20}", "Stacja", "Przyjazd", "Odjazd"));
     try
     {
         routes = unitOfWork.GetRoutes;
         trains = unitOfWork.GetTrains;
     }
     catch (AggregateException e)
     {
         SendInfo();
         return;
     }
     Cities     = routes.Select(r => r.From).Distinct().ToList();
     TrainTypes = trains.Select(t => t.Type).Distinct().ToList();
 }
예제 #3
0
 public RoutingSlip(Guid id, IDictionary <string, string> attachments, params string[] destinations) : this()
 {
     Id           = id;
     destinations = destinations ?? new string[0];
     foreach (var destination in destinations)
     {
         Itinerary.Add(new ProcessingStep {
             Address = destination
         });
     }
     if (attachments != null)
     {
         foreach (var attachment in attachments)
         {
             attachments.Add(attachment);
         }
     }
 }
        private void RewriteItinerary()
        {
            Itinerary.Clear();
            Itinerary.Add(String.Format("{0,-20} {1,20} {2,20}", "Stacja", "Przyjazd", "Odjazd"));
            int k = 0;

            for (int i = 0; i < stations.Count; i++)
            {
                if (i == 0)
                {
                    Itinerary.Add(string.Format("{0,-20} {1,20} {2,20}", stations[i], "", startDate.ToShortTimeString()));
                }
                else if (i == stations.Count - 1)
                {
                    Itinerary.Add(string.Format("{0,-20} {1,20} {2,20}", stations[i], startDate.AddMinutes(times[k++]).ToShortTimeString(), ""));
                }
                else
                {
                    Itinerary.Add(string.Format("{0,-20} {1,20} {2,20}", stations[i], startDate.AddMinutes(times[k++]).ToShortTimeString(), startDate.AddMinutes(times[k++]).ToShortTimeString()));
                }
            }
            NotifyOfPropertyChange("CanDelete");
            NotifyOfPropertyChange("CanAddConnection");
        }