예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Retiro3 r3 = new Retiro3();

            r3.Show();
            this.Hide();
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                this.valor = 10;
            }
            if (radioButton2.Checked)
            {
                this.valor = 20;
            }
            if (radioButton3.Checked)
            {
                this.valor = 30;
            }
            if (radioButton4.Checked)
            {
                this.valor = 100;
            }
            if (radioButton5.Checked)
            {
                this.valor = 200;
            }
            try
            {
                formLogin     user   = new formLogin();
                SqlConnection sqlcon = new SqlConnection(@"Data Source=MSI;Initial Catalog=cajero;User ID=team;Password=12345");
                SqlCommand    cmd    = new SqlCommand("update account set accAvMoney = accAvMoney-" + (valor), sqlcon);
                sqlcon.Open();
                cmd.ExecuteNonQuery();
                sqlcon.Close();
            } catch (Exception error)
            {
                MessageBox.Show("Saldo insuficiente" + error);
            }

            Retiro3 r3 = new Retiro3();

            r3.Show();
            this.Hide();
        }