public AddLineTripWindow(IBL _bl) { InitializeComponent(); this.bL = _bl; newLineTrip = new BL.BO.LineTrip() { LineID = -1 }; cbLineID.ItemsSource = bL.GetAllPropertyLine("LineID"); this.settingTime(); cbHour.ItemsSource = this.Hours; cbMinutes.ItemsSource = this.Minutes; this.fieldSelected = new bool[3] { false, false, false }; this.minutes = 0; this.hour = 0; }
public UpdateLineTripWindow(IBL _bl, BL.BO.LineTrip _lineTripToUpdate) { InitializeComponent(); this.bl = _bl; this.lineTripToUpdate = _lineTripToUpdate; try { lineTripToUpdate = bl.GetLineTrip(this.lineTripToUpdate.LineID, this.lineTripToUpdate.StartAt); } catch (BL.BO.BadLineTripException ex) { MessageBox.Show(ex.Message); this.Close(); } BL.BO.Line line = bl.GetLine(this.lineTripToUpdate.LineID); tbLineCode.Text = line.Code.ToString(); tbLineID.Text = line.LineID.ToString(); this.settingTime(); cbHour.ItemsSource = this.Hours; cbMinutes.ItemsSource = this.Minutes; this.hours = this.lineTripToUpdate.StartAt.Hours; this.minutes = this.lineTripToUpdate.StartAt.Minutes; }
private void lineTripDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { this.lineTrip = (sender as DataGrid).SelectedItem as BL.BO.LineTrip; btnUpdateLineTrip.IsEnabled = true; btnDeleteLineTrip.IsEnabled = true; }