示例#1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (virtualacctxt.Text == "")
            {
                MessageBox.Show("Account Number Must Be Filled!");
                return;
            }
            if (customer.accountnumber == virtualacctxt.Text.ToString())
            {
                MessageBox.Show("You cannot transfer to yourself!");
                return;
            }
            DataTable dt = new DataTable();

            dt = connect.executeQuery("select * from virtualaccount where virtualaccount = '" + virtualacctxt.Text + "' and status = 'Not Paid'");
            DataRow data = dt.Rows[0];

            if (dt.Rows.Count == 0)
            {
                MessageBox.Show("This Virtual Account Is Invalid / Has Expired!");
                return;
            }
            label.Content = "";
            Window a = new PinConfirmationATM(customer, virtualacctxt.Text.ToString(), Int32.Parse(data["amount"].ToString()), "virtualacc");

            a.Show();
            this.Close();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (accnumtxt.Text == "")
            {
                MessageBox.Show("Account Number Must Be Filled!");
                return;
            }
            if (amountxt.Text == "")
            {
                MessageBox.Show("Amount Must Be Filled!");
                return;
            }

            DataTable dt = new DataTable();

            dt = connect.executeQuery("select * from customer where accountnumber = '" + accnumtxt.Text.ToString() + "' limit 1");
            if (dt.Rows.Count == 0)
            {
                label.Content = "Invalid Username/Password!";
                return;
            }
            else
            {
                DataRow  data = dt.Rows[0];
                Customer rvcr = new Customer(data["accountnumber"].ToString(), data["pin"].ToString(), data["name"].ToString(), data["identitycard"].ToString(), data["familycard"].ToString(), Int32.Parse(data["balance"].ToString()), data["type"].ToString());
                if (customer.familycard != rvcr.familycard)
                {
                    MessageBox.Show("Only siblings can do deposit!");
                    return;
                }
                else
                {
                    Window next = new PinConfirmationATM(customer, rvcr, Int32.Parse(amountxt.Text.ToString()), "deposit");
                    next.Show();
                    this.Close();
                }
            }
        }
示例#3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (accnumtxt.Text == "")
            {
                MessageBox.Show("Account Number Must Be Filled!");
                return;
            }
            if (amounttxt.Text == "")
            {
                MessageBox.Show("Amount Must Be Filled!");
                return;
            }
            if (customer.accountnumber == accnumtxt.Text.ToString())
            {
                MessageBox.Show("You cannot transfer to yourself!");
                return;
            }
            string accnum = accnumtxt.Text;

            dt = new DataTable();
            dt = connect.executeQuery("select * from customer where accountnumber = '" + accnumtxt.Text.ToString() + "' limit 1");

            if (dt.Rows.Count == 0)
            {
                label.Content = "Invalid User!";
                return;
            }
            else
            {
                DataRow data = dt.Rows[0];
                label.Content = "";
                Customer receiver = new Customer(data["accountnumber"].ToString(), data["pin"].ToString(), data["name"].ToString(), data["identitycard"].ToString(), data["familycard"].ToString(), Int32.Parse(data["balance"].ToString()), data["type"].ToString());
                Window   a        = new PinConfirmationATM(customer, receiver, Int32.Parse(amounttxt.Text.ToString()), "regularacc");
                a.Show();
                this.Close();
            }
        }