Esempio n. 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            DatabaseOperation.Open();
            dr = DatabaseOperation.getBalance(tname);
            while (dr.Read())
            {
                balance = dr["bal"] + "";
            }
            DatabaseOperation.Close();
            lBalance.Text = balance;
            double bal    = 0;
            double bal2   = 0;
            bool   b      = Double.TryParse(txtpayment.Text, out bal);
            bool   a      = Double.TryParse(lBalance.Text, out bal2);
            double change = 0;

            if (!(bal2 < bal))
            {
                change       = (bal2 - bal);
                tfCange.Text = change + "";
                DatabaseOperation.Open();
                cd = DatabaseOperation.UpdateBalance(tfCange.Text, tname);
                cd.ExecuteNonQuery();
                DatabaseOperation.Close();
                MessageBox.Show("Transaction Completed", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Insufficient Balance", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
 public void getsource()
 {
     DatabaseOperation.Open();
     dr = DatabaseOperation.ViewAccounts();
     while (dr.Read())
     {
         textBox1.AutoCompleteCustomSource.Add(dr["acc_fullname"] + "");
     }
     DatabaseOperation.Close();
 }
Esempio n. 3
0
 public void pic()
 {
     try {
         DatabaseOperation.Open();
         cd = DatabaseOperation.for_pic(tname);
         da = new MySqlDataAdapter(cd);
         DataTable dt = new DataTable();
         da.Fill(dt);
         byte[]       img = (byte[])dt.Rows[0][0];
         MemoryStream ms  = new MemoryStream(img);
         pictureBox1.Image = Image.FromStream(ms);
         da.Dispose();
         DatabaseOperation.Close();
     }catch (MySqlException e) {
         MessageBox.Show("Please Register your Thumbmark to your Respective Bank.");
     }
 }
Esempio n. 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            DatabaseOperation.Open();
            dr = DatabaseOperation.getcustomID(textBox1.Text);
            while (dr.Read())
            {
                tname = dr["acc_id"] + "";
            }
            DatabaseOperation.Close();
            //   checking
            DatabaseOperation.Open();
            dr = DatabaseOperation.for_pic2(tname);
            if (dr.HasRows)
            {
                check = true;
            }
            DatabaseOperation.Close();

            if (check == true)
            {
                pic();
                DatabaseOperation.Open();
                dr = DatabaseOperation.ViewAccountsWhere(textBox1.Text);
                while (dr.Read())
                {
                    txtfullname.Text = dr["acc_fullname"] + "";
                    txtaccount.Text  = dr["AccountNumber"] + "";
                }
                DatabaseOperation.Close();
            }
            else
            {
                MessageBox.Show("Please Register your thumb to UnionBank", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            check = false;
        }