Escolar Documentos
Profissional Documentos
Cultura Documentos
Ingenieria de Sistemas
INTRODUCCION
U.N.P.R.G
Ingenieria de Sistemas
DESTINATARIOS
La Biblioteca Virtual va dirigida a estudiantes, docentes interesados en investigar,
promover, fomentar y estudiar el campo de las Nuevas Tecnologas.
JUSTIFICACIN
La Biblioteca Virtual pretende ser un espacio vivo y dinmico para el trabajo, la
bsqueda de informacin, el dialogo y el intercambio. Donde la informacin se renueva
y enriquezca constantemente.
U.N.P.R.G
Ingenieria de Sistemas
Manual de usuario
Para el desarrollo de la Biblioteca Virtual se ha utilizado el paquete JBuilder2005 con
el motor de base de datos SQL Server 2000.
El sistema de Biblioteca Ficsa esta compuesto de dos modulos un modulo a nivel
administrador y el otro a nivel de usuario.
En el cd se adjunta la Base de datos (Biblioteca) el cual debera ser restaurado para el
correcto funcionamiento del sistema de Biblioteca Ficsa.
Para hacer las pruebas al correcto funcionamiento del sistema se ha colocado en un solo
formulario tanto la parte del administrador como tel usuario.
Esta es la ventana donde se ingresara el tipo de usuario y su password, una vez que se
ha ingresado los datos del tipo de usuario esta ventana nos llevara al men del sistema
el cual es el siguiente:
U.N.P.R.G
Ingenieria de Sistemas
MENU MANTENIMIENTO
Registro de Usuario
En este formulario vamos a llenar todos los datos del nuevo usuario, presenta las
opciones de escuela en donde se elige la escuela a la que pertenece el nuevo usuario y
la opcion tipo usuario donde se elige si el usuario es: administrador, docente o alumno.
Tenemos tres botones Registrar, Modificar y eliminar a un usuario los cuales permiten
dar mantenimiento a la tabla registro de tipo de usuario. Para eliminar a un usario se
debe hacer clic en el usario a eliminar y luego en el boton eliminar.
U.N.P.R.G
Ingenieria de Sistemas
Registro de Autores
Permte registrar a los autores y tambien presentar los botones para dar mantenimiento al
formulario.
Registro de Editorial
Muestra todas las editoriales de los libros que existen en la Biblioteca Ficsa,
permitiendo ademas modificar, agregar y eliminar editoriales
U.N.P.R.G
Ingenieria de Sistemas
Registro de Escuelas
Permite registrar las diferentes escuelas y tambien registra a otras facultades con sus
escuelas
U.N.P.R.G
Ingenieria de Sistemas
MENU OPERACIONES
Prestamo del material bibliografico
Este formulario es para la los usuarios ya sea docente, administrativo o alumno en el
cual se puede seleccionar el tipo de material bibliografico, la escuela, tiene un boton de
busqueda, presenta una tabla con todos los libros, para prestar un libro se selecciona el
libro en la tabla y automticamente carga el codigo en la caja codigo de libro y luego se
ingresa su codigo y la clave del usuario, finalmente se presiona el boton prestar.
U.N.P.R.G
Ingenieria de Sistemas
U.N.P.R.G
Ingenieria de Sistemas
Base de datos
U.N.P.R.G
Ingenieria de Sistemas
10
U.N.P.R.G
Ingenieria de Sistemas
11
U.N.P.R.G
Ingenieria de Sistemas
12
U.N.P.R.G
Ingenieria de Sistemas
End Try
End Function
Public Function buscarCodigoCG(ByVal nombre As String) As Integer
Dim com As New SqlCommand
Dim codigo As Integer
Try
Me.conectar()
com.Connection = cn
com.CommandText = "select Cod_CG from Curso_Grupo where Nombre='" & nombre &
"'"
codigo = com.ExecuteScalar
Return codigo
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
Public Sub ModificarCursoGrupo(ByVal codalumno As Integer, ByVal nombre As String,
ByVal duracion As String, ByVal costo As String, ByVal inicio As String, ByVal fin As
String, ByVal dirigido As String, ByVal objetivo As String, ByVal requisitos As String,
ByVal materiales As String, ByVal vacantes As String, ByVal CodLab As Integer, ByVal
CodDoc As Integer, ByVal Codtc As Integer)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "Update Docente set Nombre='" & nombre & "',
Duracion='" & duracion & "',Costo='" & costo & "',Fecha_Inicio='" & inicio & "',
Fecha_Fin='" & fin & "' where Cod_CG=" & codalumno
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Function listarLaboratorio() As DataTable
Dim com As New SqlCommand
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "select * from Laboratorio"
da.SelectCommand = com
da.Fill(dt)
Return dt
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
Return Nothing
End Function
Public Function listarAlumno() As DataTable
Dim com As New SqlCommand
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "select * from Alumno"
da.SelectCommand = com
da.Fill(dt)
Return dt
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
Return Nothing
End Function
Public Function listarCG() As DataTable
Dim com As New SqlCommand
13
U.N.P.R.G
Ingenieria de Sistemas
14
U.N.P.R.G
Ingenieria de Sistemas
Return False
End If
Return True
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
Public Function obtenerCodigoUsuario(ByVal usuario As String, ByVal clave As String)
As Integer
Dim com As New SqlCommand
Dim codigo As Integer
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "select Cod_Usuario from usuario where Login='" &
usuario & "' and Password ='" & clave & "' "
codigo = com.ExecuteScalar
Return codigo
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
End Class
CLASE EDITORIAL
Imports System.Data
Imports System.Data.SqlClient
Public Class Editorial
Inherits Conexion
Public Sub RegistrarEditorial(ByVal codcat As Integer, ByVal nombre As String, ByVal
ciudad As String)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "insert into Editorial values (" & codcat & ",'" &
nombre & "','" & ciudad & "')"
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Sub EliminarEditorial(ByVal idEditorial As Integer)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "delete from Editorial where Cod_Editorial=" &
idEditorial
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Sub ModificarEditorial(ByVal idedit As Integer, ByVal nombre As String, ByVal
ciudad As String)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "update Editorial set Nombre_Editorial='" & nombre &
"', Lugar='" & ciudad & "' where Cod_Editorial =" & idedit
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
15
U.N.P.R.G
Ingenieria de Sistemas
16
U.N.P.R.G
Ingenieria de Sistemas
Inherits Conexion
Public Sub RegistrarEscuelas(ByVal codesc As Integer, ByVal escuela As String)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "insert into Escuela values (" & codesc & ",'" &
escuela & "')"
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Sub EliminarEscuelas(ByVal codesc As Integer)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "delete from Escuela where Cod_Escuela=" & codesc
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Sub ModificarEscuelas(ByVal codesc As Integer, ByVal escuela As String)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "Update Escuela set Nombre_Escuela='" & escuela &
"'where Cod_Escuela=" & codesc
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Function obtenerCodigoEscuelas() As Integer
Dim com As New SqlCommand
Dim codigo As Integer
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "select top 1 cod_Escuela from Escuela order by
cod_Escuela desc"
codigo = com.ExecuteScalar
Return codigo + 1
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
Public Function BuscarEscuelas(ByVal nombre As String) As DataSet
Dim com As New SqlCommand
Dim da As New SqlDataAdapter
Dim ds As New DataSet
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "SELECT
Cod_Escuela AS Cod, Nombre_Escuela AS
Descripcion FROM
dbo.Escuela where Nombre_Escuela like('" & nombre & "%')"
da.SelectCommand = com
da.Fill(ds, "Escuela")
Return ds
End If
Catch ex As Exception
Finally
Me.desconectar()
17
U.N.P.R.G
Ingenieria de Sistemas
End Try
Return Nothing
End Function
End Class
CLASE LECTORES
Imports System.Data
Imports System.Data.SqlClient
Public Class Lectores
Inherits Conexion
Public Sub RegistrarLector(ByVal codusu As Integer, ByVal apellidos As String, ByVal
nombres As String, ByVal direccion As String, ByVal email As String, ByVal telefono As
String, ByVal login As String, ByVal clave As String, ByVal CodEscuela As Integer, ByVal
codtu As Integer)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "insert into Usuario values (" & codusu & ",'" &
apellidos & "','" & nombres & "','" & direccion & "','" & email & "','" & telefono & "',
'" & login & "','" & clave & "'," & CodEscuela & ", " & codtu & ")"
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Sub Eliminarlectores(ByVal idcliente As Integer)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "delete from Usuario where Cod_Usuario=" & idcliente
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Function buscarCodigoEscuela(ByVal nombre As String) As Integer
Dim com As New SqlCommand
Dim codigo As Integer
Try
Me.conectar()
com.Connection = cn
com.CommandText = "select Cod_Escuela from Escuela where Nombre_Escuela='" &
nombre & "'"
codigo = com.ExecuteScalar
Return codigo
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
Public Function buscarCodigoTU(ByVal nombre As String) As Integer
Dim com As New SqlCommand
Dim codigo As Integer
Try
Me.conectar()
com.Connection = cn
com.CommandText = "select Cod_TUsuario from TUsuario where
Nombre_TUsuario='" & nombre & "'"
codigo = com.ExecuteScalar
Return codigo
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
Public Sub ModificarLectores(ByVal codalumno As Integer, ByVal apellidos As String,
ByVal nombres As String, ByVal direccion As String, ByVal email As String, ByVal
telefono As String, ByVal login As String, ByVal clave As String)
Dim com As New SqlCommand
Try
18
U.N.P.R.G
Ingenieria de Sistemas
If Me.conectar() Then
com.Connection = cn
com.CommandText = "Update Usuario set Nombre_Usuario='" & nombres & "',
Apellidos_Usuario='" & apellidos & "',Direccion_Usuario='" & direccion & "',Email='" &
email & "', Telefono='" & telefono & "', Login='" & login & "', Password='" & clave & "'
where Cod_Usuario=" & codalumno
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Function obtenerCodigoLector() As Integer
Dim com As New SqlCommand
Dim codigo As Integer
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "select top 1 Cod_Usuario from usuario order by
Cod_Usuario desc"
codigo = com.ExecuteScalar
Return codigo + 1
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
Public Function listarEscuela() As DataTable
Dim com As New SqlCommand
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "select * from Escuela"
da.SelectCommand = com
da.Fill(dt)
Return dt
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
Return Nothing
End Function
Public Function listarTU() As DataTable
Dim com As New SqlCommand
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "select * from TUsuario"
da.SelectCommand = com
da.Fill(dt)
Return dt
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
Return Nothing
End Function
Public Function Buscarlectores(ByVal nombre As String) As DataSet
Dim com As New SqlCommand
Dim da As New SqlDataAdapter
Dim ds As New DataSet
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "SELECT
dbo.Usuario.Cod_Usuario AS Cod,
dbo.Usuario.Nombre_Usuario AS Nombres, dbo.Usuario.Apellidos_Usuario AS Apelidos,
dbo.Usuario.Direccion_Usuario AS Direccion, dbo.Usuario.Email, dbo.Usuario.Telefono,
dbo.Usuario.Login, dbo.Usuario.Password,
dbo.Escuela.Nombre_Escuela AS Escuela,
19
U.N.P.R.G
Ingenieria de Sistemas
20
U.N.P.R.G
Ingenieria de Sistemas
com.CommandText = "select Cod_Autor from Autor where Apellidos_Autor='" &
21
U.N.P.R.G
Ingenieria de Sistemas
CLASE PRSTAMOS
Imports System.Data
Imports System.Data.SqlClient
Public Class Prestamos
22
U.N.P.R.G
Ingenieria de Sistemas
Inherits Conexion
Public Sub RegistrarPrestamos(ByVal fecha As Date, ByVal CodMB As String, ByVal
CodUsu As String)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "insert into Prestamos (Fecha_Prestamo ,Cod_MB,
Cod_Usuario) values ('" & fecha & "','" & CodMB & "','" & CodUsu & "')"
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Sub EliminarMatricula(ByVal idcliente As Integer)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "delete from Matricula where Cod_Matricula=" &
idcliente
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Function buscarCodigoAlu(ByVal nombre As String) As Integer
Dim com As New SqlCommand
Dim codigo As Integer
Try
Me.conectar()
com.Connection = cn
com.CommandText = "select Cod_Alumno from Alumno where Apellidos='" & nombre
& "'"
codigo = com.ExecuteScalar
Return codigo
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
Public Function buscarCodigoCG(ByVal nombre As String) As Integer
Dim com As New SqlCommand
Dim codigo As Integer
Try
Me.conectar()
com.Connection = cn
com.CommandText = "select Cod_CG from Curso_Grupo where Nombre='" & nombre &
"'"
codigo = com.ExecuteScalar
Return codigo
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
Public Sub ModificarCursoGrupo(ByVal codalumno As Integer, ByVal nombre As String,
ByVal duracion As String, ByVal costo As String, ByVal inicio As String, ByVal fin As
String, ByVal dirigido As String, ByVal objetivo As String, ByVal requisitos As String,
ByVal materiales As String, ByVal vacantes As String, ByVal CodLab As Integer, ByVal
CodDoc As Integer, ByVal Codtc As Integer)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "Update Docente set Nombre='" & nombre & "',
Duracion='" & duracion & "',Costo='" & costo & "',Fecha_Inicio='" & inicio & "',
Fecha_Fin='" & fin & "' where Cod_CG=" & codalumno
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
23
U.N.P.R.G
Ingenieria de Sistemas
Me.desconectar()
End Try
End Sub
Public Function listarLaboratorio() As DataTable
Dim com As New SqlCommand
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "select * from Laboratorio"
da.SelectCommand = com
da.Fill(dt)
Return dt
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
Return Nothing
End Function
Public Function listarAlumno() As DataTable
Dim com As New SqlCommand
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "select * from Alumno"
da.SelectCommand = com
da.Fill(dt)
Return dt
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
Return Nothing
End Function
Public Function listarCG() As DataTable
Dim com As New SqlCommand
Dim da As New SqlDataAdapter
Dim dt As New DataTable
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "select * from Curso_Grupo"
da.SelectCommand = com
da.Fill(dt)
Return dt
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
Return Nothing
End Function
Public Function BuscarMB(ByVal nombre As String) As DataSet
Dim com As New SqlCommand
Dim da As New SqlDataAdapter
Dim ds As New DataSet
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "SELECT dbo.Material_Bibliografico.Cod_MB AS Cod,
dbo.Material_Bibliografico.Titulo, dbo.Autor.Apellidos_Autor + ' ' +
dbo.Autor.Nombre_Autor AS Autor, dbo.Material_Bibliografico.Descripcion,
dbo.Material_Bibliografico.ISBN, dbo.Material_Bibliografico.Fecha_Publicacion AS Fecha,
dbo.Material_Bibliografico.Num_Ejemplares AS Ejemplares,
dbo.Material_Bibliografico.Stock,
dbo.Tipo_Material_Bibliografico.Nombre_TMB AS TMB,
dbo.Editorial.Nombre_Editorial AS Editorial FROM
dbo.Material_Bibliografico
INNER JOIN
dbo.Tipo_Material_Bibliografico ON dbo.Material_Bibliografico.Cod_TMB =
dbo.Tipo_Material_Bibliografico.Cod_TMB INNER JOIN dbo.Editorial ON
dbo.Material_Bibliografico.Cod_Editorial = dbo.Editorial.Cod_Editorial INNER JOIN
24
U.N.P.R.G
Ingenieria de Sistemas
25
U.N.P.R.G
Ingenieria de Sistemas
Me.desconectar()
End Try
End Function
Public Function ComprobarEstado(ByVal cod As Integer, ByVal estado As String) As
Boolean
Dim com As New SqlCommand
Dim codigo As Integer
Try
Me.conectar()
com.Connection = cn
com.CommandText = "select COUNT(*) from Prestamos where Estado='" & estado &
"' and Cod_Usuario= " & cod
codigo = com.ExecuteScalar
If codigo = 0 Then
Return False
End If
Return True
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
Public Function obtenerCodigoUsuario(ByVal usuario As String, ByVal clave As String)
As Integer
Dim com As New SqlCommand
Dim codigo As Integer
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "select Cod_Usuario from usuario where Login='" &
usuario & "' and Password ='" & clave & "' "
codigo = com.ExecuteScalar
Return codigo
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
End Class
CLASE USUARIO
Imports System.Data
Imports System.Data.SqlClient
Public Class Usuarios
Inherits Conexion
Public Sub RegistrarUsuarios(ByVal codusu As Integer, ByVal login As String, ByVal
clave As String)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "insert into acceso values (" & codusu & ", '" & login
& "', '" & clave & "')"
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Sub EliminarUsuarios(ByVal idvendedor As Integer)
Dim com As New SqlCommand
Try
If Me.conectar() Then
com.Connection = cn
com.CommandText = "delete from acceso where Cod_Usuario=" & idvendedor
com.ExecuteNonQuery()
End If
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Sub
Public Sub Modificarusuarios(ByVal idvendedor As Integer, ByVal login As String,
ByVal clave As String)
26
U.N.P.R.G
Ingenieria de Sistemas
27
U.N.P.R.G
Ingenieria de Sistemas
codigo = com.ExecuteScalar
Return codigo
Catch ex As Exception
Finally
Me.desconectar()
End Try
End Function
End Class
FORMULARIOS
FORAUTORES
mports ClasesCasiopea
Public Class FrmAutores
Public indcliente As Integer
Public nomcliente As String
Public dircliente As String
Dim indGrid As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim objclie As New ClasesCasiopea.Autores
Dim ds As DataSet
ds = objclie.BuscarAutores(Me.txtApellidos.Text)
If ds.Tables.Count > 0 Then
Me.DataGridView1.DataSource = ds.Tables(0)
objclie = Nothing
End If
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button7.Click
Me.Close()
End Sub
Private Sub FrmClientes_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Registrar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Registrar.Click
Dim objClie As New ClasesCasiopea.Autores
Dim objVend As New ClasesCasiopea.Autores
objClie.RegistrarAutores(CInt(Me.txtcodigo.Text), Me.txtNombres.Text,
Me.txtApellidos.Text, Me.txtNacionalidad.Text)
objClie = Nothing
End Sub
Private Sub Modificar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Modificar.Click
Dim objClie As New ClasesCasiopea.Autores
objClie.ModificarAutores(CInt(Me.txtcodigo.Text), Me.txtNombres.Text,
Me.txtApellidos.Text, Me.txtNacionalidad.Text)
limpiar()
objClie = Nothing
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Dim objClie As New ClasesCasiopea.Autores
objClie.EliminarAutores(CInt(Me.txtcodigo.Text))
limpiar()
objClie = Nothing
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Dim objclie As New ClasesCasiopea.Autores
limpiar()
Me.txtcodigo.Text = objclie.obtenerCodigoAutor
End Sub
Sub limpiar()
Me.txtcodigo.Text = ""
Me.txtNombres.Text = ""
Me.txtApellidos.Text = ""
Me.txtNacionalidad.Text = ""
End Sub
Private Sub DataGridView1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles DataGridView1.Click
indGrid = DataGridView1.CurrentRow.Index
Me.txtcodigo.Text = DataGridView1.Rows(indGrid).Cells(0).Value
Me.txtNombres.Text = DataGridView1.Rows(indGrid).Cells(1).Value
28
U.N.P.R.G
Ingenieria de Sistemas
Me.txtApellidos.Text = DataGridView1.Rows(indGrid).Cells(2).Value
Me.txtNacionalidad.Text = DataGridView1.Rows(indGrid).Cells(3).Value
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
indcliente = DataGridView1.Rows(indGrid).Cells(0).Value
nomcliente = DataGridView1.Rows(indGrid).Cells(1).Value.ToString
dircliente = DataGridView1.Rows(indGrid).Cells(2).Value.ToString
Me.Close()
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End Sub
End Class
FORMCONSULTAS
Imports ClasesCasiopea
Public Class FrmConsultas
Public indcliente As Integer
Public nomcliente As String
Public dircliente As String
Dim indGrid As Integer
Private Sub FrmConsultas_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AgregarEscuela()
BuscarMB()
End Sub
Sub AgregarEscuela()
Dim objVen As New Lectores
Dim dt As DataTable
dt = objVen.listarEscuela
Dim vendedor As DataRow
For Each vendedor In dt.Rows
cboEscuela.Items.Add(vendedor.Item(1))
Next
objVen = Nothing
End Sub
Sub BuscarMB()
Dim objclie As New ClasesCasiopea.Consultas
Dim ds As DataSet
ds = objclie.BuscarMB(Me.txtTitulo.Text)
If ds.Tables.Count > 0 Then
Me.DataGridView1.DataSource = ds.Tables(0)
objclie = Nothing
End If
End Sub
Sub BuscarxAutor()
Dim objclie As New ClasesCasiopea.Consultas
Dim ds As DataSet
ds = objclie.BuscarxAutor(Me.txtAutor.Text)
If ds.Tables.Count > 0 Then
Me.DataGridView1.DataSource = ds.Tables(0)
objclie = Nothing
End If
End Sub
Private Sub btnMatricular_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnMatricular.Click
BuscarMB()
End Sub
Private Sub btnSalir_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSalir.Click
Me.Close()
End Sub
Private Sub txtTitulo_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtTitulo.TextChanged
BuscarMB()
End Sub
Private Sub txtAutor_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtAutor.TextChanged
BuscarxAutor()
End Sub
End Class
FORMDEVOLUCIONES
Imports ClasesCasiopea
29
U.N.P.R.G
Ingenieria de Sistemas
30
U.N.P.R.G
Ingenieria de Sistemas
Me.txtTitulo.Text = ""
Me.txtClave.Text = ""
Me.txtUsuario.Text = ""
Me.txtCod.Text = ""
Me.txtLibro.Text = ""
End Sub
Private Sub DataGridView1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGridView1.Click
indGrid = DataGridView1.CurrentRow.Index
Me.txtCod.Text = DataGridView1.Rows(indGrid).Cells(0).Value
Me.txtLibro.Text = DataGridView1.Rows(indGrid).Cells(2).Value
End Sub
Private Sub btnDevolver_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnDevolver.Click
validar()
End Sub
End Class
FORMEDITORIAL
Imports clasescasiopea
Public Class FrmEditorial
Public indcliente As Integer
Public nomcliente As String
Public dircliente As String
Dim indGrid As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim objven As New ClasesCasiopea.Editorial
Dim ds As DataSet
ds = objven.BuscarEditorial(Me.txtnombre.Text)
If ds.Tables.Count > 0 Then
Me.DataGridView1.DataSource = ds.Tables(0)
objven = Nothing
End If
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button7.Click
Me.Close()
End Sub
Private Sub Registrar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Registrar.Click
Dim objven As New ClasesCasiopea.Editorial
objven.RegistrarEditorial(CInt(Me.txtcodigo.Text), Me.txtnombre.Text,
Me.txtCiudad.Text)
objven = Nothing
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Dim objven As New ClasesCasiopea.Editorial
objven.ModificarEditorial(CInt(Me.txtcodigo.Text), Me.txtnombre.Text,
Me.txtCiudad.Text)
limpiar()
objven = Nothing
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Dim objven As New ClasesCasiopea.Editorial
objven.EliminarEditorial(CInt(Me.txtcodigo.Text))
limpiar()
objven = Nothing
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Dim objven As New ClasesCasiopea.Editorial
limpiar()
Me.txtcodigo.Text = objven.obtenerCodigoEditorial
End Sub
Sub limpiar()
Me.txtcodigo.Text = ""
Me.txtnombre.Text = ""
Me.txtCiudad.Text = ""
End Sub
Private Sub DataGridView1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles DataGridView1.Click
indGrid = DataGridView1.CurrentRow.Index
Me.txtcodigo.Text = DataGridView1.Rows(indGrid).Cells(0).Value
31
U.N.P.R.G
Ingenieria de Sistemas
Me.txtnombre.Text = DataGridView1.Rows(indGrid).Cells(1).Value
Me.txtCiudad.Text = DataGridView1.Rows(indGrid).Cells(2).Value
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End Sub
End Class
FORMATERIALBIBLIOGRAFICO
Imports ClasesCasiopea
Public Class FrmMB
Public indcliente As Integer
Public nomcliente As String
Public dircliente As String
Dim indGrid As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
cargar()
End Sub
Sub cargar()
Dim objclie As New ClasesCasiopea.Libros
Dim ds As DataSet
ds = objclie.BuscarMB(Me.txtTitulo.Text)
If ds.Tables.Count > 0 Then
Me.DataGridView1.DataSource = ds.Tables(0)
objclie = Nothing
End If
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button7.Click
Me.Close()
End Sub
Private Sub FrmLectores_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AgregarEditorial()
AgregarTMB()
AgregarAutor()
cargar()
End Sub
Private Sub Registrar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Registrar.Click
Dim objClie As New ClasesCasiopea.Libros
Dim objVend As New ClasesCasiopea.Libros
Dim objTU As New ClasesCasiopea.Libros
Dim objtmb As New ClasesCasiopea.Libros
objClie.RegistrarLibros(CInt(Me.txtcodigo.Text), Me.txtTitulo.Text,
Me.txtDescripcion.Text, Me.txtISBN.Text, Me.txtFecha.Text, Me.txtEjemplares.Text,
Me.txtStock.Text, objtmb.buscarCodigoTMB(Me.cboTMB.Text),
objVend.buscarCodigoEditorial(Me.cboEditorial.Text),
objTU.buscarCodigoAutor(Me.cboAutor.Text))
objClie = Nothing
limpiar()
MsgBox("Datos Grabados Correctamente")
cargar()
End Sub
Private Sub Modificar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Modificar.Click
Dim objClie As New ClasesCasiopea.Libros
objClie.ModificarLibros(CInt(Me.txtcodigo.Text), Me.txtTitulo.Text,
Me.txtDescripcion.Text, Me.txtISBN.Text, Me.txtFecha.Text, Me.txtEjemplares.Text,
Me.txtStock.Text)
limpiar()
objClie = Nothing
MsgBox("Datos Grabados Correctamente")
cargar()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Dim objClie As New ClasesCasiopea.Libros
objClie.EliminarLibros(CInt(Me.txtcodigo.Text))
limpiar()
objClie = Nothing
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
32
U.N.P.R.G
Ingenieria de Sistemas
33
U.N.P.R.G
Ingenieria de Sistemas
cboEscuela.Items.Add(vendedor.Item(1))
Next
objVen = Nothing
End Sub
Sub BuscarMB()
Dim objclie As New ClasesCasiopea.Prestamos
Dim ds As DataSet
ds = objclie.BuscarMB(Me.txtTitulo.Text)
If ds.Tables.Count > 0 Then
Me.DataGridView1.DataSource = ds.Tables(0)
objclie = Nothing
End If
End Sub
Sub BuscarxAutor()
Dim objclie As New ClasesCasiopea.Prestamos
Dim ds As DataSet
ds = objclie.BuscarxAutor(Me.txtAutor.Text)
If ds.Tables.Count > 0 Then
Me.DataGridView1.DataSource = ds.Tables(0)
objclie = Nothing
End If
End Sub
Sub validar()
Dim objclie As New ClasesCasiopea.Prestamos
If objclie.Comprobarusuario(Me.txtUsuario.Text, Me.txtClave.Text) = True Then
verificarEstado()
Else
MsgBox("Clave o Usuario Incorrectos", MsgBoxStyle.Information, "Gestion de
Matrcula")
Me.txtClave.Text = ""
Me.txtUsuario.Text = ""
End If
End Sub
Sub verificarEstado()
Dim objven As New ClasesCasiopea.Prestamos
Dim objestado As New ClasesCasiopea.Prestamos
Dim cod As Integer
Dim estado As String
estado = "P"
cod = objven.obtenerCodigoUsuario(Me.txtUsuario.Text, Me.txtClave.Text)
If objestado.ComprobarEstado(cod, estado) = True Then
MsgBox("Tiene material Bibliogrfico, solo se puede realizar un pedido",
MsgBoxStyle.Information, "Gestion de Matrcula")
Else
GrabarPrestamo()
End If
End Sub
Sub GrabarPrestamo()
Dim objClie As New ClasesCasiopea.Prestamos
Dim objUsu As New ClasesCasiopea.Prestamos
objClie.RegistrarPrestamos(Now.Date, Me.txtCod.Text,
objUsu.obtenerCodigoUsuario(Me.txtUsuario.Text, Me.txtClave.Text))
objClie = Nothing
limpiar()
MsgBox("Operacin Realizada con Exito, reclamar el Material Bibliografico",
MsgBoxStyle.Information, "Gestion de Matrcula")
End Sub
Sub limpiar()
Me.txtTitulo.Text = ""
Me.txtClave.Text = ""
Me.txtUsuario.Text = ""
Me.txtCod.Text = ""
Me.txtLibro.Text = ""
End Sub
Private Sub btnMatricular_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnMatricular.Click
BuscarMB()
End Sub
Private Sub btnSalir_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSalir.Click
Me.Close()
End Sub
Private Sub txtTitulo_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtTitulo.TextChanged
BuscarMB()
End Sub
34
U.N.P.R.G
Ingenieria de Sistemas
35
U.N.P.R.G
Ingenieria de Sistemas
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
indcliente = DataGridView1.Rows(indGrid).Cells(0).Value
nomcliente = DataGridView1.Rows(indGrid).Cells(1).Value.ToString
dircliente = DataGridView1.Rows(indGrid).Cells(2).Value.ToString
Me.Close()
End Sub
End Class
FORMUSUARIOS
Imports clasescasiopea.Usuarios
Public Class FrmUsuarios
Public indcliente As Integer
Public nomcliente As String
Public dircliente As String
Dim indGrid As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim objven As New ClasesCasiopea.Usuarios
Dim ds As DataSet
ds = objven.BuscarUsuarios(Me.txtnombre.Text)
If ds.Tables.Count > 0 Then
Me.DataGridView1.DataSource = ds.Tables(0)
objven = Nothing
End If
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button7.Click
Me.Close()
End Sub
Private Sub Registrar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Registrar.Click
Dim objven As New ClasesCasiopea.Usuarios
objven.RegistrarUsuarios(CInt(Me.txtcodigo.Text), Me.txtnombre.Text,
Me.txtClave.Text)
objven = Nothing
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Dim objven As New ClasesCasiopea.usuarios
objven.ModificarUsuarios(CInt(Me.txtcodigo.Text), Me.txtnombre.Text,
Me.txtClave.Text)
limpiar()
objven = Nothing
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Dim objven As New ClasesCasiopea.Usuarios
objven.EliminarUsuarios(CInt(Me.txtcodigo.Text))
limpiar()
objven = Nothing
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Dim objven As New ClasesCasiopea.Usuarios
limpiar()
Me.txtcodigo.Text = objven.obtenerCodigoUsuario
End Sub
Sub limpiar()
Me.txtcodigo.Text = ""
Me.txtnombre.Text = ""
Me.txtClave.Text = ""
End Sub
Private Sub DataGridView1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles DataGridView1.Click
indGrid = DataGridView1.CurrentRow.Index
Me.txtcodigo.Text = DataGridView1.Rows(indGrid).Cells(0).Value
Me.txtnombre.Text = DataGridView1.Rows(indGrid).Cells(1).Value
Me.txtClave.Text = DataGridView1.Rows(indGrid).Cells(2).Value
End Sub
End Class
36