/* * Creates or updates the extra. */ private void btnSave_Click(object sender, RoutedEventArgs e) { if (areAllValuesValid()) { if (this.carHire != null) { mFacade.UpdateCarHire(this.carHire, txtDriverName.Text, (DateTime)dtpStart.SelectedDate, (DateTime)dtpEnd.SelectedDate); } else { mFacade.AddCarHire(txtDriverName.Text, (DateTime)dtpStart.SelectedDate, (DateTime)dtpEnd.SelectedDate); } this.Close(); } }