Example #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if ((maskedTextBox1.Text != "" || maskedTextBox1.Text != "0") && cardnum != "" && Int32.Parse(maskedTextBox1.Text) >= 100)
     {
         MessageBox.Show("asdf" + balance + "asdf");
         int newbalance = (Int32.Parse(balance) + Int32.Parse(maskedTextBox1.Text));
         CreateNewCard.Insert("Update card_list set balance = '" + EncryptDecrypt.EncryptString(newbalance.ToString(), CreateNewCard.salt) + "' where Card_No = '" + encrcardnum + "'");
         CreateNewCard.Initialize("server=localhost;uid=root;pwd=;database=alaybank_cards;sslmode=none;");
         CreateNewCard.Insert("Insert into alay" + cardnum + " (`trans_id`, `trans_details`) VALUES (NULL ,'" + EncryptDecrypt.EncryptString("Deposit on " + DateTime.Now, CreateNewCard.salt) + "');");
         MessageBox.Show("Balance Successfuly Updated");
         maskedTextBox1.Clear();
         cardnum     = "";
         label1.Text = "Deposit To: ";
         encrcardnum = "";
     }
     else
     {
         string error = "";
         if (maskedTextBox1.Text == "" || maskedTextBox1.Text == "0")
         {
             error += "Deposit Amount must be greater than 0\n";
         }
         if (Int32.Parse(maskedTextBox1.Text) < 100)
         {
             error += "Amount Must be 100 Pesos or Greater";
         }
         if (cardnum == "")
         {
             error += "No Card Selected";
         }
         MessageBox.Show(error, "Deposit Cannot Be Processed");
     }
 }
Example #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (Int32.Parse(maskedTextBox1.Text) > Int32.Parse(balance))
     {
         MessageBox.Show("Insuffient Balance\n Please Try Again");
         Application.Restart();
     }
     else
     {
         if (Int32.Parse(maskedTextBox1.Text) >= 100)
         {
             string newbalance = (Int32.Parse(balance) - Int32.Parse(maskedTextBox1.Text)).ToString();
             CreateNewCard.Insert("Update card_list set balance = '" + EncryptDecrypt.EncryptString(newbalance, CreateNewCard.salt) + "' where Card_No = '" + CardInsert.encrcardnum + "'");
             CreateNewCard.Initialize("server=localhost;uid=root;pwd=;database=alaybank_cards;sslmode=none;");
             CreateNewCard.Insert("Insert into alay" + CardInsert.cardnum + " (`trans_id`, `trans_details`) VALUES (NULL ,'" + EncryptDecrypt.EncryptString("Withdrew on " + DateTime.Now, CreateNewCard.salt) + "');");
             if (MessageBox.Show("Do you want another Transaction?", "Another Transaction", MessageBoxButtons.YesNo) == DialogResult.Yes)
             {
                 Form mm = new Menu();
                 mm.Show();
                 this.Close();
             }
             else
             {
                 CreateNewCard.Initialize();
                 CreateNewCard.Insert("Insert Into transrec values ('" + CardInsert.cardnum + "','" + newbalance + "')");
                 Form print = new Recieptprint();
                 Recieptprint.source = "cash";
                 print.ShowDialog();
                 MessageBox.Show("Thank You for Using Alay Bank ATM");
                 Form splash = new Splash_Screen();
                 splash.Show();
                 this.Close();
             }
         }
         else
         {
             MessageBox.Show("Withdrawn Amount must be 100 Pesos or greater", "Withdraw Failed");
             Form splashscreen = new Splash_Screen();
             splashscreen.Show();
             this.Hide();
         }
     }
 }
Example #3
0
 private void Splash_Screen_Load(object sender, EventArgs e)
 {
     checkdb("alaybank", "alaybank");
     if (!alaybank)
     {
         createdb("create database alaybank");
         CreateNewCard.Initialize();
         createdb("create table card_list (Card_No varchar(255) , PIN varchar(255) , FN varchar(255) , MI varchar(255) , LN varchar(255) , Balance varchar(255) , Points varchar(255) , Block varchar(255) , primary key(Card_No))");
     }
     checkdb("alaybank_cards", "alaybank_cards");
     if (!alaycards)
     {
         createdb("create database alaybank_cards");
     }
     timer1.Enabled = true;
     code           = "";
     CreateNewCard.Initialize();
     CreateNewCard.Insert("Delete from rewardprint");
     CreateNewCard.Insert("Delete from transrec");
 }
Example #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem item in listView1.SelectedItems)
            {
                if (Int32.Parse(Balance_Inquiry.balance) >= Int32.Parse(item.SubItems[1].Text))
                {
                    int newbal = Int32.Parse(Balance_Inquiry.balance) - Int32.Parse(item.SubItems[1].Text);
                    CreateNewCard.Insert("Update card_list set points = '" + EncryptDecrypt.EncryptString(newbal.ToString(), CreateNewCard.salt) + "' where Card_No = '" + CardInsert.encrcardnum + "'");
                    CreateNewCard.Initialize("server=localhost;uid=root;pwd=;database=alaybank_cards;sslmode=none;");
                    CreateNewCard.Insert("Insert into alay" + CardInsert.cardnum + " (`trans_id`, `trans_details`) VALUES (NULL ,'" + EncryptDecrypt.EncryptString("Claimed Reward on " + DateTime.Now, CreateNewCard.salt) + "');");
                    MessageBox.Show("Balance Successfuly Updated\n Thank You for Using Alay Bank ATM System");
                    CreateNewCard.Initialize();
                    CreateNewCard.Insert("insert into rewardprint values('" + item.SubItems[0].Text + "','" + BlockChangepin.build() + "')");
                    Form print = new Recieptprint();
                    Recieptprint.source = "reward";
                    print.ShowDialog();
                    if (MessageBox.Show("Do you want another Transaction?", "Another Transaction", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        Form mm = new Menu();
                        mm.Show();
                        this.Close();
                    }
                    else
                    {
                        CreateNewCard.Insert("Insert Into transrec values ('" + CardInsert.cardnum + "','" + newbal + " Points')");
                        MessageBox.Show("Thank You for Using Alay Bank ATM");
                        Form splash = new Splash_Screen();
                        splash.Show();
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("Transaction cannot be processed!\n Insufficient Reward Points\n Thank you for using Alay Bank ATM");
                }
            }
            Form splashscreen = new Splash_Screen();

            splashscreen.Show();
            this.Hide();
        }
Example #5
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Do you want another Transaction?", "Another Transaction", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         Form mm = new Menu();
         mm.Show();
         this.Close();
     }
     else
     {
         CreateNewCard.Initialize();
         CreateNewCard.Insert("Insert Into transrec values ('" + CardInsert.cardnum + "','" + balance + "')");
         Form print = new Recieptprint();
         Recieptprint.source = "cash";
         print.ShowDialog();
         MessageBox.Show("Thank You for Using Alay Bank ATM");
         Form splash = new Splash_Screen();
         splash.Show();
         this.Close();
     }
 }
Example #6
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (Int32.Parse(Balance_Inquiry.balance) >= Int32.Parse(Amount.Text))
            {
                int rbalance;
                rbalance = Int32.Parse(Balance_Inquiry.balance) - Int32.Parse(Amount.Text);
                if (Int32.Parse(Amount.Text) >= 1000)
                {
                    int rewardpoint = Int32.Parse(Amount.Text) / 1000;
                    int newpoints   = Int32.Parse(Balance_Inquiry.points) + rewardpoint;
                    CreateNewCard.Insert("Update card_list set ponts = '" + EncryptDecrypt.EncryptString(newpoints.ToString(), CreateNewCard.salt) + "' where Card_No = '" + CardInsert.encrcardnum + "'");
                }
                CreateNewCard.Insert("Update card_list set balance = '" + EncryptDecrypt.EncryptString(rbalance.ToString(), CreateNewCard.salt) + "' where Card_No = '" + CardInsert.encrcardnum + "'");

                CreateNewCard.Initialize("server=localhost;uid=root;pwd=;database=alaybank_cards;sslmode=none;");
                CreateNewCard.Insert("Insert into alay" + CardInsert.cardnum + " (`trans_id`, `trans_details`) VALUES (NULL ,'" + EncryptDecrypt.EncryptString("Paid bill on " + DateTime.Now, CreateNewCard.salt) + "');");
                if (MessageBox.Show("Do you want another Transaction?", "Another Transaction", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    Form mm = new Menu();
                    mm.Show();
                    this.Close();
                }
                else
                {
                    CreateNewCard.Initialize();
                    CreateNewCard.Insert("Insert Into transrec values ('" + CardInsert.cardnum + "','" + rbalance + "')");
                    Form print = new Recieptprint();
                    Recieptprint.source = "cash";
                    print.ShowDialog();
                    MessageBox.Show("Thank You for Using Alay Bank ATM");
                    Form splash = new Splash_Screen();
                    splash.Show();
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Transaction cannot be processed!\n Insufficient Balance\n Thank you for using Alay Bank ATM");
            }
        }
Example #7
0
 public CardInsert()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #8
0
 public Splash_Screen()
 {
     InitializeComponent();
     CreateNewCard.Initialize("server = localhost; uid = root; pwd =; sslmode = none; ");
 }
Example #9
0
 public AdminLogin()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #10
0
 public Paybills()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #11
0
 public ClaimRewards()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #12
0
 private void button1_Click(object sender, EventArgs e)
 {
     CreateNewCard.Initialize("server=localhost;uid=root;pwd=;database=alaybank_cards;sslmode=none;");
     Populate_ListView("select * from alay" + Card.SelectedItem);
 }
Example #13
0
 public ChangePin()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #14
0
 public PIN()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #15
0
 public Balance_Inquiry()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #16
0
 public BlockChangepin()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #17
0
 public Block_Card()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #18
0
 public RewardEditor()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #19
0
 public Withdraw()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #20
0
 public Renew()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #21
0
 public Edit_Rewards()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #22
0
 public Deposit()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }
Example #23
0
 public Card_Logs()
 {
     InitializeComponent();
     CreateNewCard.Initialize();
 }