Esempio n. 1
0
        private void buttonCheckDate_Click(object sender, EventArgs e)
        {
            string year  = textBoxYear.Text;
            string month = textBoxMonth.Text;
            string day   = textBoxDay.Text;

            dateValidation(DateValidator.Validate(year, month, day));
        }
Esempio n. 2
0
        private void buttonCheckDate_Click(object sender, EventArgs e)
        {
            string year  = textBoxYear.Text;
            string month = textBoxMonth.Text;
            string day   = textBoxDay.Text;

            bool dateValidator = DateValidator.Validate(year, month, day);

            if (dateValidator)
            {
                displayValid("Valid");
            }
            else
            {
                displayInvalid("Invalid");
            }
        }
Esempio n. 3
0
        //validate and output result
        private void buttonCheckDate_Click(object sender, EventArgs e)
        {
            bool validDate = DateValidator.Validate(textBoxYear.Text, textBoxMonth.Text, textBoxDay.Text);

            if (validDate)
            {
                labelOutput.ForeColor = Color.Green;
                labelOutput.Text      = "Valid";
                toolTipOnMainForm.SetToolTip(labelOutput, "Entered Date is Valid");
            }
            else
            {
                labelOutput.ForeColor = Color.Red;
                labelOutput.Text      = "Invalid";
                toolTipOnMainForm.SetToolTip(labelOutput, "Entered Date is NOT Valid");
            }
        }
Esempio n. 4
0
        private void checkDateButton_Click(object sender, EventArgs e)
        {
            bool isValid = DateValidator.Validate(textBoxYear.Text, textBoxMonth.Text, textBoxDay.Text);

            if (isValid)
            {
                labelResult.ForeColor = Color.Green;
                labelResult.Text      = "Valid";
                toolTipResult.SetToolTip(labelResult, "Entered Date is Valid");
            }
            else
            {
                labelResult.ForeColor = Color.Red;
                labelResult.Text      = "Invalid";
                toolTipResult.SetToolTip(labelResult, "Entered Date is NOT Valid");
            }
        }
 /// <summary>
 /// Method that confirms a valid or invalid date when
 /// buttonCheckDate is clicked
 /// </summary>
 /// <param name="sender">the control/object to set</param>
 /// <param name="e">the event data to set</param>
 private void buttonCheckDate_Click(object sender, EventArgs e)
 {
     dateValidation(DateValidator.Validate(textBoxYear.Text, textBoxMonth.Text, textBoxDay.Text));
 }