0% found this document useful (0 votes)
12 views2 pages

Transfer

Uploaded by

emmajulienne63
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Transfer

Uploaded by

emmajulienne63
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

con.

Open();

int roll;
roll = 12;
acnumber= textBox5.Text;
acbalance= textBox6.Text ;
acn = textBox10.Text;
acb = textBox7.Text;
name= textBox2.Text ;
actype=textBox4.Text ;
acname= textBox8.Text ;

if (textBox5.Text.Length > 0 && textBox6.Text != "")


{
textBox12.Text = (Convert.ToInt64(textBox6.Text) -
Convert.ToInt64(textBox11.Text)).ToString();

}
payed = textBox12.Text;

if (textBox5.Text.Length > 0 && textBox6.Text != "")


{
textBox12.Text = (Convert.ToInt64(textBox7.Text) +
Convert.ToInt64(textBox11.Text)).ToString();

}
trans = textBox12.Text;

SqlCommand cmdsp1x2 = con.CreateCommand();


cmdsp1x2.CommandType = CommandType.Text;
cmdsp1x2.CommandText = " UPDATE [dbo].[clients] set
first_deposit='" + payed + "' where account_number='" + acnumber + "' ";
cmdsp1x2.CommandTimeout = 300000000;
cmdsp1x2.ExecuteNonQuery();

SqlCommand cmdsp1x2x = con.CreateCommand();


cmdsp1x2x.CommandType = CommandType.Text;
cmdsp1x2x.CommandText = " UPDATE [dbo].[clients] set
first_deposit='" + trans + "' where account_number='" + acn + "' ";
cmdsp1x2x.CommandTimeout = 300000000;
cmdsp1x2x.ExecuteNonQuery();

SqlCommand cmdsp1x = con.CreateCommand();


cmdsp1x.CommandType = CommandType.Text;

cmdsp1x.CommandText = " insert into [dbo].[transactions]


(name,account_number,account_type,amount,to_account,to_name,roll) values ('" + name
+ "', '" + acnumber + "','" + actype + "','" + textBox11.Text + "','" + acn + "','"
+ acname + "','" + roll + "') ";

cmdsp1x.CommandTimeout = 300000000;
cmdsp1x.ExecuteNonQuery();

MessageBox.Show("account topped up");


con.Close();

You might also like