Exemple #1
0
        private void label5_Click(object sender, EventArgs e)
        {
            HOME home = new HOME();

            home.Show();
            this.Hide();
        }
Exemple #2
0
 private void bunifuThinButton21_Click(object sender, EventArgs e)
 {
     if (wdamtTb.Text == "")
     {
         MessageBox.Show("Missing Information");
     }
     else if (Convert.ToInt32(wdamtTb.Text) <= 0)
     {
         MessageBox.Show("Enter a Valid Amount");
     }
     else if (Convert.ToInt32(wdamtTb.Text) > bal)
     {
         MessageBox.Show("Balance Can not be negative");
     }
     else
     {
         try
         {
             newbalance = bal - Convert.ToInt32(wdamtTb.Text);
             try
             {
                 Con.Open();
                 string     query = "update AccountTbl set Balance=" + newbalance + " where AccNum='" + Acc + "';";
                 SqlCommand cmd   = new SqlCommand(query, Con);
                 cmd.ExecuteNonQuery();
                 MessageBox.Show("Success Withdraw");
                 Con.Close();
                 addtransaction();
                 HOME home = new HOME();
                 home.Show();
                 this.Hide();
             }
             catch (Exception Ex)
             {
                 MessageBox.Show(Ex.Message);
             }
         }
         catch (Exception Ex)
         {
             MessageBox.Show(Ex.Message);
         }
     }
 }
Exemple #3
0
        private void bunifuThinButton21_Click(object sender, EventArgs e)
        {
            Con.Open();
            SqlDataAdapter sda = new SqlDataAdapter("select count(*) from AccountTbl where AccNum='" + AccNumTb.Text + "' and Pin = " + PinTb.Text + "", Con);
            DataTable      dt  = new DataTable();

            sda.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                AccNumber = AccNumTb.Text;
                HOME home = new HOME();
                home.Show();
                this.Hide();
                Con.Close();
            }
            else
            {
                MessageBox.Show("Wrong Account Number Or PIN Code");
            }
            Con.Close();
        }