Esempio n. 1
0
        public List <TipoCorrespondencia> getAllTipoCorrespondencia(ref string mensaje)
        {
            List <TipoCorrespondencia> tipoCorrespondencia = new List <TipoCorrespondencia>();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "sp_getListTipoCorrespondencia";

            try
            {
                sql.AbrirConexion();
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    tipoCorrespondencia.Add(TipoCorrespondencia.CreateTipoCorrespondenciaFromDataRecord(reader));
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            finally
            {
                sql.CerrarConexion();
            }

            return(tipoCorrespondencia);
        }
Esempio n. 2
0
        public Usuario getUsuario(string alias, ref string mensaje)
        {
            Usuario usuario = null;

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getUsuario";
            sql.Comando.Parameters.AddWithValue("@UserName", alias);

            try
            {
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                if (reader.Read())
                {
                    usuario = new Usuario();
                    usuario = Usuario.CreateUsuarioFromDataRecord(reader);
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            finally
            {
                sql.CerrarConexion();
            }

            return(usuario);
        }
Esempio n. 3
0
        public BandejaEntrada getBandejaEntrada(int id, ref string mensaje)
        {
            BandejaEntrada procesosEntrada = new BandejaEntrada();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "sp_getBandejaEntrada";
            sql.Comando.Parameters.AddWithValue("@IdProceso", id);

            try
            {
                sql.AbrirConexion();
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    procesosEntrada = BandejaEntrada.CreateBandejaEntradaFromDataRecord(reader);
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            finally
            {
                sql.CerrarConexion();
            }

            return(procesosEntrada);
        }
Esempio n. 4
0
        public List <Usuario> getAllUsuario(ref string mensaje)
        {
            List <Usuario> usuarios = new List <Usuario>();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "sp_getListUsuario";

            try
            {
                sql.AbrirConexion();
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    usuarios.Add(Usuario.CreateUsuarioFromDataRecord(reader));
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            finally
            {
                sql.CerrarConexion();
            }

            return(usuarios);
        }
Esempio n. 5
0
        public List <AppMenu> getAllbyRol(int rolid, ref string mensaje)
        {
            List <AppMenu> menus = new List <AppMenu>();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getMenu";
            sql.Comando.Parameters.AddWithValue("@RolID", rolid);

            try
            {
                sql.AbrirConexion();
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    menus.Add(AppMenu.CreateAppMenuFromDataRecord(reader));
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            finally
            {
                sql.CerrarConexion();
            }

            return(menus);
        }
Esempio n. 6
0
        public Estado getEstado(int id, ref string mensaje)
        {
            Estado estados = new Estado();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "sp_getEstado";
            sql.Comando.Parameters.AddWithValue("@idEstado", id);

            try
            {
                sql.AbrirConexion();
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    estados = Estado.CreateEstadoFromDataRecord(reader);
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            finally
            {
                sql.CerrarConexion();
            }

            return(estados);
        }
Esempio n. 7
0
        public Facultad getFacultad(int id, ref string mensaje)
        {
            Facultad facultad = new Facultad();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getFacultad";
            sql.Comando.Parameters.AddWithValue("@FacultadID", id);

            try
            {
                sql.AbrirConexion();
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    facultad = Facultad.CreateFacultadFromDataRecord(reader);
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            finally
            {
                sql.CerrarConexion();
            }

            return(facultad);
        }
Esempio n. 8
0
        public List <Facultad> getAllFacultad(ref string mensaje)
        {
            List <Facultad> facultades = new List <Facultad>();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getAllFacultad";

            try
            {
                sql.AbrirConexion();
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    facultades.Add(Facultad.CreateFacultadFromDataRecord(reader));
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            finally
            {
                sql.CerrarConexion();
            }

            return(facultades);
        }
Esempio n. 9
0
        public Entidades.Proceso.Proceso getProceso(int id, ref string mensaje)
        {
            Entidades.Proceso.Proceso proceso = new Entidades.Proceso.Proceso();
            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "sp_getProceso";
            sql.Comando.Parameters.AddWithValue("@IdProceso", id);

            try
            {
                sql.AbrirConexion();
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    proceso = Entidades.Proceso.Proceso.CreateProcesoFromDataRecord(reader);
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            finally
            {
                sql.CerrarConexion();
            }

            return(proceso);
        }
Esempio n. 10
0
        public List <BandejaHistorial> getAllBandejaHistorial(ref string mensaje)
        {
            List <BandejaHistorial> procesosHistorial = new List <BandejaHistorial>();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "sp_getListBandejaHistorial";

            try
            {
                sql.AbrirConexion();
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    procesosHistorial.Add(BandejaHistorial.CreateBandejaHistorialFromDataRecord(reader));
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            finally
            {
                sql.CerrarConexion();
            }

            return(procesosHistorial);
        }
Esempio n. 11
0
        public List <Pasantia> getAllPasantia(ref string mensaje)
        {
            List <Pasantia> pasantias = new List <Pasantia>();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getAllPasantia";

            try
            {
                sql.AbrirConexion();
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    pasantias.Add(Pasantia.CreatePasantiaFromDataRecord(reader));
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }
            finally
            {
                sql.CerrarConexion();
            }

            return(pasantias);
        }
Esempio n. 12
0
        public List <Proceso> getAllProceso(ref string mensaje)
        {
            List <Proceso> procesos = new List <Proceso>();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getAllProceso";

            try
            {
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    procesos.Add(Proceso.CreateProcesoFromDataRecord(reader));
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }

            return(procesos);
        }
Esempio n. 13
0
        public List <Carrera> getAllCarrera(ref string mensaje)
        {
            List <Carrera> carreras = new List <Carrera>();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getAllCarrera";

            try
            {
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    carreras.Add(Carrera.CreateCarreraFromDataRecord(reader));
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }

            return(carreras);
        }
Esempio n. 14
0
        public List <Actividad> getAllActividad(ref string mensaje)
        {
            List <Actividad> actividades = new List <Actividad>();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getAllActividad";

            try
            {
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    actividades.Add(Actividad.CreateActividadFromDataRecord(reader));
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }

            return(actividades);
        }
        public List <TipoIdentificacion> getAllTipoIdentificacion(ref string mensaje)
        {
            List <TipoIdentificacion> tiposidentificacion = new List <TipoIdentificacion>();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getAllTipoIdentificacion";

            try
            {
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    tiposidentificacion.Add(TipoIdentificacion.CreateTipoIdentificacionFromDataRecord(reader));
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }

            return(tiposidentificacion);
        }
Esempio n. 16
0
        public List <Institucion> getAllInstitucion(ref string mensaje)
        {
            List <Institucion> instituciones = new List <Institucion>();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getAllInstitucion";

            try
            {
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    instituciones.Add(Institucion.CreateInstitucionFromDataRecord(reader));
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }

            return(instituciones);
        }
Esempio n. 17
0
        public Proceso getProceso(int id, ref string mensaje)
        {
            Proceso proceso = new Proceso();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getProceso";
            sql.Comando.Parameters.AddWithValue("@PersonaID", id);

            try
            {
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    proceso = Proceso.CreateProcesoFromDataRecord(reader);
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }

            return(proceso);
        }
Esempio n. 18
0
        public Carrera getCarrera(int id, ref string mensaje)
        {
            Carrera carrera = new Carrera();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getCarrera";
            sql.Comando.Parameters.AddWithValue("@CarreraID", id);

            try
            {
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    carrera = Carrera.CreateCarreraFromDataRecord(reader);
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }

            return(carrera);
        }
Esempio n. 19
0
        public Institucion getInstitucion(int id, ref string mensaje)
        {
            Institucion institucion = new Institucion();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getInstitucion";
            sql.Comando.Parameters.AddWithValue("@InstitucionID", id);

            try
            {
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    institucion = Institucion.CreateInstitucionFromDataRecord(reader);
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }

            return(institucion);
        }
Esempio n. 20
0
        public Persona getPersonabyUser(int user, ref string mensaje)
        {
            Persona persona = new Persona();

            sql = new ConsultasSQL();
            sql.Comando.CommandType = CommandType.StoredProcedure;
            sql.Comando.CommandText = "pa_getPersonabyUser";
            sql.Comando.Parameters.AddWithValue("@UsuarioID", user);

            try
            {
                IDataReader reader = sql.EjecutaReader(ref mensaje);
                while (reader.Read())
                {
                    persona = Persona.CreatePersonaFromDataRecord(reader);
                }
            }
            catch (Exception ex)
            {
                mensaje = ex.Message;
            }

            return(persona);
        }