You are on page 1of 3

Conalep Juárez 1

Programación con sistemas gestores de bases de datos

Rubrica #3

Gabriel Silva Cerna


080260647-5

Psp: Sergio González Pérez


5101-i

Rubrica #3
Public Class Form1
Dim cn As New
OleDb.OleDbConnection("provider=Microsoft.Jet.OleDb.4.0;Data
source=C:\here\cajeroa.mdb")
Dim dt As New DataTable
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim retirar As Integer = Int(TextBox1.Text)
If retirar >= 20 Then
TextBox7.Text = Int(retirar / 1000)
retirar = retirar Mod 1000
TextBox2.Text = Int(retirar / 500)
retirar = retirar Mod 500
TextBox3.Text = Int(retirar / 200)
retirar = retirar Mod 200
TextBox4.Text = Int(retirar / 100)
retirar = retirar Mod 100
TextBox5.Text = Int(retirar / 50)
retirar = retirar Mod 50
TextBox6.Text = Int(retirar / 20)
retirar = retirar Mod 20
Else
MsgBox("jaja es puro billete, no hay cambio",
MsgBoxStyle.Information, "Mensaje")
End If
TextBox8.Text = ("cuarenta y cinco mil ochocientos veinticuatro")

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
cn.Open()
Dim GuardarDatos As String = "Insert into
cajero(cantidad,1000,500,200,100,50,20,canletras)" & "Values ('" &
TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" &
TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" &
TextBox7.Text & "','" & TextBox8.Text & "')"
Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn)
dataAdapter.Fill(dt)
MsgBox("se agrego el registro correctamente",
MsgBoxStyle.Information, "Mensaje")
dataAdapter.Dispose()
cn.Close()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
End Sub
End Class
cajero
cantidad 1000 500 200 100 50 20 canletras
45824 1 1 1 0 1 45 cuarenta y cinco mil ochocientos veinticuatro

You might also like