Tesis sistema informatico de la escuela 21 de mayo
1. Universidad Técnica de Manabí
Facultad de Ciencias Informáticas
TESIS DE GRADO
Previa a la Obtención del Título de:
“ANALISTA EN SISTEMAS”
TEMA:
“DESARROLLO DE UN SISTEMA INFORMATICO ADMINISTRATIVO
PARA LA ESCUELA FISCAL MIXTA “21 DE MAYO” DEL CANTÓN
PORTOVIEJO, PROVINCIA DE MANABÍ”.
AUTORAS:
Ligia Elena Escobar Domínguez.
Maryuri Johana Solórzano Tuàrez.
DIRECTORA DE TESIS
Ing. Maricela Pinargote
Portoviejo - Manabí - Ecuador
2010
2. CERTIFICACION
Ing. Maricela Pinargote, certifica que la presente tesis ha sido elaborada por las
Srta. Ligia Elena Escobar Domínguez y Maryuri Johana Solórzano Tuárez, bajo
mi dirección, control y seguimiento. El presente trabajo reúne los requisitos de
una investigación y programación concluida mediante el esfuerzo, dedicación y
constancia, tanto en parte teorice, investigativa y practica, lo que permite otorgar
su originalidad.
Para constancia y validez, firmo el documento.
Atentamente,
Maricela Pinargote
DIRECTORA DE TESIS
3. UNIVERSIDAD TÉCNICA DE MANABÍ
FACULTAD DE CIENCIAS INFORMÁTICAS
ESCUELA DE COMPUTACIÓN
TEMA:
“DESARROLLO DE UN SISTEMA INFORMÁTICO ADMINISTRATIVO
PARA LA ESCUELA FISCAL MIXTA “21 DE MAYO” DEL CANTÓN
PORTOVIEJO, PROVINCIA DE MANABÍ”.
TESIS DE GRADO
Sometida a consideración de los Miembros del Tribunal de Revisión y
Sustentación, legalizada por el Honorable Consejo Directivo como requisito
previo a la obtención del título de: ANALISTA EN SISTEMAS aprobado por:
DIRECTORA DE TESIS ____________________
Ing. Maricela Pinargote
PRESIDENTE DEL TRIBUNAL ____________________
Ing. Lenin Rivera
DOCENTE DE AREA _________________
Ing. Javier Cuzco
DOCENTE MIEMBRO DE COMISION _________________
Ing. Jimmy Zambrano
4. DERECHO DEL AUTOR
Las presentes: Ligia Elena Escobar Domínguez y Maryuri Johana Solórzano
Tuarez, declararan que la tesis es de total creación de las antes mencionadas;
teniendo como directora de tesis a la Ing. Maricela Pinargote.
Este proyecto está protegido por las Leyes del Autor y otros Tratados
Internacionales. La reproducción o distribución no autorizadas de este trabajo o de
cualquier parte del mismo, pueden dar lugar a responsabilidades civiles y penales
que serán perseguidas por las autoridades competentes.
Su análisis, diseño y codificación son de exclusividad de los autores.
Para constancia firman.
____________________ ____________________
Ligia Escobar Domínguez Maryuri Solórzano Tuarez
AUTORA AUTORA
5. AGRADECIMIENTO
Agradezco primeramente a Dios por hacer posible el sueño que toda
estudiante anhela en la vida: ser una Profesional.
A mis queridos profesores quienes con sus conocimientos y
enseñanzas me inculcaron todos los valores morales, éticos y
profesionales los cuales los pondré en práctica durante toda mi vida.
A la Ing. Maricela Pinargote, mi Directora de Tesis, quien ha sido
parte fundamental de este proyecto guiándome en los análisis y
comentarios suscitados en el transcurso de la misma.
Así mismo a todas las personas que han colocado su granito de arena
colaborando de la manera más humilde y desinteresada que me han
llevado a obtener un gran éxito.
LIGIA ESCOBAR DOMÍNGUEZ
6. AGRADECIMIENTO
Con especial afecto agradezco a los directivos de esta importante
Institución Educativa como es la Universidad Técnica de Manabí
como son la Ing. Maricela Pinargote, Ing. Lenin Rivera, Ing. Javier
Cusco y Ing. Jimmy Zambrano, por su confianza y apoyo para la
culminación de esta etapa importante de mi vida.
A mi madre que me inculcó valores de responsabilidad y dedicación
hacia la superación y el esfuerzo continuo para cumplir toda meta
anhelada.
Muchas gracias.
MARYURI SOLÓRZANO TUAREZ
7. DEDICATORIA
A Dios por ser él quien me ha iluminado desde el cielo despejando
cualquier duda y regalándome un poquito de sabiduría para poder
terminar con éxito este proyecto.
A mis padres Sr. Jorge Escobar y Sra. Jacqueline Domínguez, quienes
con esfuerzo y sacrificio han sabido compartir mis momentos más
difíciles dándome el apoyo incondicional en todos los aspectos.
A mi hija Camila Sánchez quien es mi fuente de inspiración y mi
motivo de seguir siempre adelante.
A mis hermanos Jacqueline, Jorge Luis y Kassandra quienes me
brindan toda la confianza para poder seguir adelante.
A mí querido esposo por su motivación y su apoyo incondicional.
LIGIA ESCOBAR DOMÍNGUEZ
8. DEDICATORIA
Dedico este trabajo primeramente a Dios por guiarnos y darnos
fuerzas para seguir adelante. A nuestros progenitores por brindarnos
su apoyo incondicional y llevarnos por la senda del bien.
También dedico en especial a mi hijo Kendru Steven Moreira
Solórzano, por darme las fuerzas y motivación para el proceso de esta
investigación.
A mi madre Dolores Tuárez, que con sus sabios consejos he podido
conseguir mis metas anheladas.
MARYURI SOLÓRZANO TUAREZ
9. RESUMEN EJECUTIVO
El desarrollo de un programa computarizado optimiza el tiempo, sistematizar la
labor del usuario, especialmente desarrollado para un análisis rápido y eficaz.
Se ofrece una herramienta de trabajo a la Escuela Fiscal Mixta “21 de Mayo” que
consiste en un sistema de información más exacta y rápida para el personal que
allí labora matriculando una cantidad de alumnos en un corto período de tiempo
para dar inicio a las actividades del plantel de manera eficiente e integra.
Presenta una interfaz amigable capaz de realizar: las operaciones básicas de
mantenimiento de archivos que proporcione una mejor manera de proveer
información actualizada para la toma de decisiones, registro y control de todos los
procesos inherentes del sistema de inscripción, ofrecer reportes de acuerdo a la
necesidad del usuario.
El objetivo central del proyecto “Desarrollo de un Sistema Informático
Administrativo para la Escuela Fiscal Mixta “21 de Mayo” del Cantón Portoviejo,
provincia de Manabí”, es automatizar el proceso de inscripción de esta institución
educativa y todos los procesos inherentes al mismo que genere información
oportuna, precisa y confiable mediante el uso de los sistemas de información,
herramienta que contribuye a los diferentes sectores productivos de la sociedad en
llevar las tareas administrativas rutinarias, tediosa y de gran volumen de
información al computador, teoría que afianza la propuesta de sistema de
información para el proceso de inscripción del plantel como nueva forma de
trabajo que sustituya la metodología hasta ahora utilizada en los sistemas
administrativos escolares.
10. EXECUTIVE SUMMARY
The development of a program computarizado optimize the time, systematize the
labor of the user, specially developed for a rapid and effective analysis.
A tool of work offers to the Fiscal Mixed School " May 21 " that consists of a
system of more exact and rapid information for the personnel that there works
registering a pupils' quantity in a short period efficient of time to give beginning
to the activities of the nursery of an way and it integrates.
He presents an amicable interface capable of realizing: the basic operations of
maintenance of files that provides a better way of providing information updated
for the capture of decisions, record and control of all the inherent processes of the
system of inscription, offering reports of agreement to the need of the user.
The central aim of the project " Development of an IT Administrative System for
the Fiscal Mixed School " On May 21 " from the Canton Portoviejo, Manabí's
province ", is to automate the process of inscription of this educational institution
and all the processes inherent in the same one that generates opportune, precise
and reliable information by means of the use of the information systems, tool that
he contributes to the different productive sectors of the company in taking the
administrative routine tasks, tedious and of great volume of information to the
computer, theory that guarantees the offer of information system for the process of
inscription of the nursery as new form of work that replaces the methodology till
now used in the administrative school systems.
11. ÍNDICE
CERTIFICACION II
APROBACION III
DERECHO DEL AUTOR IV
AGRADECIMIENTO VI
DEDICATORIA VIII
RESUMEN EJECUTIVO IX
SUMARY X
TEMA
INTRODUCCIÓN
CAPITULO I
1.1. JUSTIFICACIÓN 1
2.1 PLANTEAMIENTO DEL PROBLEMA 2
2.2 OBJETIVOS 3
2.3 OBJETIVO GENERAL 3
2.4 OBJETIVOS ESPECÍFICOS 3
CAPITULO II
2. MARCO REFERENCIAL 5
2.1 MARCO TEÓRICO 6
2.1.1 DISEÑO DEL SISTEMA 7
2.1.2 OBJETIVOS DEL DISEÑO DE SQL. SERVER 8
2.1.3 VISUAL BASIC 11
CAPITULO III
3. DISEÑO METODOLÓGICO 13
3.1 METODOLOGÍA 13
3.2 TÉCNICAS 13
3.3 RESULTADOS OBTENIDO 14
3.3 PRESUPUESTO 15
12. CAPITULO IV
4.1 CONCLUSIONES Y RECOMENDACIONES 16
4.1.1 CONCLUSIONES 16
4.1.2 RECOMENDACIONES 17
CAPITULO V
5. PROPUESTA 18
5.1 DESCRIPCION GENERAL DEL SISTEMA 18
5.2 DETERMINACION DE REQUERIMIENTO 18
5.3 RELACIONES DE LAS BASES DE DATOS 19
5.4 CRONOGRAMA VALORADO 20
5.6 BIBLIOGRAFIA 21
ANEXOS
MANUAL DEL PROGRAMADOR
MANUAL DEL USUARIO
CD DE INSTALACION
13. TEMA:
“DESARROLLO DE UN SISTEMA INFORMÁTICO ADMINISTRATIVO
PARA LA ESCUELA FISCAL MIXTA “21 DE MAYO” DEL CANTÓN
PORTOVIEJO, PROVINCIA DE MANABÍ”.
14. Introducción
Los Sistemas Informáticos en la actualidad son muy importantes ya que gracias a
ellos la mayoría de las instituciones por no decir todas, manejan las Bases de
Datos de una forma más cómoda y sencilla, sin la necesidad de archivar los
registros en papeles u otros documentos, ya que la teneduría de libros se pasa a
computadora sin un sistema informático, lo que no permite obtener una
información rápida de los registros diarios y mensuales que se necesitan en su
debido momento.
Con los Sistemas Informáticos esta tarea resulta más fácil de manejar para los
empleados que laboran en dichas instituciones, ya sean públicas o privadas.
Institución escogida para aplicar este sistema informático es la Escuela Nacional
Mixta “21 de Mayo” por el prestigio que tiene y por las facilidades que brindaron
desde un principio para la obtención de datos y materiales de apoyo para la
culminación de este proyecto.
Este trabajo tuvo como meta final la realización de un Sistema Informático creado
en lenguaje de programación Visual Basic 6.0, ya que es el más utilizado en la
actualidad y es muy fácil de manejarlo y cualquier persona capacitada podrá
manejarlo.
Estos datos e instrucciones se codificaran en dicho lenguaje de programación para
que puedan ser convertidos en lenguajes de computadoras y así poder ejecutar el
programa.
15. CAPITULO I
1.1 Justificación.
Este Sistema informático es trascendental por la importancia que presenta el
control de datos en la entidad Educativa “21 de Mayo”, permitiendo innumerables
beneficios que va a recibir los mismos con la realización de un Sistema
Informático que ayude como controlar de una mejor manera los reportes e
informes que a diario en ella se elaboran.
Para contribuir a la solución de la problemática se puso énfasis en la información
que ofreció la Escuela a la interesada para la realización de este sistema.
En esta justificación se expresan las razones experimentales y las posibles
ventajas que se derivarían de los resultados de la realización de este proyecto. Y
es evidente que la labor debe coordinar un buen número de campos para poder
resolver el propósito planteado.
Un sistema de información es un conjunto de elementos que interactúan entre sí
con el fin de apoyar las actividades de las instituciones educativas.
1
16. 1.2 Planteamiento del problema.
La Informática es la ciencia que sirve para que muchos procesos aumenten su
eficiencia, y si una organización, institución o empresa requiere ofrecer a sus
clientes la calidad en el servicio que otorga, se hace emergente la búsqueda de
soluciones que faciliten los procesos para servir mejor.
La Escuela Fiscal Mixta “21 de Mayo”, institución que ayuda a la comunidad con
su educación y prestigio, utiliza procesos manuales para recabar toda la
información concerniente al alumnado y profesores como son las matriculas, notas
trimestrales y asistencia del personal docente que surge durante el año lectivo, lo
que entorpece la agilidad y veracidad del procesamiento de datos, disminuyendo
por consiguiente la efectividad de los servicios, lo que provoca insatisfacción
tanto para los alumnos como para la Institución.
La manipulación del Sistema Administrativo con recursos materiales como papel,
plumas, borrador y calculadora es muy complicado para quien lo maneja, por esta
razón el problema queda planteado de la siguiente manera:
¿Cómo influye el desarrollo de un Sistema Informático de registros de
Matriculación, control de Notas y Asistencia del personal Docente, en la Escuela
Fiscal Mixta “21 de Mayo” de la ciudad de Portoviejo?
2
17. 1.3 Objetivos.
1.3.1 Objetivo General.
Solucionar con la implementación de un sistema informático administrativo las
dificultades que ocasiona a las autoridades de la Escuela “21 de Mayo” el control
de sus procesos de administración mediante registros manuales.
1.3.2 Objetivos Específicos.
Facilitar al personal de la Escuela el proceso de registros de matriculación,
notas y asistencia del personal docente.
Permitir un manejo simple del control de asistencia y otros datos de los
docentes de la Escuela.
Permitir la obtención inmediata de reportes de matriculas, notas,
asistencia, etc.
Proporcionar a través del sistema el acceso a una información ordenada y
actualizada del proceso administrativo de la institución.
3
18. 1.4 BENEFICIARIOS
1.4.1. DIRECTOS
Las principales personas que se beneficiaran con la implementación del Sistema
Informático es el área de Colecturía de la Escuela Fiscal Mixta “21 de Mayo” de
la ciudad de Portoviejo Provincia de Manabí.
1.4.2. INDIRECTOS
Usuarios en general.
4
19. CAPITULO II
2. Marco Referencial.
Como consecuencia de fuertes invierno ocurridos entre los años 1982 - 1983
hubieron muchos damnificados, los que fueron ubicados en lo que hoy es la
ciudadela San Alejo.
Viendo las necesidades de está nueva Ciudadela y ante gestiones de sus
moradores se crea la escuela “21 de Mayo”, la que toma el nombre este plantel de
la fecha en que fue creada el 21 de Mayo de 1984.1
Funcionaba en un terreno prestado, en un canchón de caña sin piso totalmente
antipedagógico con 200 alumnos aproximadamente y como único profesor el Sr.
Jorge Bello Saltos.
Por el número elevado de alumnos, las autoridades educativas creyeron
conveniente reajustar la escuela Cristóbal Colón, pasando la Sra. Estrella
Zambrano Macías a laborar en esta escuela; además colaboraban varios jóvenes.
Con el pasar del tiempo se fue incrementando el número de profesores y en la
actualidad la Institución cuenta con 11 profesores titulares, 2 contratos, 1 conserje
y la Directora es la Lcda. Carlota Andrade.
1
Manual de la Escuela “21 de Mayo”
5
20. 2.1 Marco Teórico.
La investigación se basa en la problemática que tiene la Escuela Fiscal Mixta “21
de Mayo” siendo uno de estos problemas la falta de un Sistema Informático
adecuado a sus necesidades y que sus computadoras no son actualizadas y por
ende no cumplen eficientemente en el correcto trabajo del mismo.
Por medio de un Sistema Informático que se basa en un Software que Controle los
Registros como son: matriculación, control de notas y asistencia del personal
docente. La Directora ha decidido que; para el mejor desarrollo y progreso de la
Institución, que se actualice sus computadoras con un software que proporcione
los registros ya mencionados y va hacer en el lenguaje de programación llamado
Visual Basic, es el lenguaje más utilizado y el más fácil que encuentre un
programador, ya que contiene muchas herramientas necesarias para construir
programas para Windows de forma sencilla, eficiente y lograr hacer accesible a
los programadores de Basic la posibilidad de programar para Windows.
Una serie de herramientas ha permitido, que con algunos pocos de clic sea posible
crear ventanas de Windows, colocarle botones de comando, menús, cuadros de
textos, listas, etc.
Esto es para que exista una mejor distribución de entrega de reportes, ya que con
este Software será de mucha ayuda y facilitará de manera más rápida los registros
que dispone la Escuela Fiscal Mixta “21 de Mayo”.
6
21. LA CONSTRUCCIÓN DE UNA APLICACIÓN EN WINDOWS CON
VISUAL BASIC IMPLICA TRES PASOS DE PROGRAMACIÓN.
Crear la interfaz de usuario mediante los controles de VISUAL BASIC.
Establecer las características o propiedades de los elementos de dicha
interfaz de usuario, medida que sea necesaria.
Escribir el código del programa para uno o más elementos de la interfaz
del usuario, a medida que sean necesarios.
2.1.1 Diseño del Sistema.
Se llevara a cabo el análisis de requisitos del programa que es una base de datos
que registra la información que tiene en la Escuela Fiscal Mixta “21 de Mayo”.
Para esto es necesario que el programa tenga la capacidad de acceder y crear una
base de datos, las cuales se usarán para mantener guardados los datos en el disco
aun después de terminar la ejecución del programa deberá contar también con
funciones que sean necesarios, el programa debe validar los diversos datos que se
ingresaran, estos deben estar acompañados con un respectivo mensaje que ayude a
comprender su correcta utilización.
El desempeño de Software se ha centrado en facilitar el ingreso, de acceder y
manipular los datos de la Escuela, en desarrollar el Software de manera que lleve
el control de la información haciendo que se envié un mensaje de alerta cuando un
7
22. registro es incorrecto y por último el programa debe hacer que el reporte sea el
correcto.
2.1.2 Objetivos del Diseño de SQL Server
Los clientes están buscando soluciones para sus problemas de negocios. 2La
mayoría de las "soluciones" de bases de datos solamente traen múltiples niveles
de costos y complejidad. La estrategia de Microsoft es la de hacer que SQL Server
sea la base de datos más fácil de utilizar para construir, administrar e implementar
aplicaciones de negocios. Esto significa tener que poner a disposición un modelo
de programación rápido y sencillo para desarrolladores, eliminando la
administración de base de datos para operaciones estándar, y suministrando
herramientas sofisticadas para operaciones más complejas.
SQL Server disminuye el costo total de propiedad a través de características como
administración multi-servidor y con una sola consola; ejecución y alerta de
trabajos basadas en eventos; seguridad integrada; y scripting administrativo. Esta
versión también libera al administrador de base de datos para aspectos más
sofisticados del trabajo al automatizar las tareas de rutina. Al combinar estos
poderosos servicios de administración con las nuevas características de
configuración automática, Microsoft SQL Server es la elección ideal de
automatización de sucursales y aplicaciones de base de datos insertadas.
2
www. Monografías.com/trabajos14/sqlserver/sqlserver.shtml
8
23. Los clientes invierten en sistemas de administración de bases de datos, en forma
de aplicaciones escritas para esa base de datos y la educación que implica para la
implementación y administración. Esa inversión debe protegerse: a medida que el
negocio crece, la base de datos deberá crecer y manejar más datos, transacciones y
usuarios. Los clientes también desean proteger las inversiones a medida que
escalan aplicaciones de base de datos hacia equipos portátiles y sucursales.
Para cumplir con estas necesidades, Microsoft ofrece un motor de base datos
único que escala desde una computadora portátil que ejecuta Windows® 95 o
Windows 98, hasta clusters de procesadores múltiples simétricos de terabyte que
ejecutan Windows NT Server Enterprise Edition. Todos estos sistemas mantienen
la seguridad y confiabilidad que exigen los sistemas de negocios de misión crítica.
Nueva para el lanzamiento de 7.0 es una versión de rastro de baja memoria con
capacidades de replicación de multi-sitio. Se ajusta muy bien a las necesidades
cada vez mayores del mercado de la computación móvil. Las otras características
tales como bloqueo a nivel de línea dinámico, el paralelismo intra-query, query
distribuido, y mejoras para las bases de datos muy grandes (VLDB) hacen que el
SQL Server 7.0 sea la elección ideal para sistemas OLTP de alta tecnología y
sistemas de data warehousing.
Mientras los sistemas de procesamiento siguen siendo un componente clave para
las infraestructuras de bases de datos corporativas, las compañías también están
invirtiendo bastante en mejorar la comprensión que tienen de sus datos. La
estrategia de Microsoft consiste en reducir el costo y la complejidad del data
9
24. warehousing mientras hace que la tecnología sea más accesible a una mayor
cantidad de público.
Microsoft ha establecido un enfoque total a todo el proceso de data warehousing
(almacenamiento de datos). El objetivo es facilitar la construcción y diseño de
soluciones de data warehousing costo efectivas a través de una combinación de
tecnologías, servicios y alianzas con los proveedores.
La Microsoft Alliance for Data Warehousing es una coalición que une a los
líderes en la industria de almacenamiento de datos y aplicaciones. El Microsoft
Data Warehousing Framework constituye un conjunto de interfaces de
programación diseñadas para simplificar la integración y administración de
soluciones de data warehousing.
Las innovaciones del producto en SQL Server 7.0 mejoran el proceso de data
warehousing: Servicios de Transformación de Datos; manejo mejorado de las
consultas complejas y bases de datos muy grandes; procesamiento analítico en
línea e integrado; y el Microsoft Repository. Otro componente esencial es el
soporte extenso para integración de terceros.
10
25. 2.1.3 Visual Basic
3
Este lenguaje de programación es desarrollado por Alan Cooper para Microsoft.
El lenguaje de programación es un dialecto de BASIC, con importantes añadidos.
Su primera versión fue presentada en 1991 con la intención de simplificar la
programación utilizando un ambiente de desarrollo completamente gráfico que
facilitara la creación de interfaces gráficas y en cierta medida también la
programación misma. Desde el 2001 Microsoft ha propuesto abandonar el
desarrollo basado en la API Win32 y pasar a trabajar sobre un framework o marco
común de librerías independiente de la version del sistema operativo, .NET
Framework, a través de Visual Basic .NET (y otros lenguajes como C Sharp (C#)
de fácil transición de código entre ellos) que presenta serias incompatibilidades
con el código Visual Basic existente.
Visual Basic constituye un IDE (entorno de desarrollo integrado o en inglés
Integrated Development Enviroment) que ha sido empaquetado como un
programa de aplicación, es decir, consiste en un editor de código (programa donde
3
http://es. wikipedia.org/wiki/Visual_Basic
11
26. se escribe el código fuente), un depurador (programa que corrige errores en el
código fuente para que pueda ser bien compilado), un compilador (programa que
traduce el código fuente a lenguaje de máquina), y un constructor de interfaz
gráfica o GUI (es una forma de programar en la que no es necesario escribir el
código para la parte gráfica del programa, sino que se puede hacer de forma
visual).
12
27. CAPITULO III
3. Diseño Metodológico.
Para realizar la investigación se consideraron los siguientes aspectos: Metodología
y Técnicas
3.1 Metodología.
La metodología que se aplicará son dos, de campo y el bibliográfico.
Campo.- son un conjunto de métodos, técnicas y procedimientos sistemáticos
que se utilizarán para obtener respuestas al problema planteado.
Bibliográfico.- esta es de tipo bibliográfico por cuánto el desarrollo de la
investigación se apoya en información de libros, Internet y en folletos, etc.
3.2 Técnicas.
Se aplicó la siguiente técnica:
Técnicas de entrevista.- Permitirá recopilar información en forma verbal, a
través de preguntas previamente elaboradas. Se entrevistarán de forma
individual al personal de la Escuela Fiscal “21 de Mayo”, quienes serán los
principales beneficiados del proyecto.
13
28. 3.3 Resultados Obtenidos
Con el desarrollo del sistema informático para la Escuela “21 de Mayo” se
logró solucionar las dificultades que se originaban al momento de realizar
los procesos de matriculación, reporte de notas y asistencia del personal.
El sistema desarrollado permite un manejo fácil y eficiente del control de
asistencia del personal, así como también datos de los alumnos de la
Escuela.
Se logro realizar un sistema cuyos resultados obtenidos sean fiables al
momento de generar reportes de matriculas, notas, asistencias, entre otros.
Proporcionar a través del sistema el acceso a una información ordenada y
actualizada del proceso administrativo de la institución
14
29. 3.3 Presupuesto.
Costo Sub.
Nro Descripción Cantidad
Unitario Total
1 Material de escritorio y oficina 1 30.00 $ 30.00
2 Copias 2334 0.03 $ 70.00
3 Transporte 1 30.00 $ 30.00
4 Tinta para impresora 3 25.00 $ 75.00
5 Impresión 1 65.00 $ 65.00
6 Empastadas de Tesis 9 7.00 $ 63.00
7 Alquiler de Internet y Computadora 1 60.00 $ 60.00
8 Material bibliográfico 1 50.00 $ 50.00
9 Remas de Hojas 7 4.00 $ 28.00
SUMAN $ 471.00
IMPREVISTOS 10% $ 47.10
TOTAL $ 518.10
SON: QUINIENTOS DIECIOCHO 10/100 DOLARES.
15
30. CAPITULO IV
4.1 CONCLUSIONES Y RECOMENDACIONES
4.1.1 CONCLUSIONES
Después de concluir con nuestro proyecto “DESARROLLO DE UN SISTEMA
INFORMATICO ADMINISTRATIVO PARA LA ESCUELA FISCAL
MIXTA 21 DE MAYO DEL CANTÓN PORTOVIEJO, PROVINCIA DE
MANABÍ”, se llegó a las siguientes conclusiones:
Se logró cumplir con el desarrollo de un sistema que permita optimizar el
trabajo de matriculación, reporte de notas, asistencia del personal docente
y demás procesos que se realizan en la Escuela.
El sistema cuenta con varias funcionabilidades que facilitan al usuario la
comprensión y manejo del mismo.
El desarrollo del sistema cuenta con un manual de usuario que tiene la
documentación necesaria que servirá a la persona encargada de
administrar el sistema.
16
31. 4.1.2 RECOMENDACIONES
Para la debida utilización del sistema es recomendable tener en cuenta las
siguientes recomendaciones:
Que el Administrador de sistema tenga conocimientos básicos en
Informática y una previa capacitación a la utilización del mismo.
Para cualquier ayuda utilizar el manual de usuario.
El administrador debe ser el único responsable de la información que se
ingresa al sistema para que no hayan confusiones.
Para que la implementación del sistema sea efectiva es recomendable que
la información se maneje con gran seguridad.
17
32. CAPITULO V
5. PROPUESTA
5.1. DESCRIPCION GENERAL DEL SISTEMA
El programa llamado Ejecutable.exe es un sistema informático que sirve para
llevar registros de matriculación, reporte de notas y asistencia del personal
docente de la Escuela Fiscal Mixta “21 de Mayo” de la ciudad de Portoviejo
Provincia de Manabí.
El presente sistema informático lo conforman los siguientes módulos:
Formularios de Matriculación: Este modulo nos permite registrar los datos
del estudiante, representante y matriculas que hubiesen en ese periodo.
Formularios de Ingresos de Notas: Nos permite ingresar notas y tener un
reporte confiable de las mismas.
Formularios de Control de Asistencia del Docente: Permite llevar el
control diario de asistencia del docente.
5.2. DETERMINACION DE REQUERIMIENTO
Se requiere de un sistema informático basado en computadoras, para ingresar
matriculas, reporte de notas y asistencia del personal docente para la Escuela
Fiscal Mixta “21 de Mayo” de la ciudad de Portoviejo Provincia de Manabí.
Los principales requerimientos del equipo de computación que se necesitan para
un óptimo funcionamiento son:
Marca Mainborad: Intel
Tipo de Procesador: Dual Core de 2.0 GHz o Superior
Tamaño de Disco Duro: 160 GB de Espacio Inicial o Superior
Memoria RAM: 1 GB o Superior
Monitor: VGA o SVGA
Unidad de CD: DVD-Rom
Impresora: Opcional
18
35. SISTEMA
Matriculación Notas Asistencias Configuración
Registros Registros Registros Registros
Estudiantes Notas de Estudiante Asistencias de Periodos
Profesores Lectivos
Representantes Informes Grados
Informes
Matricula Informe de Notas x Materias
Alumno Resumido Informe de Asistencias
Informes Paralelos
de Profesores
Informe de Notas x Profesores
Informe De
Alumno
Alumnos
Matriculados Parciales
Informe de Notas x
Trimestre Resumido Paralelos
Informe de Notas x Profesores
Trimestre
Usuarios
Informe Resumido de
notas x Materias y Establecer Periodo Activo
trimestres
Bloquear
Establecer Configuraciones
Establecer materias a Profesor
Establecer Permisos de 21
Usuarios
36. 5.5 Bibliografía.
BATINI, CERI Y NAVATHE. Diseño Conceptual de Bases de Datos.
Adisson – Wesley. 1994.
Internet de la página www.Google.com
MICROSOFT PRESS. "Manual de Programador Visual Basic
6.0" EDITORIAL MC. Graw-Hill. 2003.
MSDN. MICROSOFT "Ayuda de Visual Basic 6.0". Microsoft Coorpor.
2003.
TIZNADO Santana Marco Antonio. Visual Basic. McGraww-Hill. 1997.
VAQUERO, Antonio. Microsoft Visual BASIC 6.0. Referencias de
Controles. Primera Edición McGraw Hill. España. 1993.
21
15
39. ÍNDICE
PÁG.
1. CODIFICACIÓN DEL PROGRAMA 1
1.1 FORMULARIO DE ESTUDIANTE 1
1.2 FORMULARIO PRINCIPAL 2
1.3 FORMULARIO REGISTRO DE ESTUDIANTES 4
1.5 FORMULARIO REGISTRO SISTENCIAS DE PROFESORES 12
1.6 FORMULARIO BLOQUEO DE SISTEMA 22
1.7 FORMULARIO DE CONF. DE MATERIAS A GRADO 23
1.8 FORMULARIO DE REGISTRO DE MATERIAS 25
1.9 FORMULARIOS CONFIGURACION MATERIAS PROFESOR 27
1.10 FORMULARIOS REGISTRO DE MATRICULAS 40
1.11 FORMULARIO REGISTRO DE GRADOS 49
1.12 FORMULARIO REGISTRO DE NOTAS 51
1.13 FORMULARIO INFORME DE NOTAS RESUMIDO X
MATERIAS Y TRIMESTRES 70
1.14 FORMULARIO REGISTRO DE PARALELOS 78
1.15 FORMULARIO REGISTRO DE TRIMESTRES O PARCIALES 83
1.16 FORMULARIO ESTABLCER PERIODO ACTIVO 85
1.17 FORMULARIO REGISTRO DE PERIODOS 85
1.18 FORMULARIO PERMISOS DE USUARIOS 88
1.19 FORMULARIO REGISTRO DE PROFESORES 89
1.20 FORMULARIO INFORME ASISTENCIAS DE PROFESORES 91
1.21 FORMULARIO INFORME DE NOTAS X TRIMESTRE 94
1.22 FORMULARIO INFORME AUMNOS MATRICULADOS 96
1.23 FORMULARIO INFORME DE NOTAS X ALUMNO RESUMIDO 99
1.24 FORMULARIO INFORME DE NOTAS DE ALUMNOS X 101
TRIMESTRE
1.25 FORMULARIO INFORME DE NOTAS X TRIMESTRE 104
RESUMIDO
1.26 FORMULARIO INFORME DE NOTAS X TRIMESTRE 107
1.27 FORMULARIO REGISTRO DE REPRESENTANTES 109
1.28 FORMULARIO REGISTRO DE USUARIOS 112
1.29 FORMULARIO ESTABLECER CONFIGURACIONES 114
1.30 FORMULARIO DE BUSQUEDA 117
1.31 VARIABLE GLOBALES 121
1.32 FUNCIONES GLOBALES 123
40. 1. CODIFICACION DEL PROGRAMA
1.1 FORMULARIO DE INGRESO AL SISTEMA
Dim aux As Boolean
Private Sub cmb_usuarios_Click()
Cod_usuario = ExtraeIDCombo(cmb_usuarios)
End Sub
Private Sub cmdCancel_Click()
If base.State = 1 Then
base.Close
End If
End
End Sub
Private Sub cmdOK_Click()
Dim STRSQL As String
If cmb_usuarios.ListIndex = -1 Then Exit Sub
STRSQL = "SELECT COUNT(*) as total FROM USUARIOS WHERE
codigo='" & ExtraeIDCombo(cmb_usuarios) & "' and upper(clave) = '" &
UCase(txt_clave.TEXT) & "'"
Set tabla = base.Execute(STRSQL)
If tabla.Fields(0).Value > 0 Then
aux = True
tabla.Close
Set tabla = Nothing
Load MDIForm1
MDIForm1.Show
frm_fondo.Show
Unload Me
Exit Sub
End If
txt_clave.TEXT = ""
MsgBox ("datos Incorrectos")
tabla.Close
Set tabla = Nothing
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Form_Load()
'cod_usu = Leer_Ini(ruta_ini, "usuario", "")
aux = False
LLENACOMBO cmb_usuarios, "select codigo,nombre from usuarios"
End Sub
Private Sub Form_Unload(Cancel As Integer)
If base.State = 1 And aux = False Then
1
41. base.Close
End If
End Sub
1.2 FORMULARIO PRINCIPAL
Private Sub m_a_i_inf_asis_alumno_Click()
abrir_form form_rep_asistencias_alumno, "form_rep_asistencias_alumno"
End Sub
Private Sub m_a_i_inf_asis_profe_Click()
abrir_form form_rep_asistencias_profesores, "form_rep_asistencias_profesores"
End Sub
Private Sub m_a_r_asis_estudiante_Click()
abrir_form Form_asistencias_alumnos, "Form_asistencias_alumnos"
End Sub
Private Sub m_a_r_asis_profesores_Click()
abrir_form Form_asistencias_profesores, "Form_asistencias_profesores"
End Sub
Private Sub m_bloquear_Click()
Load form_Login2
form_Login2.Show vbModal
End Sub
Private Sub m_c_config_Click()
abrir_form frm_config, "frm_config"
End Sub
Private Sub m_c_mater_grados_Click()
abrir_form form_materia_grado, "form_materia_grado"
End Sub
Private Sub m_c_materia_profe_Click()
abrir_form Form_materias_profe, "Form_materias_profe"
End Sub
Private Sub m_c_periodoactivo_Click()
abrir_form form_periodo_activo, "form_periodo_activo"
End Sub
Private Sub m_c_r_areas_Click()
abrir_form form_permisos2, "form_permisos2"
End Sub
Private Sub m_c_r_materias_Click()
abrir_form Form_materias, "Form_materias"
End Sub
Private Sub m_c_r_niveles_Click()
abrir_form Form_niveles, "Form_niveles"
End Sub
Private Sub m_c_r_paralelos_Click()
abrir_form Form_paralelos, "Form_paralelos"
2
42. End Sub
Private Sub m_c_r_parciales_Click()
abrir_form Form_parciales, "Form_parciales"
End Sub
Private Sub m_c_r_periodos_Click()
abrir_form Form_periodos, "Form_periodos"
End Sub
Private Sub m_c_r_profesores_Click()
abrir_form Form_profesores, "Form_profesores"
End Sub
Private Sub m_c_r_uauarios_Click()
abrir_form Form_Usuarios, "Form_Usuarios"
End Sub
Private Sub m_m_i_inf_matri_Click()
abrir_form form_rep_estudiantes_matriculados,
"form_rep_estudiantes_matriculados"
End Sub
Private Sub m_m_r_estudiantes_Click()
abrir_form Form_estudiante, "Form_estudiante"
End Sub
Private Sub m_m_r_matricual_otros_Click()
abrir_form Form_matricula2, "Form_matricula2"
End Sub
Private Sub m_m_r_matricula_Click()
abrir_form Form_matricula, "Form_matricula"
End Sub
Private Sub m_m_r_representantes_Click()
abrir_form Form_representante, "Form_representante"
End Sub
Private Sub m_n_i_inf_concentrado_Click()
abrir_form form_rep_notas_concentrado, "form_rep_notas_concentrado"
End Sub
Private Sub m_n_i_inf_notas_x_estudiante_Click()
abrir_form form_rep_notas_alumno_x_trimestre,
"form_rep_notas_alumno_x_trimestre"
End Sub
Private Sub m_n_i_inf_notas_x_materias_trimestre_Click()
abrir_form Form_notas_materias, "Form_notas_materias"
End Sub
Private Sub m_n_i_inf_notas_x_trimestre_Click()
abrir_form form_rep_notas_x_trimestre, "form_rep_notas_x_trimestre"
End Sub
Private Sub m_n_i_notas_estu_concentrado_Click()
abrir_form form_rep_notas_alumno_concentrado,
"form_rep_notas_alumno_concentrado"
End Sub
Private Sub m_n_notas_estudiante_Click()
abrir_form Form_notas, "Form_notas"
3
43. End Sub
Private Sub m_salir_Click()
Unload Me
End Sub
Private Sub MDIForm_Load()
'Set apli = New Application
Crae_aplicacion_excel
NOMBRE_ESCUELA = Extrae_config("8")
Set tabla = base.Execute("SELECT NOMBRE FROM PERIODO WHERE
CODIGO='" & Gperiodo & "'")
If tabla.EOF = False Then
NOMBRE_PERIODO = tabla.Fields(0).Value
End If
tabla.Close
Set tabla = Nothing
Me.Caption = "Systema de Control Escolar - " & NOMBRE_PERIODO
End Sub
Private Sub Crae_aplicacion_excel()
Set Apli = New Excel.Application
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
If base.State = 1 Then
base.Close
End If
Shell "TASKKILL /F /IM EXCEL.exe", vbMinimizedNoFocus
End Sub
1.3 FORMULARIO REGISTRO DE ESTUDIANTES
Dim strtabla As String
Dim camposKP As String
Dim nuevo_reg As String
Dim reg_actual As String
Dim filtro As String
Dim opcion_foto As String
Option Explicit
Dim DataFile As Integer
Dim Chunk() As Byte
Const conChunkSize As Integer = 16384
Dim ar As Field
Dim accion As String
Public Sub Set_Accion(valor As String)
accion = valor
End Sub
4
44. Public Function Get_Accion() As String
Get_Accion = accion
End Function
Public Function Get_filtro() As String
Get_filtro = filtro
End Function
Public Function Get_nuevo() As String
Get_nuevo = nuevo_reg
End Function
Public Sub Set_Reg_actual(valor As String)
reg_actual = valor
End Sub
Public Function Get_tabla() As String
Get_tabla = strtabla
End Function
Public Function Get_camposPK() As String
Get_camposPK = camposKP
End Function
Public Sub SALIR()
Unload Me
End Sub
Private Sub cmd_anterior_Click()
LLenaDatosForm 3
End Sub
Private Sub cmd_busca_madre_Click()
On Error GoTo SALIR
Busqueda_sql "SELECT codigo,nombre,cedula,direccion FROM representante
where sexo='2'"
Busqueda_where " and codigo+NOMBRE+cedula "
Busqueda_orden "2"
Busqueda_Ncampos 4
Busqueda_campos 0, "Codigo", 5
Busqueda_campos 1, "Nombre", 40
Busqueda_campos 2, "Cedula", 20
Busqueda_campos 3, "Direccion", 60
Busqueda_indice 0
Busqueda.boton = True
Load frmbusqueda
frmbusqueda.Show vbModal
If Busqueda.retorna <> "" Then
If Busqueda.retorna <> "Abrir" Then txt_madre.TEXT = Busqueda.retorna
If Busqueda.retorna = "Abrir" Then
Load Form_representante
Form_representante.Show
End If
5
45. End If
Exit Sub
SALIR:
End Sub
Private Sub cmd_busca_padre_Click()
On Error GoTo SALIR
Busqueda_sql "SELECT codigo,nombre,Cedula,direccion FROM representante
where sexo='1'"
Busqueda_where " and codigo+NOMBRE+cedula "
Busqueda_orden "2"
Busqueda_Ncampos 4
Busqueda_campos 0, "Codigo", 5
Busqueda_campos 1, "Nombre", 40
Busqueda_campos 2, "Cedula", 20
Busqueda_campos 3, "Direccion", 60
Busqueda_indice 0
Busqueda.boton = True
Load frmbusqueda
frmbusqueda.Show vbModal
If Busqueda.retorna <> "" Then
If Busqueda.retorna <> "Abrir" Then
txt_padre.TEXT = Busqueda.retorna
End If
If Busqueda.retorna = "Abrir" Then
Load Form_representante
Form_representante.Show
End If
End If
Exit Sub
SALIR:
End Sub
Private Sub cmd_busca_repre_Click()
On Error GoTo SALIR
Busqueda_sql "SELECT codigo,nombre,cedula,direccion FROM representante "
Busqueda_where "Where codigo+NOMBRE+cedula "
Busqueda_orden "2"
Busqueda_Ncampos 4
Busqueda_campos 0, "Codigo", 5
Busqueda_campos 1, "Nombre", 40
Busqueda_campos 2, "Cedula", 20
Busqueda_campos 3, "Direccion", 60
Busqueda_indice 0
Busqueda.boton = True
Load frmbusqueda
frmbusqueda.Show vbModal
6
46. If Busqueda.retorna <> "" Then
If Busqueda.retorna <> "Abrir" Then txt_repre.TEXT = Busqueda.retorna
If Busqueda.retorna = "Abrir" Then
Load Form_representante
Form_representante.Show
End If
End If
Exit Sub
SALIR:
End Sub
Private Sub cmd_buscar_Click()
On Error GoTo SALIR
Busqueda_sql "SELECT codigo,NOMBREs,telefono,direccion FROM estudiante
"
Busqueda_where " WHERE codigo+NOMBREs "
Busqueda_orden "2"
Busqueda_Ncampos 4
Busqueda_campos 0, "Codigo", 5
Busqueda_campos 1, "Nombre", 40
Busqueda_campos 2, "Telefono", 15
Busqueda_campos 3, "Direccion", 40
Busqueda_indice 0
Load frmbusqueda
frmbusqueda.Show vbModal
If Busqueda.retorna <> "" Then
LLenaDatosForm 0, Busqueda.retorna
End If
Exit Sub
SALIR:
ERRORES
End Sub
Private Sub cmd_cancelar_Click()
Cancelar
End Sub
Private Sub cmd_eliminar_Click()
Elimna_reg
End Sub
Private Sub cmd_guarda_img_Click()
Dim SQL12 As String
Dim cade As String
Guardar
cade = Verificar
If cade <> "" Then Exit Sub
If opcion_foto = "0" Then
7
47. SQL12 = "select * from imagenes where estudiante='" & eti_codigo.Caption &
"' and periodo='" & Gperiodo & "'"
Else
SQL12 = "select * from imagenes where estudiante='" & eti_codigo.Caption &
"'"
End If
Set tabla_aux = base.Execute(SQL12)
If tabla_aux.EOF = True Then
SQL12 = "INSERT INTO IMAGENES(ESTUDIANTE,periodo) VALUES('"
& eti_codigo.Caption & "','" & Gperiodo & "' )"
base.Execute (SQL12)
End If
tabla_aux.Close
Set tabla_aux = Nothing
If opcion_foto = "0" Then
SQL12 = "select foto from imagenes where estudiante='" & eti_codigo.Caption
& "' and periodo='" & Gperiodo & "'"
Else
SQL12 = "select foto from imagenes where estudiante='" & eti_codigo.Caption
& "'"
End If
tabla_aux.Open SQL12, base, adOpenDynamic, adLockOptimistic
GuardarBinary tabla_aux, foto, 0
tabla_aux.update
tabla_aux.Close
Set tabla_aux = Nothing
End Sub
Private Sub cmd_guardar_Click()
Guardar
End Sub
Private Sub cmd_img_Click()
On Error Resume Next
If eti_codigo.Caption = "" Then Exit Sub
cdl.CancelError = True
cdl.Filter = "imagenes de mapa de Bit *.bmp|*.bmp|imagenes *.jpg|*.jpg"
'cdl.FileName = "NOTAS " & cmb_materia.Text & " " &
ExtraeIDCombo(cmb_grado) & cmb_paralelo.Text & " " &
ExtraeIDCombo(cmb_parcial) & "º TRIMESTRE"
cdl.ShowOpen
txt_foto.TEXT = cdl.FileTitle
foto.Picture = LoadPicture(cdl.FileName)
End Sub
Private Sub cmd_nuevo_Click()
8
48. Nuevo
End Sub
Private Sub cmd_primero_Click()
LLenaDatosForm 1
End Sub
Private Sub cmd_salir_Click()
SALIR
End Sub
Private Sub cmd_siguiente_Click()
LLenaDatosForm 4
End Sub
Private Sub cmd_ultimo_Click()
LLenaDatosForm 2
End Sub
Private Sub eti_codigo_Change()
Dim SQL12 As String
If eti_codigo.Caption <> "" Then
If opcion_foto = "0" Then
SQL12 = "SELECT top 1 FOTO FROM IMAGENES WHERE
ESTUDIANTE='" & eti_codigo.Caption & "' and periodo='" & Gperiodo & "'"
Else
SQL12 = "SELECT top 1 FOTO FROM IMAGENES WHERE
ESTUDIANTE='" & eti_codigo.Caption & "'"
End If
Set tabla_aux = base.Execute(SQL12)
If tabla_aux.EOF = False Then
LeerBinary tabla_aux, foto, 0
tabla_aux.MoveNext
Else
Set foto.Picture = Nothing
End If
tabla_aux.Close
Set tabla_aux = Nothing
Else
Set foto.Picture = Nothing
End If
End Sub
Private Sub Form_Activate()
Set FRM = Me
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys vbTab
End Sub
Private Sub Form_Load()
9
49. Dim ruta As String
ruta = App.Path & "iconoslisto.gif"
img_listo.Picture = LoadPicture(ruta)
filtro = ""
opcion_foto = Extrae_config("17")
strtabla = "estudiante"
camposKP = "|codigo|"
nuevo_reg = "codigo"
LLENACOMBO cmb_sexo, "select codigo,nombre from tsexo"
Set FRM = Me
LLenaDatosForm
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = SoloNombre(KeyAscii)
End Sub
Private Sub Text2_Change()
If Cedula(Text2) = False Then
img_listo.Visible = False
Else
img_listo.Visible = True
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
KeyAscii = SoloCedula(KeyAscii)
End Sub
Private Sub txt_foto_Change()
Dim SQL12 As String
If eti_codigo.Caption <> "" Then
If opcion_foto = "0" Then
SQL12 = "SELECT top 1 FOTO FROM IMAGENES WHERE
ESTUDIANTE='" & eti_codigo.Caption & "' and periodo='" & Gperiodo & "'"
Else
SQL12 = "SELECT top 1 FOTO FROM IMAGENES WHERE
ESTUDIANTE='" & eti_codigo.Caption & "'"
End If
Set tabla_aux = base.Execute(SQL12)
If tabla_aux.EOF = False Then
LeerBinary tabla_aux, foto, 0
tabla_aux.MoveNext
Else
Set foto.Picture = Nothing
End If
tabla_aux.Close
Set tabla_aux = Nothing
Else
Set foto.Picture = Nothing
10
50. End If
End Sub
Private Sub txt_madre_Change()
Dim SQL12 As String
SQL12 = "select nombre from representante where codigo='" & txt_madre.TEXT
& "' "
Set tabla_aux = base.Execute(SQL12)
If tabla_aux.EOF = False Then
eti_madre.Caption = tabla_aux.Fields(0).Value
Else
eti_madre.Caption = ""
End If
tabla_aux.Close
Set tabla_aux = Nothing
End Sub
Private Sub txt_padre_Change()
Dim SQL12 As String
SQL12 = "select nombre from representante where codigo='" & txt_padre.TEXT
& "' "
Set tabla_aux = base.Execute(SQL12)
If tabla_aux.EOF = False Then
eti_padre.Caption = tabla_aux.Fields(0).Value
Else
eti_padre.Caption = ""
End If
tabla_aux.Close
Set tabla_aux = Nothing
End Sub
Private Sub txt_repre_Change()
Dim SQL12 As String
SQL12 = "select nombre from representante where codigo='" & txt_repre.TEXT
& "' "
Set tabla_aux = base.Execute(SQL12)
If tabla_aux.EOF = False Then
eti_repre.Caption = tabla_aux.Fields(0).Value
Else
eti_repre.Caption = ""
End If
tabla_aux.Close
Set tabla_aux = Nothing
End Sub
Private Sub txtdireccion_KeyPress(KeyAscii As Integer)
KeyAscii = SoloTexto(KeyAscii)
End Sub
11
51. Private Sub txtnombres_KeyPress(KeyAscii As Integer)
KeyAscii = SoloNombre(KeyAscii)
End Sub
Private Sub txttelefono_KeyPress(KeyAscii As Integer)
KeyAscii = SoloNumero(KeyAscii)
End Sub
1.5 FORMULARIO REGISTRO SISTENCIAS DE PROFESORES
Dim d_grid(100) As DATOS_GRID
Dim Libro As Excel.Workbook
Dim strtabla As String
Dim HOJA As Excel.Worksheet
Dim a_col As Integer
Dim a_fil As Integer
Private Sub CARGA_GRID(nombre As String, FILA As Integer, valor As
Variant)
Dim I As Integer
For I = 0 To GRID.Cols - 1
If UCase(d_grid(I).campo_col) = UCase(nombre) Then
GRID.TextMatrix(FILA, d_grid(I).n_col) = valor
If d_grid(I).revisar = True Then
GRID.Row = FILA
GRID.col = col_nombre(d_grid(I).cabecera_col)
If valor = "S" Then
Set GRID.CellPicture = LoadPicture(App.Path &
"iconoschksi.bmp")
Else
Set GRID.CellPicture = LoadPicture(App.Path &
"iconoschkno.bmp")
End If
GRID.CellPictureAlignment = 3
End If
End If
Next
End Sub
Private Sub LIMPIA_GRID()
Dim I, c As Integer
GRID.Rows = 2
For c = 0 To GRID.Cols - 1
GRID.TextMatrix(1, c) = ""
Next
End Sub
Private Function col_nombre(nombre As String) As Integer
Dim I As Integer
12
52. For I = 0 To GRID.Cols - 1
If UCase(d_grid(I).campo_col) = UCase(nombre) Then
col_nombre = d_grid(I).n_col
Exit Function
End If
Next
End Function
Private Function row_valor(valor As String, c As Integer) As Integer
Dim I As Integer
For I = 0 To GRID.Rows - 1
If GRID.TextMatrix(I, c) = UCase(valor) Then
row_valor = I
Exit Function
End If
Next
End Function
Private Function EXITE_ASISTENCIA(FILA As Integer) As Boolean
Dim SQL1, strand As String
strand = " "
EXITE_ASISTENCIA = False
SQL1 = "select count(*) as UNOS from " & strtabla & " where "
For I = 0 To GRID.Cols - 1
If d_grid(I).clave = True Then
SQL1 = SQL1 & strand & d_grid(I).campo_col & " = '" &
GRID.TextMatrix(FILA, d_grid(I).n_col) & "'"
strand = " AND "
End If
Next
Set tabla = base.Execute(SQL1)
If tabla.Fields(0).Value <> 0 Then
EXITE_ASISTENCIA = True
End If
tabla.Close
Set tabla = Nothing
End Function
Private Function genera_INSERT(FILA As Integer) As String
Dim SQL1, SQL2, strCOMA As String
strCOMA = " "
SQL1 = "INSERT INTO " & strtabla & "("
SQL2 = " VALUES ("
For I = 0 To GRID.Cols - 1
If d_grid(I).insertable = True Then
SQL1 = SQL1 & strCOMA & d_grid(I).campo_col
SQL2 = SQL2 & strCOMA & "'" & GRID.TextMatrix(FILA,
d_grid(I).n_col) & "'"
strCOMA = ","
End If
13
53. Next
SQL1 = SQL1 & ") "
SQL2 = SQL2 & ") "
SQL1 = SQL1 & SQL2
genera_INSERT = SQL1
End Function
Private Function genera_UPDATE(FILA As Integer) As String
Dim SQL1, SQL2, strCOMA, strand As String
strCOMA = " "
strand = " "
SQL1 = "UPDATE " & strtabla & " set "
SQL2 = " WHERE "
For I = 0 To GRID.Cols - 1
If d_grid(I).insertable = True And d_grid(I).clave = False Then
SQL1 = SQL1 & strCOMA & d_grid(I).campo_col & "='" &
GRID.TextMatrix(FILA, d_grid(I).n_col) & "'"
strCOMA = ","
End If
If d_grid(I).clave = True Then
SQL2 = SQL2 & strand & d_grid(I).campo_col & " = '" &
GRID.TextMatrix(FILA, d_grid(I).n_col) & "'"
strand = " AND "
End If
Next
SQL1 = SQL1 & " "
SQL2 = SQL2 & " "
SQL1 = SQL1 & SQL2
genera_UPDATE = SQL1
End Function
Private Sub cmd_entrada_Click()
GRID.TextMatrix(a_fil, col_nombre("hora_e")) = lbl_hora.Caption
cmd_entrada.Enabled = False
End Sub
Private Sub cmd_guardar_Click()
Dim SQL1, SQL2, SQL3 As String
Dim FILA, I As Integer
If GRID.TextMatrix(1, col_nombre("periodo")) <> "" And GRID.TextMatrix(1,
col_nombre("profesor")) <> "" And GRID.TextMatrix(1, col_nombre("fecha"))
<> "" Then
If EXITE_ASISTENCIA(1) = True Then
If Permiso("M", Me.Name) = False Then Exit Sub
End If
End If
For I = 1 To GRID.Rows - 1
14
54. If GRID.TextMatrix(I, col_nombre("periodo")) <> "" And GRID.TextMatrix(I,
col_nombre("profesor")) <> "" And GRID.TextMatrix(I, col_nombre("fecha"))
<> "" Then
If EXITE_ASISTENCIA(I) = True Then
SQL1 = genera_UPDATE(I)
Else
SQL1 = genera_INSERT(I)
End If
base.Execute (SQL1)
End If
Next
End Sub
Private Sub cmd_procesar_Click()
procesar
End Sub
Private Sub procesar()
Dim SQL1, SQL2 As String
Dim FILA As Integer
txt.Visible = False
LIMPIA_GRID
'If cmb_grado.ListIndex = -1 Or cmb_paralelo.ListIndex = -1 Then Exit Sub
'SQL1 = "select P.codigo as profesor,P.nombre,A.periodo as periodo,A.fecha as
fecha,isnull(A.estado,'S') as estado,isnull(A.justificada,'N') as
justificada,isnull(A.atraso,'N')as atraso,isnull(A.observacion,'') as
observacion,isnull(A.hora_e,'00:00:00') as hora_e,isnull(A.hora_s,'00:00:00') as
hora_s from profesor P left outer join asistencias_P A on P.codigo=A.profesor
where A.fecha='" & dtp_fecha.Value & "' and A.periodo='" & Gperiodo & "'
order by P.nombre"
SQL1 = "select p.codigo as profesor,p.nombre,periodo='" & Gperiodo &
"',fecha='" & dtp_fecha.Value & "',estado=isnull((select estado from asistencias_p
where profesor=p.codigo and periodo='" & Gperiodo & "' and fecha='" &
dtp_fecha.Value & "'),'S'),justificada=isnull((select justificada from asistencias_p
where profesor=p.codigo and periodo='" & Gperiodo & "' and fecha='" &
dtp_fecha.Value & "'),'N'),atraso=isnull((select atraso from asistencias_p where
profesor=p.codigo and periodo='" & Gperiodo & "' and fecha='" &
dtp_fecha.Value & "'),'N') "
SQL1 = SQL1 & ",observacion=isnull((select observacion from asistencias_p
where profesor=p.codigo and periodo='" & Gperiodo & "' and fecha='" &
dtp_fecha.Value & "'),''),hora_e=isnull((select hora_e from asistencias_p where
profesor=p.codigo and periodo='" & Gperiodo & "' and fecha='" &
dtp_fecha.Value & "'),'00:00:00'),hora_s=isnull((select hora_s from asistencias_p
where profesor=p.codigo and periodo='" & Gperiodo & "' and fecha='" &
dtp_fecha.Value & "'),'00:00:00') from profesor P"
SQL2 = "select P.codigo as profesor,P.nombre,'" & Gperiodo & "' as periodo,'" &
dtp_fecha.Value & "' as fecha,'S' as estado,'N' as justificada,'N' as atraso,'' as
observacion,'00:00:00' as hora_e ,'00:00:00' as hora_s from profesor P order by
P.nombre"
15
55. Set tabla = base.Execute(SQL1)
If tabla.EOF = True Then
tabla.Close
Set tabla = Nothing
Set tabla = base.Execute(SQL2)
If tabla.EOF = True Then
tabla.Close
Set tabla = Nothing
MsgBox "No existen Estudiantes Matriculados", vbInformation, "SISTEMA"
Exit Sub
End If
End If
FILA = 1
Do Until tabla.EOF = True
For I = 0 To tabla.Fields.Count - 1
CARGA_GRID tabla.Fields.Item(I).Name, FILA, tabla.Fields(I).Value
Next
GRID.TextMatrix(FILA, col_nombre("N_lista")) = FILA
tabla.MoveNext
If tabla.EOF = False Then
FILA = FILA + 1
GRID.Rows = GRID.Rows + 1
End If
Loop
tabla.Close
Set tabla = Nothing
End Sub
Private Sub cmd_salida_Click()
GRID.TextMatrix(a_fil, col_nombre("hora_s")) = lbl_hora.Caption
cmd_salida.Enabled = False
End Sub
Private Sub cmd_salir_Click()
SALIR
End Sub
Public Sub SALIR()
Unload Me
End Sub
Private Sub dtp_Change()
On Error Resume Next
GRID.TextMatrix(a_fil, a_col) = dtp.Value
End Sub
16
56. Private Sub dtp_fecha_Change()
procesar
End Sub
Private Sub dtp_fecha_Click()
cmd_entrada.Enabled = False
cmd_salida.Enabled = False
procesar
End Sub
Private Sub Form_Load()
Me.Top = 0
Me.Left = 10
coloca_tolti Me
strtabla = "Asistencias_P"
DAT_grid
CONF_GRID
dtp_fecha.Value = Date
procesar
lbl_hora.Caption = Time
End Sub
Private Sub DAT_grid()
GRID.Cols = 14
d_grid(0).n_col = 0
d_grid(0).ancho_col = 0
d_grid(0).cabecera_col = ""
d_grid(0).campo_col = "periodo"
d_grid(0).campo_col2 = ""
d_grid(0).revisar = False
d_grid(0).clave = True
d_grid(0).insertable = True
d_grid(0).Obligatorio = False
d_grid(0).editable = False
d_grid(1).n_col = 1
d_grid(1).ancho_col = 0
d_grid(1).cabecera_col = ""
d_grid(1).campo_col = "profesor"
d_grid(1).campo_col2 = ""
d_grid(1).revisar = False
d_grid(1).clave = True
d_grid(1).insertable = True
d_grid(1).editable = False
d_grid(1).Obligatorio = False
d_grid(2).n_col = 2
d_grid(2).ancho_col = 0
d_grid(2).cabecera_col = ""
17
59. d_grid(11).Obligatorio = False
d_grid(12).n_col = 12
d_grid(12).ancho_col = 0
d_grid(12).cabecera_col = "justificada2"
d_grid(12).campo_col = "justificada"
d_grid(12).campo_col2 = ""
d_grid(12).revisar = True
d_grid(12).clave = False
d_grid(12).insertable = True
d_grid(12).editable = False
d_grid(12).Obligatorio = False
d_grid(13).n_col = 13
d_grid(13).ancho_col = 0
d_grid(13).cabecera_col = "atraso2"
d_grid(13).campo_col = "atraso"
d_grid(13).campo_col2 = ""
d_grid(13).revisar = True
d_grid(13).clave = False
d_grid(13).insertable = True
d_grid(13).editable = False
d_grid(13).Obligatorio = False
End Sub
Private Sub CONF_GRID()
Dim I As Integer
GRID.Rows = 2
For I = 0 To GRID.Cols - 1
GRID.ColWidth(I) = d_grid(I).ancho_col
GRID.TextMatrix(0, I) = d_grid(I).cabecera_col
Next
GRID.FixedCols = col_nombre("N_lista") + 1
End Sub
Private Sub GRID_Click()
Dim a_tex As String
txt.Visible = False
txt2.Visible = False
a_col = GRID.col
a_fil = GRID.Row
cmd_entrada.Enabled = False
cmd_salida.Enabled = False
If d_grid(GRID.col).editable = False Then
lbl_nombre.Caption = GRID.TextMatrix(a_fil, col_nombre("nombre"))
If GRID.TextMatrix(a_fil, col_nombre("hora_e")) = "00:00:00" Then
cmd_entrada.Enabled = True
ElseIf GRID.TextMatrix(a_fil, col_nombre("hora_s")) = "00:00:00" Then
cmd_salida.Enabled = True
End If
Else
20
60. a_col = GRID.col
a_fil = GRID.Row
If d_grid(GRID.col).revisar = False Then
a_tex = ""
txt.Visible = False
txt2.Visible = False
If d_grid(GRID.col).Obligatorio = False Then
txt.Top = GRID.Top + GRID.CellTop
txt.Left = GRID.Left + GRID.CellLeft
txt.Width = GRID.CellWidth - 10
txt.Height = GRID.CellHeight - 10
txt.TEXT = GRID.TextMatrix(a_fil, a_col)
txt.Visible = True
txt.SetFocus
txt.SelLength = Len(txt.TEXT)
End If
'Else
' txt2.Top = GRID.Top + GRID.CellTop
' txt2.Left = GRID.Left + GRID.CellLeft
' txt2.Width = GRID.CellWidth - 10
' txt2.Height = GRID.CellHeight - 10
' txt2.TEXT = GRID.TextMatrix(a_fil, a_col)
' txt2.Visible = True
' txt2.SetFocus
' txt2.SelLength = Len(txt.TEXT)
'End If
Else
If GRID.TextMatrix(a_fil, col_nombre(d_grid(GRID.col).campo_col2)) =
"S" Then
GRID.TextMatrix(a_fil, col_nombre(d_grid(GRID.col).campo_col2)) =
"N"
Set GRID.CellPicture = LoadPicture(App.Path & "iconoschkno.bmp")
Else
GRID.TextMatrix(a_fil, col_nombre(d_grid(GRID.col).campo_col2)) =
"S"
Set GRID.CellPicture = LoadPicture(App.Path & "iconoschksi.bmp")
End If
End If
End If
End Sub
Private Sub GRID_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeySpace Then
GRID_Click
End If
21
61. End Sub
Private Sub MaskEdBox1_Change()
End Sub
Private Sub Timer1_Timer()
lbl_hora.Caption = Time
End Sub
Private Sub txt_Change()
On Error Resume Next
GRID.TextMatrix(a_fil, a_col) = txt.TEXT
End Sub
Private Sub txt_KeyPress(KeyAscii As Integer)
KeyAscii = SoloTexto(KeyAscii)
End Sub
Private Sub txt2_Change()
On Error Resume Next
GRID.TextMatrix(a_fil, a_col) = txt2.TEXT
End Sub
Private Sub txt2_KeyPress(KeyAscii As Integer)
KeyAscii = SoloTexto(KeyAscii)
End Sub
1.6 FORMULARIO BLOQUEO DE SISTEMA
Private Sub cmb_usuarios_Click()
Cod_usuario = ExtraeIDCombo(cmb_usuarios)
End Sub
Private Sub cmdCancel_Click()
If base.State = 1 Then
base.Close
End If
End
End Sub
Private Sub cmdOK_Click()
Dim STRSQL As String
If cmb_usuarios.ListIndex = -1 Then Exit Sub
22
62. STRSQL = "SELECT COUNT(*) as total FROM USUARIOS WHERE
codigo='" & ExtraeIDCombo(cmb_usuarios) & "' and upper(clave) = '" &
UCase(txt_clave.TEXT) & "'"
Set tabla = base.Execute(STRSQL)
If tabla.Fields(0).Value > 0 Then
tabla.Close
Set tabla = Nothing
Unload Me
Exit Sub
End If
txt_clave.TEXT = ""
MsgBox ("datos Incorrectos")
tabla.Close
Set tabla = Nothing
End Sub
Private Sub Form_Load()
'cod_usu = Leer_Ini(ruta_ini, "usuario", "")
LLENACOMBO cmb_usuarios, "select codigo,nombre from usuarios"
End Sub
1.7 FORMULARIO DE CONFIGURACION DE MATERIAS A GRADO
Private Sub cmb_grado_Click()
If cmb_grado.ListIndex = -1 Then Exit Sub
LLENACOMBO List_materi_grado, "select codigo,nombre from materias where
CODIGO IN(SELECT MATERIA FROM MATERIA_GRADO WHERE
periodo='" & Gperiodo & "' and grado='" & ExtraeIDCombo(cmb_grado) & "')"
End Sub
Private Sub EjecutaSQL(cade As String)
On Error GoTo SALIR2
base.Execute (cade)
Exit Sub
SALIR2:
ERRORES
End Sub
Private Sub cmd_guardar_Click()
Dim SQL1 As String
Dim SQL2 As String
Dim MAX_COD As Integer
If cmb_grado.ListIndex = -1 Then Exit Sub
If list_aux.ListCount > 0 Then
For I = 0 To list_aux.ListCount - 1
list_aux.ListIndex = I
23
63. SQL1 = "DELETE FROM MATERIA_GRADO WHERE PERIODO='" &
Gperiodo & "' AND materia='" & ExtraeIDCombo(list_aux) & "' and grado='" &
ExtraeIDCombo(cmb_grado) & "'"
EjecutaSQL SQL1
Next
list_aux.Clear
End If
If List_materi_grado.ListCount > 0 Then
For I = 0 To List_materi_grado.ListCount - 1
List_materi_grado.ListIndex = I
SQL1 = "SELECT COUNT(*) AS UNOS FROM MATERIA_GRADO
WHERE PERIODO='" & Gperiodo & "' AND materia='" &
ExtraeIDCombo(List_materi_grado) & "' and grado='" &
ExtraeIDCombo(cmb_grado) & "'"
Set tabla = base.Execute(SQL1)
If tabla.Fields(0).Value = 0 Then 'NO EXISTE
SQL2 = "INSERT INTO
MATERIA_GRADO(PERIODO,GRADO,MATERIA) VALUES('" & Gperiodo
& "','" & ExtraeIDCombo(cmb_grado) & "','" &
ExtraeIDCombo(List_materi_grado) & "')"
EjecutaSQL SQL2
End If
tabla.Close
Set tabla = Nothing
Next
End If
End Sub
Private Sub cmd_pasauno_Click()
If cmb_grado.ListIndex = -1 Then Exit Sub
If list_materias.ListIndex = -1 Then Exit Sub
If EXISTE_ITEM(List_materi_grado, CLng(ExtraeIDCombo(list_materias))) =
True Then Exit Sub
List_materi_grado.AddItem list_materias.TEXT
List_materi_grado.ItemData(List_materi_grado.NewIndex) =
ExtraeIDCombo(list_materias)
'list_materias.RemoveItem (list_materias.ListIndex)
End Sub
Private Sub cmd_quitatodo_Click()
For I = 0 To List_materi_grado.ListCount - 1
List_materi_grado.ListIndex = I
list_aux.AddItem List_materi_grado.TEXT
list_aux.ItemData(list_aux.NewIndex) = ExtraeIDCombo(List_materi_grado)
Next
List_materi_grado.Clear
End Sub
24
64. Private Sub cmd_quitauno_Click()
If List_materi_grado.ListIndex = -1 Then Exit Sub
list_aux.AddItem List_materi_grado.TEXT
list_aux.ItemData(list_aux.NewIndex) = ExtraeIDCombo(List_materi_grado)
List_materi_grado.RemoveItem (List_materi_grado.ListIndex)
End Sub
Private Sub Form_Load()
Me.Top = 0
Me.Left = 10
coloca_tolti Me
LLENACOMBO cmb_grado, "select codigo,nombre from grados"
LLENACOMBO list_materias, "select codigo,nombre from materias" ' order by
nombre"
End Sub
Private Sub cmd_salir_Click()
SALIR
End Sub
Public Sub SALIR()
Unload Me
End Sub
Private Sub list_materias_Click()
list_materias.ToolTipText = ExtraeIDCombo(list_materias)
End Sub
1.8 FORMULARIO DE REGISTRO DE MATERIAS
Dim strtabla As String
Dim camposKP As String
Dim nuevo_reg As String
Dim reg_actual As String
Dim filtro As String
Dim retorna As String
Dim accion As String
Public Sub Set_Accion(valor As String)
accion = valor
End Sub
Public Function Get_Accion() As String
Get_Accion = accion
End Function
Public Sub Set_Retorna(valor As String)
retorna = valor
End Sub
25
65. Public Function Get_filtro() As String
Get_filtro = filtro
End Function
Public Function Get_nuevo() As String
Get_nuevo = nuevo_reg
End Function
Public Sub Set_Reg_actual(valor As String)
reg_actual = valor
End Sub
Public Function Get_tabla() As String
Get_tabla = strtabla
End Function
Public Function Get_camposPK() As String
Get_camposPK = camposKP
End Function
Public Sub SALIR()
Unload Me
End Sub
Private Sub cmd_anterior_Click()
LLenaDatosForm 3
End Sub
Private Sub cmd_buscar_Click()
On Error GoTo SALIR
Busqueda_sql "SELECT codigo,NOMBRE FROM materias "
Busqueda_where " WHERE codigo+NOMBRE "
Busqueda_orden "2"
Busqueda_Ncampos 2
Busqueda_campos 0, "Codigo", 20
Busqueda_campos 1, "Nombre de Materia", 80
Busqueda_indice 0
Load frmbusqueda
frmbusqueda.Show vbModal
If Busqueda.retorna <> "" Then
LLenaDatosForm 0, Busqueda.retorna
End If
Exit Sub
SALIR:
ERRORES
End Sub
Private Sub cmd_cancelar_Click()
Cancelar
End Sub
Private Sub cmd_eliminar_Click()
Elimna_reg
26
66. End Sub
Private Sub cmd_guardar_Click()
Guardar
End Sub
Private Sub cmd_nuevo_Click()
Nuevo
End Sub
Private Sub cmd_primero_Click()
LLenaDatosForm 1
End Sub
Private Sub cmd_salir_Click()
SALIR
End Sub
Private Sub cmd_siguiente_Click()
LLenaDatosForm 4
End Sub
Private Sub cmd_ultimo_Click()
LLenaDatosForm 2
End Sub
Private Sub Form_Activate()
Set FRM = Me
End Sub
Private Sub Form_Load()
filtro = ""
'LLENACOMBO cmb_area, "Select codigo,nombre from areas order by nombre"
strtabla = "materias"
camposKP = "|codigo|"
nuevo_reg = "codigo"
Set FRM = Me
LLenaDatosForm
End Sub
Private Sub txtnombre_KeyPress(KeyAscii As Integer)
KeyAscii = SoloTexto(KeyAscii)
End Sub
1.9 FORMULARIOS CONFIGURACION MATERIAS PROFESOR
Dim strtabla As String
Dim camposKP As String
Dim nuevo_reg As String
Dim reg_actual As String
Dim filtro As String
Dim d_grid(100) As DATOS_GRID
Dim a_col As Integer
Dim a_fil As Integer
Public Function Get_filtro() As String
27
67. Get_filtro = filtro
End Function
Public Function Get_nuevo() As String
Get_nuevo = nuevo_reg
End Function
Public Sub Set_Reg_actual(valor As String)
reg_actual = valor
End Sub
Public Function Get_tabla() As String
Get_tabla = strtabla
End Function
Public Function Get_camposPK() As String
Get_camposPK = camposKP
End Function
Public Sub SALIR()
Unload Me
End Sub
Private Sub cmb_grado_Click()
If cmb_grado.ListIndex = -1 Then Exit Sub
If GRID.TextMatrix(a_fil, col_nombre("grado")) <>
ExtraeIDCombo(cmb_grado) Then
GRID.TextMatrix(a_fil, col_nombre("grado")) = ExtraeIDCombo(cmb_grado)
GRID.TextMatrix(a_fil, col_nombre("Ngrado")) = cmb_grado.TEXT
GRID.TextMatrix(a_fil, col_nombre("materia")) = ""
GRID.TextMatrix(a_fil, col_nombre("Nmateria")) = ""
GRID.TextMatrix(a_fil, col_nombre("paralelo")) = ""
GRID.TextMatrix(a_fil, col_nombre("Nparalelo")) = ""
End If
End Sub
Private Sub cmb_materias_Click()
If cmb_materias.ListIndex = -1 Then Exit Sub
GRID.TextMatrix(a_fil, col_nombre("materia")) =
ExtraeIDCombo(cmb_materias)
GRID.TextMatrix(a_fil, col_nombre("Nmateria")) = cmb_materias.TEXT
End Sub
Private Sub cmb_paralelo_Click()
If cmb_paralelo.ListIndex = -1 Then Exit Sub
GRID.TextMatrix(a_fil, col_nombre("paralelo")) =
ExtraeIDCombo(cmb_paralelo)
GRID.TextMatrix(a_fil, col_nombre("Nparalelo")) = cmb_paralelo.TEXT
End Sub
28
68. Private Sub cmb_profesor_Click()
procesar
End Sub
Private Sub cmd_anterior_Click()
LLenaDatosForm 3
End Sub
Private Sub cmd_cancelar_Click()
'LLenaDatosForm
End Sub
Private Sub cmd_eliminar_Click()
cmb_grado.Visible = False
cmb_materias.Visible = False
cmb_paralelo.Visible = False
ELIMINA_ITEM_GRID GRID.Row
End Sub
Private Sub cmd_guardar_Click()
Dim SQL1 As String
Dim FILA, I As Integer
If cmb_profesor.ListIndex = -1 Then Exit Sub
cmb_grado.Visible = False
cmb_materias.Visible = False
cmb_paralelo.Visible = False
For I = 1 To GRID_RES.Rows - 1
If VALIDAR_ELIMINAR(I) = True Then
SQL1 = genera_DELETE(I)
EjecutaSQL SQL1
End If
Next
LIMPIA_GRID_RES
I=1
If GRID.TextMatrix(I, col_nombre("grado")) <> "" And GRID.TextMatrix(I,
col_nombre("paralelo")) <> "" And GRID.TextMatrix(I, col_nombre("materia"))
<> "" Then
If GRID.TextMatrix(I, col_nombre("periodo")) = "" And GRID.TextMatrix(I,
col_nombre("profesor")) = "" Then
GRID.TextMatrix(I, col_nombre("periodo")) = Gperiodo
GRID.TextMatrix(I, col_nombre("profesor")) =
ExtraeIDCombo(cmb_profesor)
End If
End If
For I = 1 To GRID.Rows - 1
If VALIDAR(I) = True Then
If EXITE_NOTA(I) = False And MODIFICADO(I) = False Then
29
69. SQL1 = genera_INSERT(I)
Else
SQL1 = genera_UPDATE(I)
End If
EjecutaSQL SQL1
End If
Next
End Sub
Private Sub EjecutaSQL(cade As String)
On Error GoTo SALIR2
base.Execute (cade)
Exit Sub
SALIR2:
ERRORES
End Sub
Private Function MODIFICADO(FILA As Integer) As Boolean
MODIFICADO = False
Dim I As Integer
For I = 0 To GRID.Cols - 1
If d_grid(I).revisar = True Then
If GRID.TextMatrix(FILA, col_nombre(d_grid(I).campo_col)) = "" Then
Exit Function
End If
Next
For I = 0 To GRID.Cols - 1
If d_grid(I).revisar = True Then
If GRID.TextMatrix(FILA, col_nombre(d_grid(I).cabecera_col)) <>
GRID.TextMatrix(FILA, col_nombre(d_grid(I).campo_col)) Then
MODIFICADO = True
Exit Function
End If
End If
Next
End Function
Private Function ELIMINABLE(FILA As Integer) As Boolean
ELIMINABLE = False
Dim I As Integer
For I = 0 To GRID.Cols - 1
If d_grid(I).revisar = True Then
If GRID.TextMatrix(FILA, col_nombre(d_grid(I).cabecera_col)) = ""
Then Exit Function
End If
Next
ELIMINABLE = True
End Function
Private Function VALIDAR_ELIMINAR(FILA As Integer) As Boolean
VALIDAR_ELIMINAR = False
Dim I As Integer
30
70. For I = 0 To GRID_RES.Cols - 1
If d_grid(I).revisar = True Then
If GRID_RES.TextMatrix(FILA, I) = "" Then Exit Function
End If
Next
VALIDAR_ELIMINAR = True
End Function
Private Function VALIDAR(FILA As Integer) As Boolean
VALIDAR = False
Dim I As Integer
For I = 0 To GRID.Cols - 1
If d_grid(I).Obligatorio = True Then
If GRID.TextMatrix(FILA, I) = "" Then Exit Function
End If
Next
VALIDAR = True
End Function
Private Sub cmd_nuevo_Click()
'Nuevo
If cmb_profesor.ListIndex = -1 Then Exit Sub
cmb_grado.Visible = False
cmb_materias.Visible = False
cmb_paralelo.Visible = False
GRID.Rows = GRID.Rows + 1
GRID.TextMatrix(GRID.Rows - 1, col_nombre("profesor")) =
ExtraeIDCombo(cmb_profesor)
GRID.TextMatrix(GRID.Rows - 1, col_nombre("periodo")) = Gperiodo
End Sub
Private Sub cmd_primero_Click()
LLenaDatosForm 1
End Sub
Private Sub cmd_salir_Click()
SALIR
End Sub
Private Sub cmd_siguiente_Click()
LLenaDatosForm 4
End Sub
Private Sub cmd_ultimo_Click()
LLenaDatosForm 2
End Sub
Private Sub Form_Load()
Me.Top = 0
Me.Left = 10
coloca_tolti Me
LLENACOMBO cmb_profesor, "select codigo,nombre from profesor"
LLENACOMBO cmb_grado, "select codigo,nombre from grados"
strtabla = "materia_profesor"
31
73. d_grid(9).clave = False
d_grid(9).insertable = False
d_grid(9).revisar = True
d_grid(9).Obligatorio = False
d_grid(10).n_col = 10
d_grid(10).ancho_col = 0
d_grid(10).cabecera_col = "materia"
d_grid(10).campo_col = "materia2"
d_grid(10).editable = False
d_grid(10).clave = False
d_grid(10).insertable = False
d_grid(10).revisar = True
d_grid(10).Obligatorio = False
End Sub
Private Sub CONF_GRID()
Dim I As Integer
GRID.Rows = 2
For I = 0 To GRID.Cols - 1
GRID.ColWidth(I) = d_grid(I).ancho_col
GRID.TextMatrix(0, I) = d_grid(I).cabecera_col
Next
End Sub
Private Sub GRID_Click()
Dim a_tex As String
'On Error Resume Next
If cmb_profesor.ListIndex = -1 Then Exit Sub
If d_grid(GRID.col).editable = False Then Exit Sub
a_col = GRID.col
a_fil = GRID.Row
If GRID.col = col_nombre("Ngrado") Then
cmb_materias.Visible = False
cmb_paralelo.Visible = False
cmb_grado.Visible = False
cmb_grado.Top = GRID.Top + GRID.CellTop
cmb_grado.Left = GRID.Left + GRID.CellLeft
cmb_grado.Width = GRID.CellWidth - 10
'cmb_grado.Height = GRID.CellHeight - 10
cmb_grado.ListIndex = IndexList(cmb_grado, CLng(valor_celda(a_fil,
"grado")))
cmb_grado.Visible = True
Exit Sub
End If
If GRID.col = col_nombre("Nmateria") And valor_celda(a_fil, "grado") <> 0
Then
LLENACOMBO cmb_materias, "select codigo,nombre from materias where
CODIGO IN(SELECT MATERIA FROM MATERIA_GRADO WHERE
periodo='" & Gperiodo & "' and grado='" & valor_celda(a_fil, "grado") & "')"
34
74. cmb_materias.Visible = False
cmb_paralelo.Visible = False
cmb_grado.Visible = False
cmb_materias.Top = GRID.Top + GRID.CellTop
cmb_materias.Left = GRID.Left + GRID.CellLeft
cmb_materias.Width = GRID.CellWidth - 10
cmb_materias.ListIndex = IndexList(cmb_materias, CLng(valor_celda(a_fil,
"materia")))
cmb_materias.Visible = True
Exit Sub
End If
If GRID.col = col_nombre("Nparalelo") And valor_celda(a_fil, "grado") <> 0
Then
LLENACOMBO cmb_paralelo, "select codigo,nombre from paralelo where
grado='" & valor_celda(a_fil, "grado") & "' and periodo='" & Gperiodo & "'"
cmb_materias.Visible = False
cmb_paralelo.Visible = False
cmb_grado.Visible = False
cmb_paralelo.Top = GRID.Top + GRID.CellTop
cmb_paralelo.Left = GRID.Left + GRID.CellLeft
cmb_paralelo.Width = GRID.CellWidth - 10
cmb_paralelo.ListIndex = IndexList(cmb_paralelo, CLng(valor_celda(a_fil,
"paralelo")))
cmb_paralelo.Visible = True
End If
End Sub
Private Sub txt_Change()
GRID.TextMatrix(a_fil, a_col) = txt.TEXT
End Sub
Private Sub GUARDA_GRID()
Dim I, mayor As Integer
Dim SQLSTR As String
Set tabla = base.Execute("select isnull(max(cast(" & nuevo_reg & " as integer)),0)
+ 1 as nuevo from " & strtabla)
mayor = tabla.Fields(0).Value
tabla.Close
Set tabla = Nothing
For I = 1 To GRID.Rows - 1
If GRID.TextMatrix(I, 0) = "" Then 'hay que insertar
SQLSTR = "INSERT INTO " & strtabla & "(codigo,grado,periodo,nombre)
Values ('" & mayor & "','" & GRID.TextMatrix(I, 1) & "','" &
GRID.TextMatrix(I, 2) & "','" & GRID.TextMatrix(I, 3) & "')"
GRID.TextMatrix(I, 0) = mayor
mayor = mayor + 1
Else ' hay que actualizar
SQLSTR = "UPDATE " & strtabla & " set nombre='" & GRID.TextMatrix(I,
3) & "' where codigo='" & GRID.TextMatrix(I, 0) & "'"
35
75. End If
base.Execute (SQLSTR)
Next
End Sub
Private Sub BORRA_DATOS_GRID()
Dim I, c As Integer
Dim SQLSTR As String
For I = 1 To GRID_RES.Rows - 1
If GRID_RES.TextMatrix(I, 0) <> "" Then
SQLSTR = "DELETE FROM " & strtabla & " WHERE codigo='" &
GRID_RES.TextMatrix(I, 0) & "'"
base.Execute (SQLSTR)
End If
Next
GRID_RES.Rows = 2
For c = 0 To GRID_RES.Cols - 1
GRID_RES.TextMatrix(1, c) = ""
Next
End Sub
Private Sub CARGA_GRID(nombre As String, FILA As Integer, valor As
Variant)
Dim I As Integer
For I = 0 To GRID.Cols - 1
If d_grid(I).campo_col = nombre Then
GRID.TextMatrix(FILA, d_grid(I).n_col) = valor
End If
Next
End Sub
Private Sub ELIMINA_ITEM_GRID(FILA As Integer)
Dim c, f As Integer
If ELIMINABLE(FILA) = True Then
If GRID_RES.TextMatrix(GRID_RES.Rows - 1, 0) <> "" Then
GRID_RES.Rows = GRID_RES.Rows + 1
End If
f = GRID_RES.Rows - 1
For c = 0 To GRID.Cols - 1
GRID_RES.TextMatrix(f, c) = GRID.TextMatrix(FILA, c)
Next
End If
If GRID.Rows > 2 Then
For f = FILA To GRID.Rows - 2
For c = 0 To GRID.Cols - 1
GRID.TextMatrix(f, c) = GRID.TextMatrix(f + 1, c)
Next
Next
GRID.Rows = GRID.Rows - 1
Else
LIMPIA_GRID
36
76. End If
End Sub
Private Function EXITE_NOTA(FILA As Integer) As Boolean
Dim SQL1, strand As String
strand = " "
EXITE_NOTA = False
SQL1 = "select count(*) as UNOS from " & strtabla & " where "
For I = 0 To GRID.Cols - 1
If d_grid(I).clave = True Then
SQL1 = SQL1 & strand & d_grid(I).campo_col & " = '" &
GRID.TextMatrix(FILA, d_grid(I).n_col) & "'"
strand = " AND "
End If
Next
Set tabla = base.Execute(SQL1)
If tabla.Fields(0).Value <> 0 Then
EXITE_NOTA = True
End If
tabla.Close
Set tabla = Nothing
End Function
Private Function genera_INSERT(FILA As Integer) As String
Dim SQL1, SQL2, strCOMA As String
strCOMA = " "
SQL1 = "INSERT INTO " & strtabla & "("
SQL2 = " VALUES ("
For I = 0 To GRID.Cols - 1
If d_grid(I).insertable = True Then
SQL1 = SQL1 & strCOMA & d_grid(I).campo_col
SQL2 = SQL2 & strCOMA & "'" & GRID.TextMatrix(FILA,
d_grid(I).n_col) & "'"
strCOMA = ","
End If
Next
SQL1 = SQL1 & ") "
SQL2 = SQL2 & ") "
SQL1 = SQL1 & SQL2
genera_INSERT = SQL1
End Function
Private Function genera_UPDATE(FILA As Integer) As String
Dim SQL1, SQL2, strCOMA, strand As String
strCOMA = " "
strand = " "
SQL1 = "UPDATE " & strtabla & " set "
SQL2 = " WHERE "
For I = 0 To GRID.Cols - 1
If d_grid(I).insertable = True And d_grid(I).revisar = False Then
37
77. SQL1 = SQL1 & strCOMA & d_grid(I).campo_col & "='" &
GRID.TextMatrix(FILA, d_grid(I).n_col) & "'"
strCOMA = ","
End If
If d_grid(I).revisar = True Then
SQL2 = SQL2 & strand & d_grid(I).cabecera_col & " = '" &
GRID.TextMatrix(FILA, d_grid(I).n_col) & "'"
strand = " AND "
End If
Next
SQL1 = SQL1 & " "
SQL2 = SQL2 & " "
SQL1 = SQL1 & SQL2
genera_UPDATE = SQL1
End Function
Private Function genera_DELETE(FILA As Integer) As String
Dim SQL1, SQL2, strCOMA, strand As String
strCOMA = " "
strand = " "
SQL2 = "DELETE FROM " & strtabla & " WHERE "
For I = 0 To GRID_RES.Cols - 1
If d_grid(I).revisar = True Then
SQL2 = SQL2 & strand & d_grid(I).cabecera_col & " = '" &
GRID_RES.TextMatrix(FILA, d_grid(I).n_col) & "'"
strand = " AND "
End If
Next
genera_DELETE = SQL2
End Function
Private Function valor_celda(FILA As Integer, nombre As String) As Integer
Dim I As Integer
valor_celda = -1
For I = 0 To GRID.Cols - 1
If UCase(d_grid(I).campo_col) = UCase(nombre) Then
valor_celda = Val(GRID.TextMatrix(FILA, d_grid(I).n_col))
Exit Function
End If
Next
End Function
Private Function col_nombre(nombre As String) As Integer
Dim I As Integer
For I = 0 To GRID.Cols - 1
If UCase(d_grid(I).campo_col) = UCase(nombre) Then
col_nombre = d_grid(I).n_col
Exit Function
End If
Next
38
78. End Function
Private Sub procesar()
Dim SQL1, SQL2 As String
Dim FILA As Integer
LIMPIA_GRID
LIMPIA_GRID_RES
cmb_grado.Visible = False
cmb_materias.Visible = False
cmb_paralelo.Visible = False
If cmb_profesor.ListIndex = -1 Then Exit Sub
SQL1 = "select
MP.materia,MP.profesor,MP.paralelo,MP.grado,MP.periodo,(select nombre from
materias where codigo=MP.materia ) as Nmateria,(select nombre from grados
where codigo=MP.grado) as Ngrado,(select nombre from paralelo where
codigo=MP.paralelo ) as Nparalelo,MP.materia as materia2,MP.paralelo as
paralelo2,MP.grado as grado2 FROM MATERIA_profesor MP where periodo='"
& Gperiodo & "' and profesor='" & ExtraeIDCombo(cmb_profesor) & "'"
Set tabla = base.Execute(SQL1)
If tabla.EOF = True Then
tabla.Close
Set tabla = Nothing
Exit Sub
End If
FILA = 1
Do Until tabla.EOF = True
For I = 0 To tabla.Fields.Count - 1
CARGA_GRID tabla.Fields.Item(I).Name, FILA, tabla.Fields(I).Value
Next
tabla.MoveNext
If tabla.EOF = False Then
FILA = FILA + 1
GRID.Rows = GRID.Rows + 1
End If
Loop
tabla.Close
Set tabla = Nothing
End Sub
Private Sub LIMPIA_GRID()
Dim I, c As Integer
GRID.Rows = 2
For c = 0 To GRID.Cols - 1
GRID.TextMatrix(1, c) = ""
Next
End Sub
Private Sub LIMPIA_GRID_RES()
Dim I, c As Integer
GRID_RES.Rows = 2
39
79. For c = 0 To GRID_RES.Cols - 1
GRID_RES.TextMatrix(1, c) = ""
Next
End Sub
1.10 FORMULARIOS REGISTRO DE MATRICULAS
Dim strtabla As String
Dim camposKP As String
Dim nuevo_reg As String
Dim reg_actual As String
Dim opcion_foto As String
Dim filtro As String
Dim accion As String
Public Sub Set_Accion(valor As String)
accion = valor
End Sub
Public Function Get_Accion() As String
Get_Accion = accion
End Function
Public Function Get_filtro() As String
Get_filtro = filtro
End Function
Public Function Get_nuevo() As String
Get_nuevo = nuevo_reg
End Function
Public Sub Set_Reg_actual(valor As String)
reg_actual = valor
End Sub
Public Function Get_tabla() As String
Get_tabla = strtabla
End Function
Public Function Get_camposPK() As String
Get_camposPK = camposKP
End Function
Public Sub SALIR()
Unload Me
End Sub
Private Sub cmb_grado_Click()
LLENACOMBO cmb_paralelo, "select codigo,nombre from paralelo where
grado='" & ExtraeIDCombo(cmb_grado) & "' and periodo='" & Gperiodo & "'"
End Sub
Private Sub cmd_anterior_Click()
40
80. 'cmb_grado.Locked = False
LLenaDatosForm 3
'cmb_grado.Locked = True
cmd_busca_estudiante.Visible = Not
EXISTE_MATRICULA(eti_matricula.Caption)
End Sub
Private Sub cmd_busca_estudiante_Click()
On Error GoTo SALIR
If eti_matricula.Caption = "" Then Exit Sub
Busqueda_sql "SELECT codigo,NOMBREs,telefono,direccion FROM estudiante
"
Busqueda_where " WHERE codigo+NOMBREs "
Busqueda_orden "2"
Busqueda_Ncampos 4
Busqueda_campos 0, "Codigo", 5
Busqueda_campos 1, "Nombre", 40
Busqueda_campos 2, "Telefono", 15
Busqueda_campos 3, "Direccion", 40
Busqueda_indice 0
Load frmbusqueda
frmbusqueda.Show vbModal
If Busqueda.retorna <> "" Then
If ALUMN_MATRICULADO(Busqueda.retorna) = False Then
txt_estudiante.TEXT = Busqueda.retorna
GRAGO_SIGUIENTE
End If
End If
Exit Sub
SALIR:
ERRORES
End Sub
Private Function ALUMN_MATRICULADO(estu As String) As Boolean
Dim matri As String
Dim SQL12 As String
ALUMN_MATRICULADO = False
SQL12 = "select codigo from matricula where periodo='" & Gperiodo & "' and
estudiante='" & estu & "'"
Set tabla_aux = base.Execute(SQL12)
If tabla_aux.EOF = False Then
matri = tabla_aux.Fields(0).Value
MsgBox "El Alumno ya esta Matriculado en la Matricula Nº: " & matri,
vbInformation, "SISTEMA"
ALUMN_MATRICULADO = True
End If
tabla_aux.Close
Set tabla_aux = Nothing
End Function
41