Ejemplo n.º 1
0
 /// <summary>
 /// Отображение рейса текущего поезда для дальнейшего редактирования
 /// </summary>
 /// <param name="window"></param>
 private void EditVoyage(TrainInfoWindow window)
 {
     if (_trainToEdit == null || String.IsNullOrEmpty(TrainNum)) return;
     var voyage = VoyageBuilder.GetVoyageOfTrain(_trainToEdit.Id);
     if (voyage == null)
     {
         var newVoyage = new Voyage();
         newVoyage.DepartureDateTime = DateTime.Now;
         newVoyage.TrainId = _trainToEdit.Id;
         ContextKeeper.Voyages.Add(newVoyage);         
     }
     var voyageEditWin = new VoyageEditWindow();
     voyageEditWin.Show();
     Messenger.Default.Send(new TrainOfVoyageMessage(_trainToEdit.Id));
     window.Close();
 }
Ejemplo n.º 2
0
 private void SaveVoyageInfo(VoyageEditWindow window)
 {
     this._voyage.Periodicity = (byte?)(byte.Parse(this.Periodicity) + 1);
     this._voyage.DepartureDateTime = this.DepartureDate;
     ContextKeeper.Voyages.Update(_voyage);
     window.Close();
 }