Пример #1
0
        private void txtPinNum_TextChanged(object sender, EventArgs e)
        {
            if (txtPinNum.Text.Length == 4)
            {
                pin = int.Parse(txtPinNum.Text);

                ChangePinNumberBLL pinBLL = new ChangePinNumberBLL();
                bool customerStatus       = pinBLL.validatePin(pin, acNo);

                if (customerStatus)
                {
                    //atm button enable
                    btnBalance.Enabled = btnWithdraw.Enabled = btnWithdrawReceipt.Enabled = true;

                    panMoney.Controls.Clear();

                    txtAccountNo.Enabled = txtPinNum.Enabled = false;
                    Label lblIntro = new Label();
                    lblIntro.Name     = "lblIntro";
                    lblIntro.Text     = "Please \n\nselect \n\nan \n\naction !!!";
                    lblIntro.Location = new Point(70, 55);
                    lblIntro.AutoSize = true;
                    lblIntro.Font     = new Font("Georgia", 16F);
                    panMoney.Controls.Add(lblIntro);
                }
                else
                {
                    MessageBox.Show("Please enter correct information !!!");
                    txtAccountNo.Text    = txtPinNum.Text = "";
                    txtAccountNo.Enabled = true;
                    txtPinNum.Enabled    = false;
                    txtAccountNo.Focus();
                    return;
                }
            }
        }
Пример #2
0
        private void btnPinChange_Click(object sender, EventArgs e)
        {
            if (txtCustomerACNo.Text == "")
            {
                MessageBox.Show("Enter account number !!!");
                txtCustomerACNo.Focus();
                return;
            }
            else if (txtOldPinNo.Text == "")
            {
                MessageBox.Show("Enter old pin number !!!");
                txtOldPinNo.Focus();
                return;
            }
            else if (txtNewPinNo.Text == "")
            {
                MessageBox.Show("Enter new pin number !!!");
                txtNewPinNo.Focus();
                return;
            }
            else if (txtConfirmNewPin.Text == "")
            {
                MessageBox.Show("Confirm your new pin number !!!");
            }
            else
            {
                int accountNo = int.Parse(txtCustomerACNo.Text);

                DepositBLL depositBLL     = new DepositBLL();
                bool       customerStatus = depositBLL.validateCustomerByACNo(accountNo);

                if (customerStatus)
                {
                    int  oldPin    = int.Parse(txtOldPinNo.Text);
                    bool pinStatus = pinBLL.validatePin(oldPin, accountNo);

                    if (pinStatus)
                    {
                        int newPin     = int.Parse(txtNewPinNo.Text);
                        int confirmPin = int.Parse(txtConfirmNewPin.Text);

                        if (newPin == confirmPin)
                        {
                            pinBLL.updatePin(accountNo, newPin);
                            MessageBox.Show("Pin changed successfully" + "\nNew pin number: " + newPin);
                        }
                        else
                        {
                            MessageBox.Show("Pin number do not match !!!");
                            txtConfirmNewPin.Text = "";
                            txtConfirmNewPin.Focus();
                            return;
                        }
                    }
                    else
                    {
                        MessageBox.Show("Wrong old pin number !!!");
                        txtOldPinNo.Text = "";
                        txtOldPinNo.Focus();
                        return;
                    }
                }
                else
                {
                    MessageBox.Show("Invalid customer account number !!!");
                    txtCustomerACNo.Text = txtOldPinNo.Text = txtNewPinNo.Text = txtConfirmNewPin.Text = "";
                    txtCustomerACNo.Focus();
                    return;
                }
            }
        }