Example #1
0
    private void btnCalc_Click(object sender, EventArgs e)
    {
        bool     flag;
        int      year;
        int      leap;
        clsDates myDate = new clsDates();

        flag = int.TryParse(txtInput.Text, out year);
        if (flag == false)
        {
            MessageBox.Show("Digit characters only in YYYY format", "Input Error");
            txtInput.Focus();
            return;
        }
        leap = myDate.getLeapYear(year);
        txtLeapYearResult.Text = year.ToString() + " is " + ((leap == 1)? "" : "not ") + "a leap year";
        txtEasterResult.Text   = myDate.getEaster(year);
    }
Example #2
0
    private void btnCalc_Click(object sender, EventArgs e)
    {
        bool flag;
        int year;
        int leap;
        clsDates myDate = new clsDates();

        flag = int.TryParse(txtInput.Text, out year);
        if (flag == false)
        {
            MessageBox.Show("Digit characters only in YYYY format", "Input Error");
            txtInput.Focus();
            return;
        }
        leap = myDate.getLeapYear(year);
        txtLeapYearResult.Text = year.ToString() + " is " + ((leap == 1)? "" : "not ") + "a leap year";
        txtEasterResult.Text = myDate.getEaster(year);
    }