0% found this document useful (0 votes)
64 views4 pages

Rubrica 3: Conalep 1

The document describes a program for a cash register system written in Visual Basic. It contains code to calculate the number of bills needed to make change for an amount entered by the user. The code divides the amount by 500, 200, 100, 50 and 20 to get the number of each bill type. It also includes code to clear the fields, connect to an Access database, insert a new record, and display a message when a record is added successfully.

Uploaded by

Sarawallmach
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views4 pages

Rubrica 3: Conalep 1

The document describes a program for a cash register system written in Visual Basic. It contains code to calculate the number of bills needed to make change for an amount entered by the user. The code divides the amount by 500, 200, 100, 50 and 20 to get the number of each bill type. It also includes code to clear the fields, connect to an Access database, insert a new record, and display a message when a record is added successfully.

Uploaded by

Sarawallmach
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Conalep 1

Programación en Sistemas Gestores de Bases de Datos

Sergio González Pérez

Rubrica 3

5101

Sarahi Vázquez W.
Imports System.Data.OleDb
Public Class Form1
Dim dt As New DataTable
Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source
=E:\Cajero1.mdb")
Dim Mensaje As String

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


System.EventArgs) Handles Button1.Click
Dim x As Integer
Dim x1 As Integer
Dim m1 As String = "El numero que capturaste es"

If (Int(txtdin.Text >= 500)) Then

x1 = 0
x = 500
txtb500.Text = txtdin.Text / 500

Else
txtb500.Text = 0

End If

If (Int(txtdin.Text <= 200)) Then

x1 = 0
x = 200
txtb200.Text = txtdin.Text / 200

Else
txtb200.Text = 0

End If

If (Int(txtdin.Text <= 100)) Then

x1 = 0
x = 100
txtb100.Text = txtdin.Text / 100

Else
txtb100.Text = 0

End If
If (Int(txtdin.Text <= 50)) Then
x1 = 0
x = 50
txtb50.Text = txtdin.Text / 50

Else
txtb50.Text = 0

End If
If (Int(txtdin.Text <= 20)) Then

x1 = 0
x = 20
txtb20.Text = txtdin.Text / 20

Else
txtb20.Text = 0

End If
End Sub

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


System.EventArgs) Handles Button2.Click
txtdin.Text = ""
txtb500.Text = ""
txtb200.Text = ""
txtb100.Text = ""
txtb50.Text = ""
txtb20.Text = ""
End Sub

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


System.EventArgs) Handles Button3.Click
cn.Open()
Dim GuardarDatos As String = "Insert Into
Cajero1(Cantidad,B500,B200,B100,B50,B20,Mensaje)" & "values ('" & txtdin.Text &
"' , '" & txtb500.Text & "' , '" & txtb200.Text & "' , '" & txtb100.Text & "' , '" &
txtb50.Text & "' , '" & txtb20.Text & "' , " 'txtMensaje.Text & "')"
Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn)
dataAdapter.Fill(dt)
MsgBox("Se Agrego Registro Correctamente", MsgBoxStyle.Information,
"Mensaje")

dataAdapter.Dispose()
cn.close()
End Sub
End Class
Cajero
Cantidad B500 B200 B100 B50 B20 Mensaje
500 1 0 0 0 0
200 0 1 0 0 0
100 0 0 1 0 0
50 0 0 0 1 0
20 0 0 0 0 1

You might also like