private void InferAdditionalRentalDetails() { DateTime?start = dtpDateStart.SelectedDate; DateTime?end = dtpDateEnd.SelectedDate; if (start == null || end == null) { lblOverbooking.Content = ""; lblNumberOfOvernightStays.Content = ""; lblTotalToPay.Content = ""; lblToBePaid.Content = ""; return; } Rental rental = new Rental { DateStart = start.Value, DateEnd = end.Value, HolidayResidence = residence }; if (rentals.IsOverbooking(rental, Rental)) { lblOverbooking.Content = "OVERBOEKING!"; ShowError(lblOverbooking); } lblNumberOfOvernightStays.Content = rental.CalculateNumberOfNights(); decimal totalPrice = rental.CalculateTotalPrice(); lblTotalToPay.Content = totalPrice.ToString("0.00"); try { decimal paid = ParsePaid(totalPrice); decimal toPay = totalPrice - paid; lblToBePaid.Content = toPay.ToString("0.00"); ShowOk(lblToBePaid); ShowOk(txtPaid); } catch { lblToBePaid.Content = "???"; ShowError(lblToBePaid); ShowError(txtPaid); } }