예제 #1
0
파일: Form1.cs 프로젝트: PuceEdgar/C-course
        private void BirthdayPicker_Leave(object sender, System.EventArgs e)
        {
            String   input = BirthdayPicker.Text.ToString();
            DateTime inputDate;
            DateTime now = DateTime.Today;

            if (DateTime.TryParse(input, out inputDate))
            {
                int result = DateTime.Compare(inputDate, now);

                if (result > 0)
                {
                    BirthdaywarningLabel.Show();
                }
                BirthdaywarningLabel.Hide();

                String bdayPart = inputDate.ToString("dd/MM/yyyy").Replace(".", "");
                bdayPart    = bdayPart.Remove(4, 2);
                SSNBox.Text = bdayPart + "-";
                SSNBox.Focus();
            }

            else
            {
                BirthdaywarningLabel.Show();
            }
        }
예제 #2
0
파일: Form1.cs 프로젝트: PuceEdgar/C-course
        private void CancelButton_Click(object sender, EventArgs e)
        {
            NameBox.Text      = "";
            SurnameBox.Text   = "";
            FullNameShow.Text = "";
            FullNameShow.Hide();
            PasswordBox.Text       = "";
            RepeatPasswordBox.Text = "";
            BirthdayPicker.Value.ToLocalTime();
            SSNBox.Text   = "";
            EmailBox.Text = "";
            CodeBox.Text  = "";

            NamewarningLabel.Hide();
            SurnamewarningLabel.Hide();
            BirthdaywarningLabel.Hide();
            PassWarningLabel.Hide();
            PassRepeatWarningLabel.Hide();
            SSNwarningLabel.Hide();
            EmailWarningLabel.Hide();

            NameBox.Focus();
        }