Пример #1
0
 private void UpdateForm()
 {
     Title           = titleTextBox.Text;
     Author          = authorTextBox.Text;
     Publisher       = publisherTextBox.Text;
     Year            = Convert.ToInt32(yearNumericUpDown.Value);
     Quality         = qualityTextBox.Text;
     Price           = Convert.ToSingle(priceNumericUpDown.Value);
     button1.Enabled = InputValidator.validateTitle(Title) &&
                       InputValidator.validateAuthor(Author) &&
                       InputValidator.validatePublisher(Publisher) &&
                       InputValidator.validateYear(Year) &&
                       InputValidator.validateQuality(Quality) &&
                       InputValidator.validatePrice(Price);
 }
Пример #2
0
        private void UpdateForm()
        {
            if (this.tabControl1.SelectedTab == this.yearTabPage)
            {
                YearMinimum = this.lessRadioButton.Checked ? InputValidator.YearMinimum : Convert.ToInt32(yearNumericUpDown.Value);
                YearMaximum = this.moreRadioButton.Checked ? InputValidator.YearMaximum : Convert.ToInt32(yearNumericUpDown.Value);
            }
            else if (this.tabControl1.SelectedTab == this.rangeTabPage)
            {
                YearMinimum = Convert.ToInt32(fromNumericUpDown.Value);
                YearMaximum = Convert.ToInt32(toNumericUpDown.Value);
            }

            this.button1.Enabled = InputValidator.validateYear(YearMinimum) &&
                                   InputValidator.validateYear(YearMaximum) &&
                                   (YearMinimum <= YearMaximum);
        }