public void WijzigResultaat() { if (SelectedResultaat != null) { BackWithRefresh = true; ResultaatDataService rds = new ResultaatDataService(); // controleren of de fields zijn ingevuld if (SelectedResultaat.Datum == null || SelectedResultaat.AlgorithmId < 1) { MessageBoxResult result = MessageBox.Show("Please fill in all fields.", "Information", MessageBoxButton.OK, MessageBoxImage.Information); } else { // controleren of update of insert moet zijn if (SelectedResultaat.Id == 0) { rds.RegisterTime(SelectedResultaat.Sessie, SelectedResultaat.AlgorithmId, SelectedResultaat.Datum, SelectedResultaat.Tijd); } else { rds.UpdateTime(SelectedResultaat); } BackWithRefresh = true; // datum selecteren om te refreshen met binding SelectedDatum = SelectedResultaat; refreshResutaten(); } //Resultaat leegmaken om messagebox te tonen "You have selected a Date, not a Result..." in functie deleteResultaat() SelectedResultaat = null; SelectedAlgorithm = null; // delete button inschakelen DeleteButtonEnabled = true; } }
// Button_Start // timer stoppen | timer2(countdown) starten private void StartStopTimer() { // ButtonClick tijdens inpectieTijd if (InspectionOn) { SkipInspection = true; } else { SkipInspection = false; } // ButtonClick tijdens de timer loopt if (TimerOn == false) { TimerOn = true; // timer stoppen _stopWatch.Stop(); // text knop aanpassen TimerStatus = "START"; if (InspectionOn == false) { // verstreken tijd opslaan ResultaatDataService rds = new ResultaatDataService(); LaatsteInsertedId = rds.RegisterTime(_nieuweSessie, RandomAlgorithm.Id, _huidigeDag, _elapsedTime); refreshLastAlgorithm(RandomAlgorithm.Id); //wanneer de timer start, de "reset active", "delete last" en "show only this sessions" inschakelen FunctionIsActive = true; } } // ButtonClick wanneer geen timer loopt (BEGINSTATUS) else { // enkel de timer kunnen starten indien er tenminste 1 algorithm "actief" is if (ActieveAlgorithmIds.Count > 0) { //wanneer de timer start, de "reset active", "delete last" en "show only this sessions" uitshakelen FunctionIsActive = false; TimerOn = false; //nieuw algorithm uit collection halen generateRandomAlgorithm(); //countdown starten _inspection = InspectionTime; _timer2.Start(); TimerStatus = "Inspection"; TimerDisplay = _inspection.ToString(); } else { MessageBox.Show("All Alorithms are disabled. Please enable some Algorithms to use the timer.", "Information", MessageBoxButton.OK, MessageBoxImage.Information); } } }