示例#1
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            string resultadoCodigo = ValidadoresComponent.VerificarCodigoPais(txtCodigo.Text);
            string resultadoIdioma = ValidadoresComponent.VerificarLetras(txtIdioma.Text);

            if (resultadoCodigo == "" || resultadoIdioma == "")
            {
                IdiomaComponent idiomaComponent = new IdiomaComponent();
                Entities.Idioma idioma          = new Entities.Idioma();
                idioma.Id     = int.Parse(mgListado.CurrentRow.Cells[0].Value.ToString());
                idioma.idioma = txtIdioma.Text;
                idioma.codigo = txtCodigo.Text;
                if (idiomaComponent.Update(idioma))
                {
                    ValidadoresComponent.Modificado(idioma.idioma, this);
                    llenarGrilla();
                }
                else
                {
                    ValidadoresComponent.ErrorAltaModificacado(idioma.idioma, this);
                }
            }
            else
            {
                if (resultadoCodigo != "")
                {
                    MetroMessageBox.Show(this, resultadoCodigo, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (resultadoIdioma != "")
                {
                    MetroMessageBox.Show(this, resultadoIdioma, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
示例#2
0
        public bool validarDatosAdicionales()
        {
            string error = "";

            if (chMedicamentos.Checked)
            {
                error = ValidadoresComponent.VerificarLetras(txtMedicamentosCuales.Text);
            }
            if (chAlimento.Checked)
            {
                error = error + " " + ValidadoresComponent.VerificarLetras(txtAlimentoCuales.Text);
            }
            if (chElementos.Checked)
            {
                error = error + " " + ValidadoresComponent.VerificarLetras(txtElementosCuales.Text);
            }

            if (chObraSocial.Checked)
            {
                error = error + " " + ValidadoresComponent.VerificarLetras(txtCualOS.Text);
                error = error + " " + ValidadoresComponent.VerificarTamaño(txtTelefonoOS.Text, 10, 10);
                error = error + " " + ValidadoresComponent.VerificarNumeros(txtSocioOS.Text);
            }


            if (error.Length < 15)
            {
                return(true);
            }
            else
            {
                MetroMessageBox.Show(this, error, "error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
        }
示例#3
0
        private void btnAlta_Click(object sender, EventArgs e)
        {
            string resultadoCodigo = ValidadoresComponent.VerificarCodigoPais(txtCodigo.Text);
            string resultadoIdioma = ValidadoresComponent.VerificarLetras(txtIdioma.Text);

            if (resultadoCodigo == "" && resultadoIdioma == "")
            {
                IdiomaComponent idiomaComponent = new IdiomaComponent();
                Entities.Idioma idioma          = new Entities.Idioma();

                idioma.idioma = txtIdioma.Text;
                idioma.codigo = txtCodigo.Text;
                if (idiomaComponent.Create(idioma) == null)
                {
                    ValidadoresComponent.ErrorAltaModificacado("Idioma", this);
                }
                else
                {
                    ValidadoresComponent.Alta("Idioma", this);
                    llenarGrilla();
                }
            }
            else
            {
                if (resultadoCodigo != "")
                {
                    MetroMessageBox.Show(this, resultadoCodigo, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                if (resultadoIdioma != "")
                {
                    MetroMessageBox.Show(this, resultadoIdioma, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
示例#4
0
        private void btnAlta_Click(object sender, EventArgs e)
        {
            string resultadoIdioma = ValidadoresComponent.VerificarLetras(txtIdioma.Text);

            if (resultadoIdioma == "")
            {
                PalabraComponent idiomaComponent = new PalabraComponent();
                Palabra          idioma          = new Palabra();

                idioma.palabra = txtIdioma.Text;

                if (idiomaComponent.Create(idioma) == null)
                {
                    ValidadoresComponent.ErrorAltaModificacado("Idioma", this);
                }
                else
                {
                    llenarGrilla();
                }
            }
            else
            {
                MetroMessageBox.Show(this, resultadoIdioma, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        private void btnAlta_Click(object sender, EventArgs e)
        {
            Alumno alumno = new Alumno();

            alumno = (Alumno)txtAlumno.SelectedItem;
            Boletin boletin = new Boletin(alumno);

            Curso curso = new Curso();

            curso              = (Curso)txtCurso.SelectedItem;
            boletin.año        = curso.salaHorario.año;
            boletin.cutrimeste = int.Parse(txtCuatrimestre.Text);
            boletin.notas      = txtNota.Text;
            BoletinComponent boletinComponent = new BoletinComponent();

            if (boletinComponent.Create(boletin) == null)
            {
                ValidadoresComponent.ErrorAltaModificacado("Boletin", this);
            }
            else
            {
                ValidadoresComponent.Alta("Boletin", this);
                llenarGrillaBoletin();
            }
        }
示例#6
0
        private void btnAltaProveedor_Click(object sender, EventArgs e)
        {
            GestionMantenimiento gestionMantenimiento = new GestionMantenimiento();

            gestionMantenimiento = (GestionMantenimiento)txtTipo.SelectedItem;
            Proveedor proveedor = new Proveedor();

            proveedor = (Proveedor)txtProveedor.SelectedItem;


            Secretaria          secretaria          = new Secretaria();
            SecretariaComponent secretariaComponent = new SecretariaComponent();

            secretaria = secretariaComponent.ReadByEmail(SessionManager.instance.GetUSuario().UserName);
            Mantenimiento mantenimiento = new Mantenimiento(proveedor, gestionMantenimiento, secretaria);

            mantenimiento.fecha = txtFecha.Value;


            MantenimientoComponent mantenimientoComponent = new MantenimientoComponent();

            mantenimientoComponent.Create(mantenimiento);
            ValidadoresComponent.Alta("Mantenimiento", this);
            llenarGrillaMantenimiento();
        }
示例#7
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            mgListado.Rows.Clear();
            PalabraComponent idiomaComponent = new PalabraComponent();
            List <Palabra>   idiomas         = new List <Palabra>();

            string resultado = ValidadoresComponent.VerificarLetras(txtBuscar.Text);

            if (resultado == "")
            {
                mgListado.Rows.Clear();
                idiomas = idiomaComponent.buscar(txtBuscar.Text);
                int n = 0;
                foreach (Palabra item in idiomas)
                {
                    n = mgListado.Rows.Add();
                    mgListado.Rows[n].Cells[0].Value = item.Id;
                    mgListado.Rows[n].Cells[1].Value = item.palabra;

                    n++;
                }
            }
            else
            {
                MetroMessageBox.Show(this, resultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
示例#8
0
        private void btnAlta_Click(object sender, EventArgs e)
        {
            if (verificarCamposCurso())
            {
                Sala sala = new Sala();
                sala.Id = salaHorario.sala.Id;
                Grado grado = new Grado();
                grado.Id = int.Parse(txtGrado.SelectedValue.ToString());
                SalaHorarioComponent salaHorarioComponent = new SalaHorarioComponent();
                salaHorarioComponent.Create(salaHorario);
                Curso curso = new Curso(sala, grado, salaHorarioComponent.ReadBySalaYañoYTurnoGrado(salaHorario));

                curso.nombre = txtNombreCurso.Text;


                CursoComponent cursoComponent = new CursoComponent();
                if (cursoComponent.Create(curso) == null)
                {
                    ValidadoresComponent.ErrorAltaModificacado("Curso", this);
                }
                else
                {
                    ValidadoresComponent.Alta("Curso", this);
                    llenarGrillaReservas();
                    mgSala.Rows.Clear();
                }
                RecorridoForm.LimpiarTXT(this);
            }
        }
示例#9
0
        private void btnAltaProveedor_Click(object sender, EventArgs e)
        {
            if (VerificarCampos())
            {
                List <Telefono> listaTelefono = new List <Telefono>();
                Telefono        telefono      = new Telefono();
                telefono.numero = double.Parse(txtTelefono.Text);
                listaTelefono.Add(telefono);
                Proveedor proveedor = new Proveedor(listaTelefono);

                proveedor.matricula     = txtMatricula.Text;
                proveedor.nombre        = txtNombreProveedor.Text;
                proveedor.tipoProveedor = txtTipo.Text;


                proveedor.contacto = txtContacto.Text;
                proveedor.cuit     = txtCUIT.Text;
                ProveedorComponenent proveedorComponenent = new ProveedorComponenent();
                if (proveedorComponenent.Create(proveedor) == null)
                {
                    ValidadoresComponent.ErrorAltaModificacado("Proveedor", this);
                }
                else
                {
                    ValidadoresComponent.Alta("Proveedor", this);
                    RecorridoForm.LimpiarTXT(this);
                    llenarGrillaProveedor();
                }
            }
        }
示例#10
0
        private void btnEliminarEsp_Click(object sender, EventArgs e)
        {
            MateriaComponent materiaComponent = new MateriaComponent();

            materiaComponent.Delete(int.Parse(mgEspecialidades.CurrentRow.Cells[0].Value.ToString()));
            ValidadoresComponent.Baja("Materia", this);
            llenargrilla();
        }
示例#11
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     if (VerificarBorrado())
     {
         UsuariosComponent usuarios = new UsuariosComponent();
         usuarios.Delete(int.Parse(mgUsuario.CurrentRow.Cells[0].Value.ToString()));
         ValidadoresComponent.Baja("usuario", this);
         llenarGrillas();
     }
 }
示例#12
0
        bool verificarCampoMateria()

        {
            string error = ValidadoresComponent.VerificarLetras(txtMateria.Text);

            if (error.Length > 5)
            {
                MetroMessageBox.Show(this, error, "error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
            else
            {
                return(true);
            }
        }
示例#13
0
        private void btnAltaMaestro_Click(object sender, EventArgs e)
        {
            if (verificarCamposDocumentacionMaestro())
            {
                Documento documentacion1 = new Documento();
                documentacion1.openFileDialog      = openFileDialogAlumno;
                documentacion1.tipo_Documentancion = "DNI";
                documentacion1.NombreDocumento     = "DNI";
                Documento documentacion2 = new Documento();
                documentacion2.openFileDialog      = openFileDialogPadre;
                documentacion2.tipo_Documentancion = "Titulo";
                documentacion2.NombreDocumento     = "Titulo";
                Documento documentacion3 = new Documento();
                documentacion3.openFileDialog      = openFileDialogCertificado;
                documentacion3.tipo_Documentancion = "Certificado";
                documentacion3.NombreDocumento     = "Certificado";

                List <Documento> listaDocumentacion = new List <Documento>();
                listaDocumentacion.Add(documentacion1);
                listaDocumentacion.Add(documentacion2);
                listaDocumentacion.Add(documentacion3);
                MaestroCreator  maestroCreator = new MaestroCreator();
                List <Telefono> telefonos      = new List <Telefono>();
                telefonos.Add(telefono);
                List <Especialidad> especialidades = new List <Especialidad>();
                especialidades.Add(especialidad);
                Maestro unMaestro = new Maestro(especialidades, listaDocumentacion, telefonos);
                unMaestro.apellido        = persona.apellido;
                unMaestro.nombre          = persona.nombre;
                unMaestro.fechaNacimiento = persona.fechaNacimiento;
                unMaestro.direccion       = persona.direccion;
                unMaestro.DNI             = persona.DNI;

                string error = maestroCreator.CrearPersonaContructor(unMaestro, usuarios);

                if (error != "")
                {
                    MetroMessageBox.Show(this, error, "error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    RecorridoForm.LimpiarTXT(this);
                }
                else
                {
                    llenarGrillaMaestro();
                    ValidadoresComponent.Alta("Maestro", this);
                    RecorridoForm.LimpiarTXT(this);
                }
            }
        }
        private void metroButton1_Click(object sender, EventArgs e)
        {
            string errPassword = ValidadoresComponent.VerificarContraseña(txtPassword.Text);

            if (errPassword.Length <= 6)
            {
                pass = txtPassword.Text;
                this.Close();
            }

            else
            {
                pass = "";
                MetroMessageBox.Show(this, errPassword, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
示例#15
0
        private bool verificarCampoSala()
        {
            string error = ValidadoresComponent.VerificarLetras(txtNombre.Text);

            error = error + " " + ValidadoresComponent.VerificarNumerosIntervalo(txtCapacidad.Text, 1, 50);

            if (error.Length < 15)
            {
                return(true);
            }
            else
            {
                MetroMessageBox.Show(this, error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                return(false);
            }
        }
示例#16
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            int a = 0;
            int n = 0;

            for (int i = 0; i < mgReserva.RowCount; i++)
            {
                Alumno alumno = new Alumno();
                alumno.Id = int.Parse(mgReserva.Rows[n].Cells[0].Value.ToString());
                Asistencia          asistencia          = new Asistencia(alumno);
                AsistenciaComponent asistenciaComponent = new AsistenciaComponent();

                asistencia.dia = int.Parse(txtDia.Text);
                asistencia.mes = txtMes.SelectedIndex + 4;
                asistencia.año = unCurso.salaHorario.año;

                DataGridViewCheckBoxCell ck = mgReserva.Rows[n].Cells[4] as DataGridViewCheckBoxCell;


                asistencia.asistio = Convert.ToBoolean(ck.Value);
                if (asistenciaComponent.Create(asistencia) == null)
                {
                    a = 1;
                    break;
                }

                n++;
            }



            btnGuardar.Visible = false;

            mgReserva.Rows.Clear();
            llenarGrillaAsistencias();
            llenarCOmboMesVer();

            if (a == 1)
            {
                MetroMessageBox.Show(this, "Ya se tomo asistencia", "error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                ValidadoresComponent.Alta("Asistencia", this);
            }
        }
示例#17
0
        private bool verificarCamposEspecialidad()

        {
            string error = "";

            error = ValidadoresComponent.VerificarLetras(txtEspecialidadAlta.Text);

            if (error == "")
            {
                return(true);
            }
            else
            {
                MetroMessageBox.Show(this, error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
        }
示例#18
0
        bool verificarcampos()

        {
            string error = "";

            error = ValidadoresComponent.VerificarLetras(txtMateria.Text);

            error = error + Environment.NewLine + ValidadoresComponent.VerificarLetras(txtEspecialidad.Text);
            if (error.Length < 5)
            {
                return(true);
            }
            else
            {
                MetroMessageBox.Show(this, error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
        }
示例#19
0
 private void metroButton4_Click(object sender, EventArgs e)
 {
     if (verificarCamposTipo())
     {
         Proveedor tipoProveedor = new Proveedor();
         tipoProveedor.tipoProveedor = txtTipoProveedor.Text;
         ProveedorComponenent tipoProveedorComponent = new ProveedorComponenent();
         if (tipoProveedorComponent.CreateTipoProveedor(tipoProveedor) == null)
         {
             ValidadoresComponent.ErrorAltaModificacado("Tipo Proveedor", this);
         }
         else
         {
             ValidadoresComponent.Alta("Tipo Proveedor", this);
             RecorridoForm.LimpiarTXT(this);
             llenargrillaTipo();
         }
     }
 }
示例#20
0
        private void metroButton3_Click(object sender, EventArgs e)
        {
            Documento documentacion1 = new Documento();

            documentacion1.openFileDialog  = openFileDialogAlumno;
            documentacion1.NombreDocumento = "DNI Alumno";

            Documento documentacion2 = new Documento();

            documentacion2.openFileDialog  = openFileDialogPadre;
            documentacion2.NombreDocumento = "DNI Padre";
            Documento documentacion3 = new Documento();

            documentacion3.openFileDialog  = openFileDialogCertificado;
            documentacion3.NombreDocumento = "Certificado Nacimientos";
            Documento documentacion4 = new Documento();

            documentacion4.openFileDialog  = openFileDialogVacuna;
            documentacion4.NombreDocumento = "Vacunas";

            listaDocumentacion.Add(documentacion1);
            listaDocumentacion.Add(documentacion2);

            listaDocumentacion.Add(documentacion3);

            listaDocumentacion.Add(documentacion4);


            persona.AgregarTelefono(telefono);

            string error = alumnoContructor.CrearAlumno(persona, usuarios, listaDocumentacion, alergias, casa, familia, obrasSocial);

            if (error != "")
            {
                MetroMessageBox.Show(this, error, "error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                RecorridoForm.LimpiarTXT(this);
            }
            else
            {
                ValidadoresComponent.Alta("Incripcion", this);
                RecorridoForm.LimpiarTXT(this);
            }
        }
示例#21
0
        private bool VerificarCampos()
        {
            string error = "";

            error = ValidadoresComponent.VerificarLetras(txtNombre.Text);
            error = error + " " + ValidadoresComponent.VerificarLetras(txtApellido.Text);
            error = error + " " + ValidadoresComponent.VerificarNumerosIntervalo(txtDNI.Text, 52610644, 99999999);

            error = error + " " + ValidadoresComponent.VerificarNumeros(txtDNI.Text);
            if (error.Length < 15)
            {
                return(true);
            }
            else
            {
                MetroMessageBox.Show(this, error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
        }
示例#22
0
        bool verificarCamposCurso()


        {
            string error = ValidadoresComponent.VerificarAlfaNumerico(txtGrado.Text);

            error = error + " " + ValidadoresComponent.VerificarLetras(txtNombreCurso.Text);

            if (error.Length < 15)
            {
                return(true);
            }
            else
            {
                MetroMessageBox.Show(this, error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                return(false);
            }
        }
示例#23
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            string resultadoIdioma = ValidadoresComponent.VerificarLetras(txtIdioma.Text);

            if (resultadoIdioma == "")
            {
                PalabraComponent idiomaComponent = new PalabraComponent();
                Palabra          idioma          = new Palabra();
                idioma.Id      = int.Parse(mgListado.CurrentRow.Cells[0].Value.ToString());
                idioma.palabra = txtIdioma.Text;

                idiomaComponent.Update(idioma);
                llenarGrilla();
            }
            else
            {
                MetroMessageBox.Show(this, resultadoIdioma, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
示例#24
0
        private void btnAlta_Click(object sender, EventArgs e)
        {
            MaestroHorario          maestroHorario          = new MaestroHorario();
            MaestroHorarioComponent maestroHorarioComponent = new MaestroHorarioComponent();

            maestroHorario.persona.Id = legajo;
            maestroHorario.turno      = txtturno.Text;
            maestroHorario.año        = int.Parse(txtAño.Text);
            if (maestroHorarioComponent.Create(maestroHorario) == null)
            {
                ValidadoresComponent.ErrorAltaModificacado("Horario", this);
            }
            else
            {
                ValidadoresComponent.Alta("Horario", this);
                RecorridoForm.LimpiarTXT(this);
                llenarGrilla();
            }
        }
示例#25
0
        bool VerificarCampos(Usuarios usuarios)


        {
            string error = ValidadoresComponent.VerificarEmail(usuarios.Email);

            error = ValidadoresComponent.VerificarContraseña(usuarios.Password);

            if (error.Length < 15)
            {
                return(true);
            }
            else
            {
                lbError.Text = error;

                return(false);
            }
        }
示例#26
0
        bool verificarCamposTipo()

        {
            string error = "";


            error = error + Environment.NewLine + ValidadoresComponent.VerificarLetras(txtTipoProveedor.Text);



            if (error.Length >= 5)
            {
                MetroMessageBox.Show(this, error, "error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
            else
            {
                return(true);
            }
        }
示例#27
0
 private void metroButton2_Click(object sender, EventArgs e)
 {
     if (verificarCampos())
     {
         GradoComponent gradoComponent = new GradoComponent();
         Grado          grado          = new Grado();
         grado.nombre = txtNombre.Text;
         grado.año    = int.Parse(txtGrado.Text);
         if (gradoComponent.Create(grado) == null)
         {
             ValidadoresComponent.ErrorAltaModificacado("Grado", this);
         }
         else
         {
             ValidadoresComponent.Alta("Grado", this);
             llenarGrilla();
         }
         RecorridoForm.LimpiarTXT(this);
     }
 }
示例#28
0
 private void metroButton4_Click(object sender, EventArgs e)
 {
     if (verificarCamposTipo())
     {
         Proveedor proveedor = new Proveedor();
         proveedor.tipoProveedor = txtTipoProvv.Text;
         GestionMantenimiento tipoMantenimiento = new GestionMantenimiento(proveedor);
         tipoMantenimiento.tipoMantenimiento = txtTipoProveedor.Text;
         tipoMantenimiento.periocidad        = int.Parse(txtPeriocidad.Text);
         GestionMantenimientoComponent tipoMantenimientoComponenet = new GestionMantenimientoComponent();
         if (tipoMantenimientoComponenet.Create(tipoMantenimiento) == null)
         {
             ValidadoresComponent.ErrorAltaModificacado("Tipo mantenimiento", this);
         }
         else
         {
             ValidadoresComponent.Alta("Tipo mantenimiento", this);
             llenarGrillaTipoM();
         }
     }
 }
示例#29
0
        private void btnAltaEsp_Click(object sender, EventArgs e)
        {
            if (verificarCamposEspecialidad())
            {
                EspecialidadComponent especialidadComponent = new EspecialidadComponent();
                Especialidad          especialidad          = new Especialidad();
                especialidad.especialidad = txtEspecialidad.Text;
                if (especialidadComponent.Create(especialidad) == null)
                {
                    ValidadoresComponent.ErrorAltaModificacado("Especialidad", this);
                }
                else
                {
                    RecorridoForm.LimpiarTXT(this);

                    llenarEspecialidad();
                    llenarGrillaEspecialidades();
                    RecorridoForm.LimpiarTXT(this);
                }
            }
        }
示例#30
0
        private bool VerificarCamposAlta()
        {
            string errApellido = ValidadoresComponent.VerificarLetras(txtApellido.Text) + " " + Environment.NewLine + ValidadoresComponent.VerificarTamaño(txtApellido.Text, 30, 2);
            string errNombre   = ValidadoresComponent.VerificarLetras(txtNombre.Text) + " " + Environment.NewLine + ValidadoresComponent.VerificarTamaño(txtNombre.Text, 30, 2);
            string errUsuario  = ValidadoresComponent.VerificarEmail(txtUsuario.Text);

            string errPassword = ValidadoresComponent.VerificarContraseña(Password.Text);
            string result      = errApellido + errNombre + errUsuario + errPassword;

            lblErrApellido.Text   = errApellido;
            lblErrContraseña.Text = errPassword;
            lblErrNombre.Text     = errNombre;
            lblErrUsuario.Text    = errUsuario;
            if (result.Length <= 6)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }