private void OKLabel_Click(object sender, EventArgs e) { if (CardNumberTextBox.Text.Length == 16 && DateMonthComboBox.Text.Length > 0 && DateYearComboBox.Text.Length >= 4 && CVVTextBox.Text.Length == 3) { Card c = new Card(); c.setNumber(CardNumberTextBox.Text); c.setDate(DateMonthComboBox.Text, DateYearComboBox.Text); c.setCVV(CVVTextBox.Text); this.DialogResult = DialogResult.OK; } else { label5.Show(); } }
/// <summary> /// When OKLabel is clicked. /// </summary> /// <param name="sender"> Event sender</param> /// <param name="e"> Event argument</param> private void OKLabel_Click(object sender, EventArgs e) { if (this.CardNumberTextBox.Text.Length == 16 && this.DateMonthComboBox.Text.Length > 0 && this.DateYearComboBox.Text.Length >= 4 && this.securityTextBox.Text.Length == 3) { Card c = new Card(); c.SetNumber(this.CardNumberTextBox.Text); c.SetDate(this.DateMonthComboBox.Text, this.DateYearComboBox.Text); c.SetCVV(this.securityTextBox.Text); this.DialogResult = DialogResult.OK; } }
public void cardTestDate() { Card c = new Card(); c.SetDate("1", "1"); }
public void cardTestNumber() { Card c = new Card(); c.SetNumber("543"); }
public void cardTestCVV() { Card c = new Card(); c.SetCVV("54544545"); }