Professional Documents
Culture Documents
Facultad de Ingeniería Escuela Profesional de Ingeniería de Sistemas
Facultad de Ingeniería Escuela Profesional de Ingeniería de Sistemas
INTEGRANTES
DOCENTE
ING. JENNIFER SULLON CHINGA
ASIGNATURA
PROGRAMACIÓN NET
CICLO
V
TEMA
CASOS PRACTICOS
PIURA-PERÚ
2019
EJERCICIO 1
Public Class Form1
Public dt As New DataTable Public
cbCodigo(4) As Double Public
listNombre(4) As String
Public listEditorial(4) As String
Public cbDni(4) As Double
Public listNombre1(4) As String Public
listApellidos(4) As String
Dim x As Integer
x = MessageBox.Show("Desea Salir", "Salir", MessageBoxButtons.YesNo,
MessageBoxIcon.Question)
If x = 6 Then
End
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles
btnNuevoP.Click
Me.boxCodigo.Items.Clear()
Me.txtNombre.Text = ""
Me.txtEditorial.Text = ""
Me.boxDni.Items.Clear()
Me.txtNombre1.Text = ""
Me.txtApellidos.Text = ""
End Sub
dt.Columns.Add("Código", GetType(String))
dt.Columns.Add("Nombre", GetType(String))
dt.Columns.Add("Editorial", GetType(String))
dataPres.DataSource = dt
End Sub
End Class
EJERCICIO 2
listPrecioL(0) = 150
listPrecioL(1) = 120
listPrecioL(2) = 320
listPrecioL(3) = 100
Monto = 0
End Sub
pos = Me.listNom.SelectedIndex
If pos >= 0 Then
Me.listNom.Items.RemoveAt(pos)
Me.listPrecio.Items.RemoveAt(pos)
Me.listCantidad.Items.RemoveAt(pos)
Me.listST.Items.RemoveAt(pos)
Else
MessageBox.Show("Seleccionar elemento a eliminar",
"Eliminar",
MessageBoxButtons.OK, MessageBoxIcon.Hand)
End If
End Sub
Private Sub btnCancelar_Click(sender As Object, e As EventArgs)
Handles btnCancelar.Click
Me.txtCantidad.Text = ""
Me.txtST.Text = ""
Me.txtMonto.Text = ""
Me.listNom.Items.Clear()
Me.listPrecio.Items.Clear()
Me.listCantidad.Items.Clear()
Me.listST.Items.Clear()
Dim x As Integer
If Procesar = 6 Then
MessageBox.Show("El monto total a pagar es: " + txtMonto.Text,
"Salir", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Me.txtNom.Text = ""
Me.txtEdit.Text = ""
Me.txtCantidad.Text = ""
Me.txtCoste.Text = ""
Me.txtST.Text = ""
Me.txtMonto.Text = ""
Me.listNom.Items.RemoveAt(pos)
Me.listPrecio.Items.RemoveAt(pos)
Me.listCantidad.Items.RemoveAt(pos)
Me.listST.Items.RemoveAt(pos)
End Sub
Private Sub btnAgregar_Click(sender As Object, e As EventArgs)
Handles btnAgregar.Click
nomb = nomb + 1
Exit Sub
Loop
MessageBox.Show("Solo se puede comprar un libro por codigo!",
"Atención", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.txtMonto.Text = Monto
Me.listPrecio.Items.Add(Me.txtCoste.Text)
Me.listCantidad.Items.Add(Me.txtCantidad.Text)
Me.listST.Items.Add(Me.txtST.Text)
End Sub
End Clas