public void validateMonitor()
        {
            Monitor monitor = new Monitor();
            MonitorValidator validator = new MonitorValidator();

            monitor.Description = "Dies ist ein Test";
            monitor.Resolution = "1280*800";
            monitor.Inch = 24;
            monitor.AspectRatio = "16:9";

            Assert.AreEqual(true, validator.CheckConsistency(monitor));
        }
        /// <summary>
        /// Ruft die Informationen aus dem Formular ab und speichert sie in die Datenbank.
        /// Wirft eine Fehlermeldung, wenn die Validierung fehlschlägt.
        /// </summary>
        private void MonitorSave_Click(object sender, RoutedEventArgs e)
        {
            ProducerDataAccess dataProducer = new ProducerDataAccess();
            MonitorDataAccess monitorDataAccess = new MonitorDataAccess();
            MonitorValidator validator = new MonitorValidator();

            try
            {
                this.setEntityWithFormData(dataProducer);

                if (!validator.CheckConsistency(this.entity))
                {
                    ErrorHandler.ShowErrorMessage("Validierung fehlgeschlagen", ErrorHandler.VALIDATION_FAILED);
                }
                else
                {
                    if (this.isAvailable)
                        monitorDataAccess.Update(this.entity);
                    else
                        monitorDataAccess.Save(this.entity);
                    this.Close();
                }
            }
            catch (FormatException exception)
            {
                ErrorHandler.ShowErrorMessage(exception, ErrorHandler.WRONG_FORMAT);
            }
            catch (MySql.Data.MySqlClient.MySqlException exception)
            {
                ErrorHandler.ShowErrorMessage(exception, ErrorHandler.SAVE_WENT_WRONG);
            }
            catch(System.OverflowException exception)
            {
                ErrorHandler.ShowErrorMessage(exception, ErrorHandler.DATA_TOO_LONG);
            }
        }