Exemplo n.º 1
0
        private void OK3_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length < 0)
            {
                MessageBox.Show("please enter valid number to pay");
            }
            else
            {

                paymentApprovel PA = new paymentApprovel();
                PA.Show();
                this.Hide();
            }
        }
Exemplo n.º 2
0
        private void OK5_Click(object sender, EventArgs e)
        {
            DateTime Now = DateTime.Now;
            string s1 = ExpDateData.Text.Substring(3);
            string s2 = ExpDateData.Text.Substring(0, 2);
            int year = Convert.ToInt32(s1);
            int month = Convert.ToInt32(s2);
            int nowMonth = Convert.ToInt32(Now.Month);
            int nowYear = Convert.ToInt32(Now.Year) - 2000;

            if (year < nowYear)
            {
                MessageBox.Show("Credit Card is expired");
                return;
            }
            if (year == nowYear && month < nowMonth)
            {
                MessageBox.Show("Credit Card is expired");
                return;
            }

            if (OwnerNameData.Text.Length == 0)
            {
                MessageBox.Show("Please enter Owner Name");
                return;
            }

            if (SumToPayData.Text.Length <= 0)
            {
                MessageBox.Show("Please enter amount to pay");
                return;
            }
            if (CVVData.Text.Length != 3)
            {
                MessageBox.Show("Please enter a valid CVV number");
                return;
            }
            if (credirCardNumData.Text.Length != 15)
            {
                MessageBox.Show("Please enter a valid credit card number");
                return;
            }
            else
            {
                paymentApprovel PA = new paymentApprovel();
                PA.Show();
                this.Hide();
            }
        }