public CurriculumVitaeBE ObtenerCVByPostulante(int codigoPostulante)
        {
            dbRRHH = new DataBaseDA();
            CurriculumVitaeBE curriculum = null;

            try
            {
                qSQL = "SPS_CV_BY_POSTULANTE";
                using (MySqlCommand cmd = new MySqlCommand(qSQL, dbRRHH.getConnectionMysql()))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@CODIGO", codigoPostulante);
                    cmd.Connection.Open();
                    MySqlDataReader rd = cmd.ExecuteReader();
                    while (rd.Read())
                    {
                        curriculum                  = new CurriculumVitaeBE();
                        curriculum.ID               = (Int32)rd[0];
                        curriculum.Profesion        = rd[1].ToString() != "" ? (String)rd[1] : "";
                        curriculum.NivelAcademico   = rd[2].ToString() != "" ? (String)rd[2] : "";
                        curriculum.CentroDeEstudios = rd[3].ToString() != "" ? (String)rd[3] : "";
                        curriculum.Anio             = rd[4].ToString() != "" ? (Int32)rd[4] : 0;

                        curriculum.Trabajo1   = rd[5].ToString() != "" ? (String)rd[5] : "";
                        curriculum.Periodo1   = rd[6].ToString() != "" ? (String)rd[6] : "";
                        curriculum.Funciones1 = rd[7].ToString() != "" ? (String)rd[7] : "";
                        curriculum.Trabajo2   = rd[8].ToString() != "" ? (String)rd[8] : "";
                        curriculum.Periodo2   = rd[9].ToString() != "" ? (String)rd[9] : "";
                        curriculum.Funciones2 = rd[10].ToString() != "" ? (String)rd[10] : "";
                        curriculum.Trabajo3   = rd[11].ToString() != "" ? (String)rd[11] : "";
                        curriculum.Periodo3   = rd[12].ToString() != "" ? (String)rd[12] : "";
                        curriculum.Funciones3 = rd[13].ToString() != "" ? (String)rd[13] : "";
                    }

                    if (rd != null && rd.IsClosed == false)
                    {
                        rd.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dbRRHH = null;
            }

            return(curriculum);
        }
Beispiel #2
0
        public ColaboradorBE GetColaboradorByID(int codigo, int codigoUsuario)
        {
            dbRRHH = new DataBaseDA();
            ColaboradorBE item = null;

            try
            {
                qSQL = "SPS_COLABORADORBYID";
                using (MySqlCommand cmd = new MySqlCommand(qSQL, dbRRHH.getConnectionMysql()))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@CODIGO", codigo);
                    cmd.Parameters.AddWithValue("@CODUSUARIO", codigoUsuario);
                    cmd.Connection.Open();
                    MySqlDataReader rd     = cmd.ExecuteReader();
                    int             pCodCV = 0;
                    while (rd.Read())
                    {
                        item    = new ColaboradorBE();
                        item.ID = (Int32)rd[0];
                        item.ApellidoPaterno = rd[1].ToString() != "" ? (String)rd[1] : "";
                        item.ApellidoMaterno = rd[2].ToString() != "" ? (String)rd[2] : "";
                        item.Nombres         = rd[3].ToString() != "" ? (String)rd[3] : "";
                        item.DNI             = rd[4].ToString() != "" ? (String)rd[4] : "";
                        item.FechaNacimiento = Convert.ToDateTime(rd[5]);
                        item.Sexo            = rd[6].ToString() != "" ? (String)rd[6] : "";
                        item.Direccion       = rd[7].ToString() != "" ? (String)rd[7] : "";
                        item.Telefono        = rd[8].ToString() != "" ? (String)rd[8] : "";
                        item.Correo          = rd[9].ToString() != "" ? (String)rd[9] : "";
                        item.EstadoCivil     = rd[10].ToString() != "" ? (String)rd[10] : "";
                        item.CantidadHijos   = (Int32)rd[11];
                        item.Seguro          = rd[12].ToString() != "" ? (String)rd[12] : "";
                        item.CodigoEssalud   = rd[13].ToString() != "" ? (String)rd[13] : "";
                        item.FechaCese       = Convert.ToDateTime(rd[14]);
                        item.Antecedente     = rd[15].ToString() != "" ? (String)rd[15] : "";
                        pCodCV = Convert.ToInt32(rd[16]);
                        CurriculumVitaeBE cv = new CurriculumVitaeDA().ObtenerCVByPostulante(pCodCV);
                        if (cv == null)
                        {
                            cv = new CurriculumVitaeBE()
                            {
                                ID = pCodCV
                            };
                        }
                        item.CurriculumVitaeDetalle = cv;
                        item.RindioExamen           = Convert.ToInt32(rd[17]);
                        item.PuntajeExamen          = rd[18].ToString() != "" ? (Int32)rd[18] : 0;
                        item.Foto = rd[19].ToString() != "" ? rd[19].ToString() : "";
                    }

                    if (rd != null && rd.IsClosed == false)
                    {
                        rd.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dbRRHH = null;
            }

            return(item);
        }
Beispiel #3
0
        public List <ColaboradorBE> ListaPostulanteByConvocatoria(int codigo)
        {
            dbRRHH = new DataBaseDA();
            List <ColaboradorBE> lista = new List <ColaboradorBE>();

            try
            {
                qSQL = "SPS_POSTULANTES_BY_CONVOCATORIA";
                using (MySqlCommand cmd = new MySqlCommand(qSQL, dbRRHH.getConnectionMysql()))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@CODIGO", codigo);
                    cmd.Connection.Open();
                    MySqlDataReader rd = cmd.ExecuteReader();
                    while (rd.Read())
                    {
                        ColaboradorBE item = new ColaboradorBE();
                        item.ID = (Int32)rd[0];
                        item.ApellidoPaterno = rd[1].ToString() != "" ? (String)rd[1] : "";
                        item.ApellidoMaterno = rd[2].ToString() != "" ? (String)rd[2] : "";
                        item.Nombres         = rd[3].ToString() != "" ? (String)rd[3] : "";
                        item.DNI             = rd[4].ToString() != "" ? (String)rd[4] : "";
                        item.FechaNacimiento = Convert.ToDateTime(rd[5]);
                        item.Sexo            = rd[6].ToString() != "" ? (String)rd[6] : "";
                        item.Direccion       = rd[7].ToString() != "" ? (String)rd[7] : "";
                        item.Telefono        = rd[8].ToString() != "" ? (String)rd[8] : "";
                        item.Correo          = rd[9].ToString() != "" ? (String)rd[9] : "";
                        item.EstadoCivil     = rd[10].ToString() != "" ? (String)rd[10] : "";
                        item.CantidadHijos   = (Int32)rd[11];
                        item.Seguro          = rd[12].ToString() != "" ? (String)rd[12] : "";
                        item.CodigoEssalud   = rd[13].ToString() != "" ? (String)rd[13] : "";
                        item.FechaCese       = Convert.ToDateTime(rd[14]);
                        item.Antecedente     = rd[15].ToString() != "" ? (String)rd[15] : "";

                        CurriculumVitaeBE cv = new CurriculumVitaeBE();
                        cv.ID = Convert.ToInt32(rd[16]);

                        item.CurriculumVitaeDetalle = cv;
                        item.RindioExamen           = Convert.ToInt32(rd[17]);
                        item.PuntajeExamen          = rd[18].ToString() != "" ? (Int32)rd[18] : 0;

                        ParametroBE estadoAceptacion = new ParametroBE();
                        estadoAceptacion.Codigo      = rd[19].ToString() != "" ? (Int32)rd[19] : 0;
                        estadoAceptacion.Descripcion = rd[20].ToString() != "" ? (String)rd[20] : "";
                        item.EstadoAceptacion        = estadoAceptacion;

                        UsuarioBE usuario = new UsuarioBE();
                        usuario.CodigoUsuario = rd[21].ToString() != "" ? (Int32)rd[21] : 0;
                        item.Usuario          = usuario;

                        lista.Add(item);
                    }

                    if (rd != null && rd.IsClosed == false)
                    {
                        rd.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dbRRHH = null;
            }

            return(lista);
        }