コード例 #1
0
ファイル: frmConsultaRH.aspx.cs プロジェクト: tinovo/Sitio
 protected void BuscarEmp_Click(object sender, EventArgs e)
 {
     // String numeroempleado = TextNoEmp.ToString();
     TablaEmpleados empleadosEbs = new TablaEmpleados();
     DataTable table = empleadosEbs.empleadogrid(TextNoEmp.Text);
     GridViewXemp.DataSource = table;
     GridViewXemp.DataBind();
     panel3.Visible = true;
     ButtonExp.Visible = true;
     panel1.Visible = false;
     panel2.Visible = false;
     botonExportar.Visible = false;
     panel4.Visible = false;
     LinkBCGral.Visible = false;
 }
コード例 #2
0
ファイル: frmCapacitacion.aspx.cs プロジェクト: tinovo/Sitio
        //para el boton de buscar cuando ya tiene el numero del empleado
        protected void ctrBuscar_Click(object sender, EventArgs e)
        {
            //DEVUELVE LOS VALORES DEL EBS
            this.capitalHumano = new NegocioCapitalHumano();

            TablaEmpleados empleadosEbs = new TablaEmpleados();
            List<Employee> listaEmpleados = capitalHumano.ListaEmpleados2(txtNoEmpleado.Text, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));

            //----para validar que no venga vacio los datos y marque error
            if (listaEmpleados == null)
            {
                MensajeErrorFiltros(capitalHumano.Log);
                panel1.Visible = false;
                panel3.Visible = false;
                return;
            }
            else
            {
                TxtEmpleado.Text = listaEmpleados[0].NombreCompleto.ToString();
                txtDepartamento.Text = listaEmpleados[0].Organizacion.ToString();
                tNoEmpleado = TxtEmpleado.Text;
                panel1.Visible = true;
                panel3.Visible = true;
            }

        }
コード例 #3
0
ファイル: frmConsultaRH.aspx.cs プロジェクト: tinovo/Sitio
        public void renderChart()
        {
            usuario.Text = (string)(Session["Nombre"]);
            var posvec = new List<string>();
            var valorvec = new List<string>();
            using (SqlConnection cnx2 = new SqlConnection(connectionString))
            {
                cnx2.Open();
                string query1 = " SELECT  idposicion, total_depto, iduser, id_partida " +
                               " FROM    EVA_C_GRAFICA " +
                               " WHERE   (iduser = '******') " +
                               " ORDER BY idposicion ";
                SqlCommand cmd = new SqlCommand(query1, cnx2);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        totaldepto.Text = dr["total_depto"].ToString();
                        idposicion.Text = dr["idposicion"].ToString();

                        posvec.Add(totaldepto.Text);
                        valorvec.Add(idposicion.Text);

                    }
                }
                else
                {
                    posvec[0] = "0";
                    posvec[1] = "0";
                    posvec[2] = "0";
                    posvec[3] = "0";
                    posvec[4] = "0";
                    posvec[5] = "0";
                    posvec[6] = "0";
                    posvec[7] = "0";
                    posvec[8] = "0";
                }
            }   // cierre de la conn

            //para ver si esta vacio
            using (SqlConnection cnx2 = new SqlConnection(connectionString))
            {
                cnx2.Open();
                string query1 = " SELECT  sum(total_depto) as sumatotal " +
                               " FROM    EVA_C_GRAFICA " +
                               " WHERE   (iduser = '******') ";
                SqlCommand cmd = new SqlCommand(query1, cnx2);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        totaldepto.Text = dr["sumatotal"].ToString();

                    }
                }
            }//using

            if (Convert.ToInt32(totaldepto.Text) == 0)
            {
                posvec[0] = "0";
                posvec[1] = "0";
                posvec[2] = "0";
                posvec[3] = "0";
                posvec[4] = "0";
                posvec[5] = "0";
                posvec[6] = "0";
                posvec[7] = "0";
                posvec[8] = "0";
            }

            JavaScriptSerializer jss = new JavaScriptSerializer();
            chartDatax = jss.Serialize(posvec[0]);
            JavaScriptSerializer jss2 = new JavaScriptSerializer();
            chartData2 = jss2.Serialize(posvec[1]);
            JavaScriptSerializer jss3 = new JavaScriptSerializer();
            chartData3 = jss3.Serialize(posvec[2]);
            JavaScriptSerializer jss4 = new JavaScriptSerializer();
            chartData4 = jss4.Serialize(posvec[3]);
            JavaScriptSerializer jss5 = new JavaScriptSerializer();
            chartData5 = jss5.Serialize(posvec[4]);
            JavaScriptSerializer jss6 = new JavaScriptSerializer();
            chartData6 = jss6.Serialize(posvec[5]);
            JavaScriptSerializer jss7 = new JavaScriptSerializer();
            chartData7 = jss7.Serialize(posvec[6]);
            JavaScriptSerializer jss8 = new JavaScriptSerializer();
            chartData8 = jss8.Serialize(posvec[7]);
            JavaScriptSerializer jss9 = new JavaScriptSerializer();
            chartData9 = jss9.Serialize(posvec[8]); //this make your list in jSON format like [88,99,10]

            using (SqlConnection cnx2 = new SqlConnection(connectionString))
            {
                cnx2.Open();
                string query1 = " SELECT   id_partida, id_eva, cal_valores, cal_indicadores, posicion, usuario " +
                               " FROM    EVA_D_GRAFICA " +
                               " WHERE   (usuario = '" + usuario.Text + "') ";
                SqlCommand cmd = new SqlCommand(query1, cnx2);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        ideva.Text = dr["id_eva"].ToString();
                        cal_valores.Text = dr["cal_valores"].ToString();
                        cal_indicador.Text = dr["cal_indicadores"].ToString();
                        posicion.Text = dr["posicion"].ToString();
                    }
                }
            }//using


            //saco los valores del la evaluacion cuando critico
            using (SqlConnection cnx = new SqlConnection(connectionString))
            {
                cnx.Open();
                string query = " SELECT   id_partida, id_eva, cal_valores, cal_indicadores, posicion, usuario, idempleado " +
                               " FROM    EVA_D_GRAFICA " +
                               " WHERE   (usuario = '" + usuario.Text + "') and posicion<>'-' " +
                               " and posicion in ('ab1') order by posicion ";
                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        idemp.Text = dr["idempleado"].ToString();
                        posicion.Text = dr["posicion"].ToString();

                        //DEVUELVE LOS VALORES DEL EBS
                        this.capitalhumano = new NegocioCapitalHumano();
                        TablaEmpleados empleadosEbs = new TablaEmpleados();
                        try
                        {
                            List<Employee> listaEmpleados = capitalhumano.ListaEmpleados(idemp.Text, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));
                            nombreemp.Text = listaEmpleados[0].NombreCompleto.ToString();
                        }
                        catch (Exception e3)
                        {
                            throw e3;
                        }
                        empcritico.Text = empcritico.Text + "<br>" + nombreemp.Text;

                    }
                }
                else
                {
                    idemp.Text = "No se encontro empleado";
                }
            }   // cierre de la conn

            //saco los valores del la evaluacion cuando necesitan
            using (SqlConnection cnx = new SqlConnection(connectionString))
            {
                cnx.Open();
                string query = " SELECT   id_partida, id_eva, cal_valores, cal_indicadores, posicion, usuario, idempleado " +
                               " FROM    EVA_D_GRAFICA " +
                               " WHERE   (usuario = '" + usuario.Text + "') and posicion<>'-' " +
                               " and posicion in ('ab2','ab3','cc1','cd1') order by posicion ";
                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        idemp.Text = dr["idempleado"].ToString();
                        posicion.Text = dr["posicion"].ToString();

                        //DEVUELVE LOS VALORES DEL EBS
                        this.capitalhumano = new NegocioCapitalHumano();
                        TablaEmpleados empleadosEbs = new TablaEmpleados();
                        try
                        {
                            List<Employee> listaEmpleados = capitalhumano.ListaEmpleados(idemp.Text, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));
                            nombreemp.Text = listaEmpleados[0].NombreCompleto.ToString();
                        }
                        catch (Exception e3)
                        {
                            throw e3;
                        }
                        empnec.Text = empnec.Text + "<br>" + nombreemp.Text;

                    }
                }
                else
                {
                    idemp.Text = "No se encontro empleado";
                }
            }   // cierre de la conn
            //saco los valores del la evaluacion cuando reconocer
            using (SqlConnection cnx = new SqlConnection(connectionString))
            {
                cnx.Open();
                string query = " SELECT   id_partida, id_eva, cal_valores, cal_indicadores, posicion, usuario, idempleado " +
                               " FROM    EVA_D_GRAFICA " +
                               " WHERE   (usuario = '" + usuario.Text + "') and posicion<>'-' " +
                               " and posicion in ('cd2','cc2','cc3') order by posicion ";
                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        idemp.Text = dr["idempleado"].ToString();
                        posicion.Text = dr["posicion"].ToString();
                        nombreemp.Text = "";

                        //DEVUELVE LOS VALORES DEL EBS
                        this.capitalhumano = new NegocioCapitalHumano();
                        TablaEmpleados empleadosEbs = new TablaEmpleados();

                        List<Employee> listaEmpleados = capitalhumano.ListaEmpleados(idemp.Text, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));
                        if (listaEmpleados == null)
                        {
                            nombreemp.Text = "";
                        }
                        else
                        {
                            nombreemp.Text = listaEmpleados[0].NombreCompleto.ToString();
                        }

                        empreconocer.Text = empreconocer.Text + "<br>" + nombreemp.Text;

                    }
                }
                else
                {
                    idemp.Text = "No se encontro empleado";
                }
            }   // cierre de la conn

            //saco los valores del la evaluacion cuando retener
            using (SqlConnection cnx = new SqlConnection(connectionString))
            {
                cnx.Open();
                string query = " SELECT   id_partida, id_eva, cal_valores, cal_indicadores, posicion, usuario, idempleado " +
                               " FROM    EVA_D_GRAFICA " +
                               " WHERE   (usuario = '" + usuario.Text + "') and posicion<>'-' " +
                               " and posicion in ('cd3') order by posicion ";
                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        idemp.Text = dr["idempleado"].ToString();
                        posicion.Text = dr["posicion"].ToString();

                        //DEVUELVE LOS VALORES DEL EBS
                        this.capitalhumano = new NegocioCapitalHumano();
                        TablaEmpleados empleadosEbs = new TablaEmpleados();
                        try
                        {
                            List<Employee> listaEmpleados = capitalhumano.ListaEmpleados(idemp.Text, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));
                            nombreemp.Text = listaEmpleados[0].NombreCompleto.ToString();
                        }
                        catch (Exception e3)
                        {
                            throw e3;
                        }
                        empretener.Text = empretener.Text + "<br>" + nombreemp.Text;

                    }
                }
                else
                {
                    idemp.Text = "No se encontro empleado";
                }
            }   // cierre de la conn



        }
コード例 #4
0
ファイル: frmEditarFotoCH.aspx.cs プロジェクト: tinovo/Sitio
        public void ctrBuscar_Click(object sender, EventArgs e)
        {
            this.capitalHumano = new NegocioCapitalHumano();

            TablaEmpleados empleadosEbs = new TablaEmpleados();
            List<Employee> listaEmpleados = capitalHumano.ListaEmpleados2(txtNoEmpleado.Text, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));

            //----para validar que no venga vacio los datos y marque error
            if (listaEmpleados == null)
            {
                MensajeErrorFiltros(capitalHumano.Log);
                panel3.Visible = false;
                TxtNombEmpleado.Text = "";
                return;
            }
            else
            {
                TxtNombEmpleado.Text = listaEmpleados[0].NombreCompleto.ToString();
                panel3.Visible = true;
                BuscarFoto();
            }
        }
コード例 #5
0
ファイル: RecursosHumanos.cs プロジェクト: tinovo/Sitio
        public List<Employee> ListaPuestosEBS(string parNumeroEmpleado,
                                                   string parTipo,
                                                   string parPrimerNombre,
                                                   string parSegundoNombre,
                                                   string parApellidoPaterno,
                                                   string parApellidoMaterno,
                                                   string parGeneroClave,
                                                   string parZona,
                                                   string parCompañia,
                                                   string parPuestoClave,
                                                   string parDepartamentoClave,
                                                   DateTime parContratacionInicio,
                                                   DateTime parContratacionFin)
        {
            TablaEmpleados tablaEmpleados = new TablaEmpleados();

            List<Employee> listaEmpleados = tablaEmpleados.ObtenerPUESTOSEbs(parNumeroEmpleado,
                                        parTipo,
                                        parPrimerNombre,
                                        parSegundoNombre,
                                        parApellidoPaterno,
                                        parApellidoMaterno,
                                        parGeneroClave,
                                        parZona,
                                        parCompañia,
                                        parPuestoClave,
                                        parDepartamentoClave,
                                        parContratacionInicio,
                                        parContratacionFin);

            if (listaEmpleados != null)
            {
                this.log = "Se encontraron " + tablaEmpleados.Log + " empleados";
                return listaEmpleados;
            }
            else
            {
                if (tablaEmpleados.Log == "VACIO")
                {
                    this.log = "No se encontraro empleados con los siguientes filtros: " + "\n" +
                                "\t Primer Nombre: " + parPrimerNombre + ", \r" +
                                "\t Segundo Nombre: " + parSegundoNombre + ", \r" +
                                "\t Apellido Paterno: " + parApellidoPaterno + ", \r" +
                                "\t Apellido Materno: " + parApellidoMaterno + ", \r" +
                                "\t Numero: " + parNumeroEmpleado + ", \r" +
                                "\t Tipo: " + parTipo + ", \r" +
                                "\t Genero: " + parGeneroClave + ", \r" +
                                "\t Zona: " + parZona + ", \r" +
                                "\t Compañia: " + parCompañia + ", \r" +
                                "\t Puesto: " + parPuestoClave + ", \r" +
                                "\t Departamento: " + parDepartamentoClave + ", \r" +
                                "\t Contratacion del: " + parContratacionInicio + ", \r" +
                                "\t al: " + parContratacionFin;
                }
                else
                {
                    this.log = tablaEmpleados.Log;
                }

                return null;
            }
        }
コード例 #6
0
ファイル: frmConsultaRH.aspx.cs プロジェクト: tinovo/Sitio
        public DataTable GetData()
        {


            //string idemp;
            //idemp = (string)(Session["EmpleadoID[]"]);

            //for (int i = 0; i < idemp.Length; i++)
            //{

            String idOrganizationEBS = lista_depto.SelectedValue.ToString();
            TablaEmpleados empleadosEbs = new TablaEmpleados();
            DataTable table = empleadosEbs.empleadoxdepto(idOrganizationEBS);
            DataTable dt = new DataTable();

            // DataTable table = GetTable(); // Get the data table.  Recorro el array para sacar todos los empleados
            foreach (DataRow row in table.Rows) // Loop over the rows.
            {
                // Console.WriteLine("--- Row ---"); // Print separator.
                foreach (var item in row.ItemArray) // Loop over the items.
                {
                    //Console.Write("Item: "); // Print label.
                    // Console.WriteLine(item); // Invokes ToString abstract method.

                    string connectionString = ConfigurationManager.ConnectionStrings["conexionAPPS"].ConnectionString;
                    //guardo los valores del empleado

                    using (SqlConnection connection = new SqlConnection(connectionString))
                    {
                        using (SqlCommand command = new SqlCommand("SELECT { fn IFNULL(MAX(c.id_eva), 0) } AS id_eva, { fn IFNULL(SUM(d.calificacion_val_jefe),0) } AS total_puntaje " +
                                                                    "FROM   EVA_C_EVALUACION as c, EVA_D_EVALUACION as d, EVA_PLANTILLAS as p " +
                                                                    "WHERE  (c.id_emp IN ('" + item + "')) and c.estatus='2' and p.vigencia_plant='1' and p.id_plantilla=d.id_plantilla " +
                                                                    "and c.id_eva=d.id_eva ", connection))
                        {
                            connection.Open();
                            using (SqlDataReader dr = command.ExecuteReader())
                            {
                                if (dr.HasRows)
                                {
                                    dt.Load(dr);
                                }
                            }
                        }
                    }

                }
            }
            //}

            return dt;
        }
コード例 #7
0
ファイル: frmConsultaRH.aspx.cs プロジェクト: tinovo/Sitio
        protected void Buscar_Click(object sender, EventArgs e)
        {
            panel1.Visible = true;
            botonExportar.Visible = true;
            ButtonExp.Visible = false;
            panel3.Visible = false;
            if ((lista_depto.SelectedValue.ToString() == "0"))
            {
                //MensajeError("Debes de Seleccionar el Departamento");
                panel1.Visible = false;
                panel2.Visible = false;
                botonExportar.Visible = false;
                return;
            }
            //else 
            //{
            String idOrganizationEBS = lista_depto.SelectedValue.ToString();
            TablaEmpleados empleadosEbs = new TablaEmpleados();
            DataTable table = empleadosEbs.empleadoxdepto(idOrganizationEBS);
            if (table == null)
            {
                MensajeError("Null empleadoxdepto");
                return;
            }


            gridBuscar.DataSource = table;
            gridBuscar.DataBind();
            panel2.Visible = true;
            int contadorpos;
            //panel3.Visible = true;
            //panel2.Visible = true;
            //string idplantilla;
            //---BORRO la CONSULTA ANTERIOR
            usuario.Text = (string)(Session["Nombre"]);
            empcritico.Text = "";
            empnec.Text = "";
            empreconocer.Text = "";
            empretener.Text = "";

            using (SqlConnection cnxdel = new SqlConnection(connectionString))
            {
                cnxdel.Open();
                string query_del = " DELETE FROM   EVA_C_GRAFICA " +
                                   " WHERE iduser= '******' ";
                SqlCommand cmdd = new SqlCommand(query_del, cnxdel);
                SqlDataReader drd = cmdd.ExecuteReader();
            }
            using (SqlConnection cnxdel = new SqlConnection(connectionString))
            {
                cnxdel.Open();
                string query_del = " DELETE FROM EVA_D_GRAFICA " +
                                   " WHERE usuario= '" + usuario.Text + "' ";
                SqlCommand cmdd = new SqlCommand(query_del, cnxdel);
                SqlDataReader drd = cmdd.ExecuteReader();
            }

            //saco la plantillas
            using (SqlConnection cnx = new SqlConnection(connectionString))
            {
                cnx.Open();
                string query = "SELECT id_plantilla FROM EVA_PLANTILLAS WHERE (vigencia_plant = '1')";
                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        idplantilla.Text = dr["id_plantilla"].ToString();
                    }
                }
                else
                {
                    idplantilla.Text = "No se encontro plantilla autorizada";
                }

            }   // cierre de la conn

            DataTable dt = new DataTable();
            TablaEmpleados empleadosEbs2 = new TablaEmpleados();

            DataTable table2 = empleadosEbs2.empleadoxdeptoID(idOrganizationEBS);

            if (table2 != null)
            {

                foreach (DataRow row in table2.Rows) // Loop over the rows.
                {
                    foreach (var item in row.ItemArray) // Loop over the items.
                    {

                        using (SqlConnection cnx = new SqlConnection(connectionString))
                        {
                            cnx.Open();
                            string query = " select  count(c.id_eva) as total, c.id_eva " +
                                           " from EVA_C_EVALUACION as c, EVA_D_EVALUACION as d " +
                                           " where c.id_emp='" + item + "' and c.estatus='2' and c.id_eva=d.id_eva and d.id_plantilla='" + idplantilla.Text + "' " +
                                           " group by c.id_eva ";
                            SqlCommand cmd = new SqlCommand(query, cnx);
                            SqlDataReader dr = cmd.ExecuteReader();

                            if (dr.HasRows)
                            {
                                while (dr.Read())
                                {
                                    evaluacionid.Text = dr["id_eva"].ToString();
                                }
                            }
                            else
                            {
                                evaluacionid.Text = "0";
                            }
                        }   // cierre de la conn


                        if (evaluacionid.Text != "0")
                        {
                            using (SqlConnection cnx = new SqlConnection(connectionString))
                            {
                                // estatus=2 cuando la evaluacion ha sido liberada por jefe inmediato
                                cnx.Open();
                                string query = " select {fn IFNULL(SUM(calificacion_val_jefe),0)} AS total_puntaje_valores " +
                                               " from EVA_C_EVALUACION as e, EVA_D_EVALUACION as d " +
                                               " where e.id_eva='" + evaluacionid.Text + "' and e.estatus='2' and d.id_plantilla='" + idplantilla.Text + "'  and e.id_eva=d.id_eva ";
                                SqlCommand cmd = new SqlCommand(query, cnx);
                                SqlDataReader dr = cmd.ExecuteReader();

                                if (dr.HasRows)
                                {
                                    while (dr.Read())
                                    {
                                        total_valores.Text = dr["total_puntaje_valores"].ToString();
                                    }
                                }
                                else
                                {
                                    total_valores.Text = "0";
                                }


                            }   // cierre de la conn
                            if (total_valores.Text != "0")
                            {
                                using (SqlConnection cnx = new SqlConnection(connectionString))
                                {
                                    cnx.Open();
                                    string query = " select {fn IFNULL(SUM(ponderacion_ind_jefe),0)} AS total_puntaje_indicadores " +
                                                   " from EVA_C_EVALUACION as e, EVA_D_INDICADORES as d " +
                                                   " where e.id_eva='" + evaluacionid.Text + "' and e.estatus='2' and d.id_plantilla='" + idplantilla.Text + "'  " +
                                                   " and e.id_eva=d.id_eva ";
                                    SqlCommand cmd = new SqlCommand(query, cnx);
                                    SqlDataReader dr = cmd.ExecuteReader();

                                    if (dr.HasRows)
                                    {
                                        while (dr.Read())
                                        {
                                            total_valores_ind.Text = dr["total_puntaje_indicadores"].ToString();
                                        }
                                    }
                                    else
                                    {
                                        total_valores_ind.Text = "No se encontro puntaje indicadores";
                                    }

                                }   // cierre de la conn

                                // para sacar la calificacion en Letra 
                                using (SqlConnection cnx = new SqlConnection(connectionString))
                                {
                                    cnx.Open();
                                    string query2 = " SELECT ponderacion_kpi, calificacion_kpi, descripcion_kpi " +
                                                    " FROM   EVA_C_CALIFICACION_KPI " +
                                                    " WHERE  ponderacion_kpi <=  '" + total_valores_ind.Text + "' order by 1 ";
                                    SqlCommand cmd2 = new SqlCommand(query2, cnx);

                                    SqlDataReader dr2 = cmd2.ExecuteReader();

                                    if (dr2.HasRows)
                                    {
                                        while (dr2.Read())
                                        {
                                            cal_indicador.Text = dr2["calificacion_kpi"].ToString();
                                        }
                                    }
                                    else
                                    {
                                        //MensajeError("No se encontro Calificacion");
                                        return;
                                    }

                                }   // cierre de la conn
                                //--------------PARA GUARDAR LA POSICION EN LA GRAFICA Y QUE POSICION CORRESPONDE--------------------------------------                    
                                //string posicion;
                                int contador_ab1, contador_cc1, contador_cd1, contador_ab2, contador_cc2, contador_cd2, contador_ab3, contador_cc3, contador_cd3;
                                contador_ab1 = 0;
                                contador_cc1 = 0;
                                contador_cd1 = 0;
                                contador_ab2 = 0;
                                contador_cc2 = 0;
                                contador_cd2 = 0;
                                contador_ab3 = 0;
                                contador_cc3 = 0;
                                contador_cd3 = 0;
                                if ((Convert.ToInt32(total_valores.Text) >= 1) && ((Convert.ToInt32(total_valores.Text.Trim())) <= 22))
                                {
                                    if (cal_indicador.Text.Trim() == "A" || cal_indicador.Text.Trim() == "B")
                                    {
                                        posicion.Text = "ab1";
                                        contador_ab1 = contador_ab1 + 1;
                                    }
                                    if (cal_indicador.Text.Trim() == "C-" || cal_indicador.Text.Trim() == "C")
                                    {
                                        posicion.Text = "cc1";
                                        contador_cc1 = contador_cc1 + 1;
                                    }
                                    if (cal_indicador.Text.Trim() == "C+" || cal_indicador.Text.Trim() == "D")
                                    {
                                        posicion.Text = "cd1";
                                        contador_cd1 = contador_cd1 + 1;
                                    }
                                    //aqui guardo para tener los datos
                                    using (SqlConnection cnx2 = new SqlConnection(connectionString))
                                    {
                                        cnx2.Open();
                                        string query = " insert EVA_D_GRAFICA (id_eva, cal_valores, cal_indicadores, posicion, usuario, idempleado) " +
                                                       " values ('" + evaluacionid.Text + "', '" + Convert.ToInt32(total_valores.Text) + "', '" + cal_indicador.Text + "', '" + posicion.Text + "', '" + usuario.Text + "' , '" + item + "' )";
                                        SqlCommand cmd = new SqlCommand(query, cnx2);
                                        SqlDataReader dr = cmd.ExecuteReader();
                                    }
                                }
                                else
                                {
                                    if ((Convert.ToInt32(total_valores.Text) >= 23) && (Convert.ToInt32(total_valores.Text.Trim()) <= 50))
                                    {
                                        if (cal_indicador.Text.Trim() == "A" || cal_indicador.Text.Trim() == "B")
                                        {
                                            posicion.Text = "ab2";
                                            contador_ab2 = contador_ab2 + 1;
                                        }
                                        if (cal_indicador.Text.Trim() == "C-" || cal_indicador.Text.Trim() == "C")
                                        {
                                            posicion.Text = "cc2";
                                            contador_cc2 = contador_cc2 + 1;
                                        }
                                        if (cal_indicador.Text.Trim() == "C+" || cal_indicador.Text.Trim() == "D")
                                        {
                                            posicion.Text = "cd2";
                                            contador_cd2 = contador_cd2 + 1;
                                        }
                                        //aqui guardo para tener los datos
                                        using (SqlConnection cnx2 = new SqlConnection(connectionString))
                                        {
                                            cnx2.Open();
                                            string query = " insert EVA_D_GRAFICA (id_eva, cal_valores, cal_indicadores, posicion, usuario, idempleado) " +
                                                           " values ('" + evaluacionid.Text + "', '" + Convert.ToInt32(total_valores.Text) + "', '" + cal_indicador.Text + "', '" + posicion.Text + "', '" + usuario.Text + "', '" + item + "' )";
                                            SqlCommand cmd = new SqlCommand(query, cnx2);
                                            SqlDataReader dr = cmd.ExecuteReader();
                                        }

                                    }
                                    else
                                    {
                                        if ((Convert.ToInt32(total_valores.Text) >= 51) && (Convert.ToInt32(total_valores.Text.Trim()) <= 54))
                                        {
                                            if (cal_indicador.Text.Trim() == "A" || cal_indicador.Text.Trim() == "B")
                                            {
                                                posicion.Text = "ab3";
                                                contador_ab3 = contador_ab3 + 1;
                                            }
                                            if (cal_indicador.Text.Trim() == "C-" || cal_indicador.Text.Trim() == "C")
                                            {
                                                posicion.Text = "cc3";
                                                contador_cc3 = contador_cc3 + 1;
                                            }
                                            if (cal_indicador.Text.Trim() == "C+" || cal_indicador.Text.Trim() == "D")
                                            {
                                                posicion.Text = "cd3";
                                                contador_cd3 = contador_cd3 + 1;
                                            }
                                            //aqui guardo para tener los datos
                                            using (SqlConnection cnx2 = new SqlConnection(connectionString))
                                            {
                                                cnx2.Open();
                                                string query = " insert EVA_D_GRAFICA (id_eva, cal_valores, cal_indicadores, posicion, usuario, idempleado) " +
                                                               " values ('" + evaluacionid.Text + "', '" + Convert.ToInt32(total_valores.Text) + "', '" + cal_indicador.Text + "', '" + posicion.Text + "', '" + usuario.Text + "', '" + item + "') ";
                                                SqlCommand cmd = new SqlCommand(query, cnx2);
                                                SqlDataReader dr = cmd.ExecuteReader();
                                            }
                                        }
                                    }

                                }
                            }
                            //---------------------------------------------------------------------------------------------------------------------


                        } // termina el if de total_valores.Text
                        else
                        {
                            // sino tiene total de valores en 0
                            //aqui guardo para tener los datos
                            using (SqlConnection cnx2 = new SqlConnection(connectionString))
                            {
                                cnx2.Open();
                                string query = " insert EVA_D_GRAFICA (id_eva, cal_valores, cal_indicadores, posicion, usuario) " +
                                                " values ('" + evaluacionid.Text + "', '0', '0', '-', '" + usuario.Text + "') ";
                                SqlCommand cmd = new SqlCommand(query, cnx2);
                                SqlDataReader dr = cmd.ExecuteReader();
                            }


                        }
                    }
                }

            }
            else
            {
                MensajeError("Null -empleadoxdeptoID");
                return;
            }

            // AQUI GUARDO LOS RESULTADOS
            contadorpos = 0;

            while (contadorpos <= 8)
            {

                if (contadorpos == 0)
                {
                    using (SqlConnection cnx3 = new SqlConnection(connectionString))
                    {
                        cnx3.Open();
                        string query3 = " insert EVA_C_GRAFICA (idposicion, total_depto, iduser) " +
                                        " values ('ab1', 0, '" + usuario.Text + "') ";
                        SqlCommand cmd3 = new SqlCommand(query3, cnx3);
                        SqlDataReader dr3 = cmd3.ExecuteReader();
                    }
                }
                if (contadorpos == 1)
                {
                    using (SqlConnection cnx3 = new SqlConnection(connectionString))
                    {
                        cnx3.Open();
                        string query3 = " insert EVA_C_GRAFICA (idposicion, total_depto, iduser) " +
                                        " values ('ab2', 0, '" + usuario.Text + "') ";
                        SqlCommand cmd3 = new SqlCommand(query3, cnx3);
                        SqlDataReader dr3 = cmd3.ExecuteReader();
                    }
                }
                if (contadorpos == 2)
                {
                    using (SqlConnection cnx3 = new SqlConnection(connectionString))
                    {
                        cnx3.Open();
                        string query3 = " insert EVA_C_GRAFICA (idposicion, total_depto, iduser) " +
                                        " values ('ab3', 0, '" + usuario.Text + "') ";
                        SqlCommand cmd3 = new SqlCommand(query3, cnx3);
                        SqlDataReader dr3 = cmd3.ExecuteReader();
                    }
                }
                if (contadorpos == 3)
                {
                    using (SqlConnection cnx3 = new SqlConnection(connectionString))
                    {
                        cnx3.Open();
                        string query3 = " insert EVA_C_GRAFICA (idposicion, total_depto, iduser) " +
                                        " values ('cc1', 0, '" + usuario.Text + "') ";
                        SqlCommand cmd3 = new SqlCommand(query3, cnx3);
                        SqlDataReader dr3 = cmd3.ExecuteReader();
                    }
                }
                if (contadorpos == 4)
                {
                    using (SqlConnection cnx3 = new SqlConnection(connectionString))
                    {
                        cnx3.Open();
                        string query3 = " insert EVA_C_GRAFICA (idposicion, total_depto, iduser) " +
                                        " values ('cc2', 0, '" + usuario.Text + "') ";
                        SqlCommand cmd3 = new SqlCommand(query3, cnx3);
                        SqlDataReader dr3 = cmd3.ExecuteReader();
                    }
                }
                if (contadorpos == 5)
                {
                    using (SqlConnection cnx3 = new SqlConnection(connectionString))
                    {
                        cnx3.Open();
                        string query3 = " insert EVA_C_GRAFICA (idposicion, total_depto, iduser) " +
                                        " values ('cc3', 0, '" + usuario.Text + "') ";
                        SqlCommand cmd3 = new SqlCommand(query3, cnx3);
                        SqlDataReader dr3 = cmd3.ExecuteReader();
                    }
                }
                if (contadorpos == 6)
                {
                    using (SqlConnection cnx3 = new SqlConnection(connectionString))
                    {
                        cnx3.Open();
                        string query3 = " insert EVA_C_GRAFICA (idposicion, total_depto, iduser) " +
                                        " values ('cd1', 0, '" + usuario.Text + "') ";
                        SqlCommand cmd3 = new SqlCommand(query3, cnx3);
                        SqlDataReader dr3 = cmd3.ExecuteReader();
                    }
                }
                if (contadorpos == 7)
                {
                    using (SqlConnection cnx3 = new SqlConnection(connectionString))
                    {
                        cnx3.Open();
                        string query3 = " insert EVA_C_GRAFICA (idposicion, total_depto, iduser) " +
                                        " values ('cd2', 0, '" + usuario.Text + "') ";
                        SqlCommand cmd3 = new SqlCommand(query3, cnx3);
                        SqlDataReader dr3 = cmd3.ExecuteReader();
                    }
                }
                if (contadorpos == 8)
                {
                    using (SqlConnection cnx3 = new SqlConnection(connectionString))
                    {
                        cnx3.Open();
                        string query3 = " insert EVA_C_GRAFICA (idposicion, total_depto, iduser) " +
                                        " values ('cd3', 0, '" + usuario.Text + "') ";
                        SqlCommand cmd3 = new SqlCommand(query3, cnx3);
                        SqlDataReader dr3 = cmd3.ExecuteReader();
                    }
                }
                contadorpos = contadorpos + 1;

            }


            using (SqlConnection cnx = new SqlConnection(connectionString))
            {
                cnx.Open();
                string query2 = " SELECT  COUNT(posicion) AS total, posicion " +
                                " FROM    EVA_D_GRAFICA " +
                                " WHERE   (usuario = '" + usuario.Text + "') " +
                                " GROUP BY posicion ORDER BY 2";
                SqlCommand cmd2 = new SqlCommand(query2, cnx);

                SqlDataReader dr2 = cmd2.ExecuteReader();

                if (dr2.HasRows)
                {
                    while (dr2.Read())
                    {
                        Txtposicion.Text = dr2["posicion"].ToString();
                        //total_pos.Text = dr2["total"].ToString();
                        contadorpos = contadorpos + 1;

                        if (Txtposicion.Text.Trim() == "ab1")
                        {
                            total_pos.Text = dr2["total"].ToString();
                        }
                        else
                        {
                            if (Txtposicion.Text.Trim() == "ab2")
                            {
                                total_pos.Text = dr2["total"].ToString();
                            }
                            else
                            {
                                if (Txtposicion.Text.Trim() == "ab3")
                                {
                                    total_pos.Text = dr2["total"].ToString();
                                }
                                else
                                {
                                    if (Txtposicion.Text.Trim() == "cc1")
                                    {
                                        total_pos.Text = dr2["total"].ToString();
                                    }
                                    else
                                    {
                                        if (Txtposicion.Text.Trim() == "cc2")
                                        {
                                            total_pos.Text = dr2["total"].ToString();
                                        }
                                        else
                                        {
                                            if (Txtposicion.Text.Trim() == "cc3")
                                            {
                                                total_pos.Text = dr2["total"].ToString();
                                            }
                                            else
                                            {
                                                if (Txtposicion.Text.Trim() == "cd1")
                                                {
                                                    total_pos.Text = dr2["total"].ToString();
                                                }
                                                else
                                                {
                                                    if (Txtposicion.Text.Trim() == "cd2")
                                                    {
                                                        total_pos.Text = dr2["total"].ToString();
                                                    }
                                                    else
                                                    {
                                                        if (Txtposicion.Text.Trim() == "cd3")
                                                        {
                                                            total_pos.Text = dr2["total"].ToString();
                                                        }
                                                        else
                                                        {
                                                            total_pos.Text = "0";
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }

                                }
                            }
                        }
                        //-- aqui antes de que acabe el while
                        using (SqlConnection cnx2 = new SqlConnection(connectionString))
                        {
                            cnx2.Open();
                            string query = " UPDATE EVA_C_GRAFICA  set idposicion='" + Txtposicion.Text + "', total_depto='" + Convert.ToInt16(total_pos.Text) + "' , iduser='******' " +
                                            " WHERE iduser= '******' and idposicion='" + Txtposicion.Text + "' ";
                            SqlCommand cmd = new SqlCommand(query, cnx2);
                            SqlDataReader dr = cmd.ExecuteReader();
                        }

                    } // del while
                }
                else
                {
                    //MensajeError("No se encontro Calificacion");
                    return;
                }
            }   // cierre de la conn

            string totalvalores = "0";
            using (SqlConnection cnxt = new SqlConnection(connectionString))
            {
                cnxt.Open();
                string query2 = " SELECT  SUM(cal_valores) AS totalval " +
                                " FROM    EVA_D_GRAFICA " +
                                " WHERE   (usuario = '" + usuario.Text + "') ";
                SqlCommand cmd2 = new SqlCommand(query2, cnxt);

                SqlDataReader drt = cmd2.ExecuteReader();

                if (drt.HasRows)
                {
                    while (drt.Read())
                    {
                        totalvalores = drt["totalval"].ToString();
                    }
                }
            }
            if (Convert.ToInt32(totalvalores) != 0)
            {
                renderChart(); //para las graficas
            }
            else
            {
                panel2.Visible = false;
            }

            panel3.Visible = false;
            panel4.Visible = false;
            LinkBCGral.Visible = false;
            //}
        }
コード例 #8
0
ファイル: frmConsultaJefe.aspx.cs プロジェクト: tinovo/Sitio
        protected void Button1_Click(object sender, System.EventArgs e)
        {
            MensajeError(string.Empty);
            MensajeExito(string.Empty);
            //int graba = 1;

            String idEmpleadoJDE = lista_empleados.SelectedValue.ToString();

            opcestatus.Visible = true;
            //para banda estrategica osea directores
            if (id_categoria.Text == "A1" || id_categoria.Text == "A2")
            {
                opcestatus.Visible = true;
                //==================================================================================================================================
                panel1.Visible = true;
                botonExportar.Visible = true;
                botonExportar.Visible = false;

                if ((lista_empleados.SelectedValue.ToString() == "0"))
                {
                    //MensajeError("Debes de Seleccionar el Departamento");
                    panel1.Visible = false;
                    //panel2.Visible = false;
                    botonExportar.Visible = false;
                    return;
                }
                //else 
                //{
                String idOrganizationEBS = lista_empleados.SelectedValue.ToString();
                TablaEmpleados empleadosEbs = new TablaEmpleados();
                DataTable table = empleadosEbs.empleadoxdepto(idOrganizationEBS);
                if (table == null)
                {
                    MensajeError("Null empleadoxdepto");
                    return;
                }


                gridBuscar.DataSource = table;
                gridBuscar.DataBind();
                //panel2.Visible = true;
                int contadorpos;
                //panel3.Visible = true;
                //panel2.Visible = true;
                //string idplantilla;
                //---BORRO la CONSULTA ANTERIOR
                usuario.Text = (string)(Session["Nombre"]);
                empcritico.Text = "";
                empnec.Text = "";
                empreconocer.Text = "";
                empretener.Text = "";

                //saco la plantillas
                using (SqlConnection cnx = new SqlConnection(connectionString))
                {
                    cnx.Open();
                    string query = "SELECT id_plantilla FROM EVA_PLANTILLAS WHERE (vigencia_plant = '1')";
                    SqlCommand cmd = new SqlCommand(query, cnx);
                    SqlDataReader dr = cmd.ExecuteReader();

                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            idplantilla.Text = dr["id_plantilla"].ToString();
                        }
                    }
                    else
                    {
                        idplantilla.Text = "No se encontro plantilla autorizada";
                    }

                }   // cierre de la conn

                DataTable dt = new DataTable();
                TablaEmpleados empleadosEbs2 = new TablaEmpleados();

                DataTable table2 = empleadosEbs2.empleadoxdeptoID(idOrganizationEBS);

                if (table2 != null)
                {

                    foreach (DataRow row in table2.Rows) // Loop over the rows.
                    {
                        foreach (var item in row.ItemArray) // Loop over the items.
                        {

                            using (SqlConnection cnx = new SqlConnection(connectionString))
                            {
                                cnx.Open();
                                string query = " select  count(c.id_eva) as total, c.id_eva " +
                                               " from EVA_C_EVALUACION as c, EVA_D_EVALUACION as d " +
                                               " where c.id_emp='" + item + "' and c.estatus='2' and c.id_eva=d.id_eva and d.id_plantilla='" + idplantilla.Text + "' " +
                                               " group by c.id_eva ";
                                SqlCommand cmd = new SqlCommand(query, cnx);
                                SqlDataReader dr = cmd.ExecuteReader();

                                if (dr.HasRows)
                                {
                                    while (dr.Read())
                                    {
                                        evaluacionid.Text = dr["id_eva"].ToString();
                                    }
                                }
                                else
                                {
                                    evaluacionid.Text = "0";
                                }
                            }   // cierre de la conn


                            if (evaluacionid.Text != "0")
                            {
                                using (SqlConnection cnx = new SqlConnection(connectionString))
                                {
                                    // estatus=2 cuando la evaluacion ha sido liberada por jefe inmediato
                                    cnx.Open();
                                    string query = " select {fn IFNULL(SUM(calificacion_val_jefe),0)} AS total_puntaje_valores " +
                                                   " from EVA_C_EVALUACION as e, EVA_D_EVALUACION as d " +
                                                   " where e.id_eva='" + evaluacionid.Text + "' and e.estatus='2' and d.id_plantilla='" + idplantilla.Text + "'  and e.id_eva=d.id_eva ";
                                    SqlCommand cmd = new SqlCommand(query, cnx);
                                    SqlDataReader dr = cmd.ExecuteReader();

                                    if (dr.HasRows)
                                    {
                                        while (dr.Read())
                                        {
                                            total_valores.Text = dr["total_puntaje_valores"].ToString();
                                        }
                                    }
                                    else
                                    {
                                        total_valores.Text = "0";
                                    }


                                }   // cierre de la conn
                                if (total_valores.Text != "0")
                                {
                                    using (SqlConnection cnx = new SqlConnection(connectionString))
                                    {
                                        cnx.Open();
                                        string query = " select {fn IFNULL(SUM(ponderacion_ind_jefe),0)} AS total_puntaje_indicadores " +
                                                       " from EVA_C_EVALUACION as e, EVA_D_INDICADORES as d " +
                                                       " where e.id_eva='" + evaluacionid.Text + "' and e.estatus='2' and d.id_plantilla='" + idplantilla.Text + "'  " +
                                                       " and e.id_eva=d.id_eva ";
                                        SqlCommand cmd = new SqlCommand(query, cnx);
                                        SqlDataReader dr = cmd.ExecuteReader();

                                        if (dr.HasRows)
                                        {
                                            while (dr.Read())
                                            {
                                                total_valores_ind.Text = dr["total_puntaje_indicadores"].ToString();
                                            }
                                        }
                                        else
                                        {
                                            total_valores_ind.Text = "No se encontro puntaje indicadores";
                                        }

                                    }   // cierre de la conn

                                    // para sacar la calificacion en Letra 
                                    using (SqlConnection cnx = new SqlConnection(connectionString))
                                    {
                                        cnx.Open();
                                        string query2 = " SELECT ponderacion_kpi, calificacion_kpi, descripcion_kpi " +
                                                        " FROM   EVA_C_CALIFICACION_KPI " +
                                                        " WHERE  ponderacion_kpi <=  '" + total_valores_ind.Text + "' order by 1 ";
                                        SqlCommand cmd2 = new SqlCommand(query2, cnx);

                                        SqlDataReader dr2 = cmd2.ExecuteReader();

                                        if (dr2.HasRows)
                                        {
                                            while (dr2.Read())
                                            {
                                                cal_indicador.Text = dr2["calificacion_kpi"].ToString();
                                            }
                                        }
                                        else
                                        {
                                            //MensajeError("No se encontro Calificacion");
                                            return;
                                        }

                                    }   // cierre de la conn


                                }
                            }
                        }
                    }

                }
                else
                {
                    MensajeError("Null -empleadoxdeptoID");
                    return;
                }



                //===============================================================================================================HASTA AQUI
            }
            else
            {
                opcestatus.Visible = false;
            }

        }
コード例 #9
0
ファイル: frmConsultaJefe.aspx.cs プロジェクト: tinovo/Sitio
        protected void Page_Load(object sender, EventArgs e)
        {
            panel1.Visible = false;
            if (!Page.IsPostBack)
            {


                IDEmpleado.Text = (string)(Session["ClaveJDE"]);

                //DEVUELVE LOS VALORES DEL EBS
                this.capitalHumano = new NegocioCapitalHumano();

                TablaEmpleados empleadosEbs = new TablaEmpleados();

                List<Employee> listaEmpleados = capitalHumano.ListaEmpleados(IDEmpleado.Text, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));

                if (listaEmpleados == null)
                {
                    MensajeError("No tiene asignado Empleados");
                    Button1.Visible = false;
                    return;

                }
                else
                {
                    txtPersonid.Text = listaEmpleados[0].Perclave.ToString();
                    lbbanda.Text = listaEmpleados[0].Grado.ToString();
                    lbdepto.Text = listaEmpleados[0].OrganizacionClave.ToString();

                    using (SqlConnection cnx = new SqlConnection(connectionString))
                    {
                        cnx.Open();
                        string query = "SELECT id_cat, banda, d_categoria FROM EVA_CATEGORIA " +
                                        "WHERE d_categoria=  '" + lbbanda.Text + "' ";
                        SqlCommand cmd = new SqlCommand(query, cnx);
                        SqlDataReader dr = cmd.ExecuteReader();
                        if (dr.HasRows)
                        {
                            while (dr.Read())
                            {
                                id_categoria.Text = dr["id_cat"].ToString();
                            }
                        }
                        else
                        {
                            id_categoria.Text = "No se encontro categoria";
                        }
                    }
                    // A1 y A2 GERENTE/DIRECTOR VERA TODOS LOS DEPTOS ASIGNADOS muestra combo x depto
                    // A3 Y B1 COORDINADOR SOLO VERA SU DEPTO muestra combo x subordinado de su depto
                    // B2 Y B3 SUPERVISO JEFE VERA SOLO SUS SUBORDINADOS combo x

                    if (id_categoria.Text == "A1" || id_categoria.Text == "A2")
                    {
                        //DataTable table = empleadosEbs.SupxDepto(txtPersonid.Text);
                        //lista_empleados.DataSource = table;
                        //lista_empleados.DataValueField = "organization_id";
                        //lista_empleados.DataTextField = "NombreDepto";
                        //lista_empleados.DataBind();
                        //lista_empleados.SelectedIndex = 0;
                        //opcestatus.Visible = true;
                        //BuscarEmp.Visible = false;

                        DataTable table3 = empleadosEbs.subordinados(txtPersonid.Text);
                        lista_empleados.DataSource = table3;
                        lista_empleados.DataValueField = "employee_number";
                        lista_empleados.DataTextField = "full_name";
                        lista_empleados.DataBind();
                        lista_empleados.SelectedIndex = 0;
                        Button1.Visible = false;
                    }
                    else
                    {
                        if (id_categoria.Text == "A3" || id_categoria.Text == "B1")
                        {
                            if (IDEmpleado.Text == "200334")
                            {
                                DataTable table3 = empleadosEbs.subordinados(txtPersonid.Text);
                                lista_empleados.DataSource = table3;
                                lista_empleados.DataValueField = "employee_number";
                                lista_empleados.DataTextField = "full_name";
                                lista_empleados.DataBind();
                                lista_empleados.SelectedIndex = 0;
                                Button1.Visible = false;
                            }
                            else
                            {
                                DataTable table2 = empleadosEbs.empleadoxdepto(lbdepto.Text);
                                lista_empleados.DataSource = table2;
                                lista_empleados.DataValueField = "employee_number";
                                lista_empleados.DataTextField = "full_name";
                                lista_empleados.DataBind();
                                lista_empleados.SelectedIndex = 0;
                                Button1.Visible = false;
                            }
                        }
                        else
                        {
                            if (id_categoria.Text == "B2" || id_categoria.Text == "B3" || id_categoria.Text == "C1" || id_categoria.Text == "C3")
                            {
                                DataTable table3 = empleadosEbs.subordinados(txtPersonid.Text);
                                lista_empleados.DataSource = table3;
                                lista_empleados.DataValueField = "employee_number";
                                lista_empleados.DataTextField = "full_name";
                                lista_empleados.DataBind();
                                lista_empleados.SelectedIndex = 0;
                                Button1.Visible = false;
                            }
                        }
                    }
                }
            }

        }
コード例 #10
0
ファイル: frmCapturaJefe.aspx.cs プロジェクト: tinovo/Sitio
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {

                try
                {


                    IDEmpleado.Text = (string)(Session["ClaveJDE"]);

                    //DEVUELVE LOS VALORES DEL EBS
                    this.capitalHumano = new NegocioCapitalHumano();

                    TablaEmpleados empleadosEbs = new TablaEmpleados();

                    List<Employee> listaEmpleados = capitalHumano.ListaEmpleados(IDEmpleado.Text, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));

                    if (listaEmpleados == null)
                    {
                        TextBox1.Text = "";
                        MensajeError("No tiene asignado Empleados");
                        Button1.Visible = false;
                        return;

                    }
                    else
                    {
                        txtPersonid.Text = listaEmpleados[0].Perclave.ToString();

                        DataTable table = empleadosEbs.subordinados(txtPersonid.Text);
                        lista_empleados.DataSource = table;
                        lista_empleados.DataValueField = "employee_number";
                        lista_empleados.DataTextField = "full_name";
                        lista_empleados.DataBind();
                        lista_empleados.SelectedIndex = 0;

                        //para saber cuantos empleados han realizado su evaluacion 
                        int contar_terminadas = 0;
                        int contador = 0;
                        DataTable tabla = empleadosEbs.subordinados(txtPersonid.Text);
                        foreach (DataRow row in tabla.Rows)
                        {
                            //Busco la plantilla que este actual
                            string connectionString = ConfigurationManager.ConnectionStrings["conexionAPPS"].ConnectionString;
                            using (SqlConnection cnx = new SqlConnection(connectionString))
                            {
                                cnx.Open();
                                string query = " SELECT    id_plantilla, nombre_plant, vigencia_plant " +
                                               " FROM      EVA_PLANTILLAS " +
                                               " WHERE     (vigencia_plant = '1')";

                                SqlCommand cmd = new SqlCommand(query, cnx);
                                SqlDataReader dr = cmd.ExecuteReader();

                                if (dr.HasRows)
                                {
                                    while (dr.Read())
                                    {
                                        idplantilla.Text = dr["id_plantilla"].ToString();
                                    }
                                }
                                else
                                {
                                    idplantilla.Text = "0";
                                }
                            }

                            //utilizar el objeto row
                            contador = contador + 1;
                            lbEmpleados.Text = row["employee_number"].ToString();
                            //busco en la tabla de evaluaciones si su estatus es 2 de terminada evaluacion
                            using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
                            {
                                string estatusemp;
                                cnx.Open();
                                string query = " SELECT a.id_eva, a.id_emp, a.id_jefe, a.id_categoria_emp, a.id_banda_emp, a.estatus " +
                                               " from EVA_C_EVALUACION as a INNER JOIN EVA_D_EVALUACION as d ON a.id_eva=d.id_eva " +
                                               " WHERE (a.id_emp = '" + lbEmpleados.Text + "') and (d.id_plantilla = '" + idplantilla.Text + "') " +
                                               " group by a.id_eva, a.id_emp, a.id_jefe, a.id_categoria_emp, a.id_banda_emp, a.estatus ";

                                SqlCommand cmd = new SqlCommand(query, cnx);
                                SqlDataReader dr2 = cmd.ExecuteReader();
                                if (dr2.HasRows)
                                {
                                    while (dr2.Read())
                                    {
                                        estatusemp = dr2["estatus"].ToString();
                                        if (Convert.ToInt32(estatusemp) == 1 || Convert.ToInt32(estatusemp) == 2) // estatus de terminada x empleado
                                        {
                                            contar_terminadas = contar_terminadas + 1;
                                        }
                                        else
                                        {
                                            contar_terminadas = contar_terminadas + 0;
                                        }
                                    }
                                }
                                else
                                {
                                    contar_terminadas = contar_terminadas + 0;
                                }
                            }
                            cont_terminada.Text = Convert.ToString(contar_terminadas);
                            contador_total.Text = Convert.ToString(contador);
                            leyenda.Text = "TOTAL DE EMPLEADOS QUE HA TERMINADO SU EVALUACION:  " + cont_terminada.Text + "  DE  " + contador_total.Text;
                        }

                    }

                    //PARA SACAR LA DESCRIPCION DE KPI
                    using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
                    {
                        string descripcionkpi, calkpi, descripcionkpi_completa;
                        cnx.Open();
                        string query = " SELECT ponderacion_kpi, calificacion_kpi, descripcion_kpi  FROM EVA_C_CALIFICACION_KPI";
                        SqlCommand cmd = new SqlCommand(query, cnx);
                        SqlDataReader dr2 = cmd.ExecuteReader();
                        if (dr2.HasRows)
                        {
                            while (dr2.Read())
                            {
                                descripcionkpi = dr2["descripcion_kpi"].ToString();
                                calkpi = dr2["calificacion_kpi"].ToString();
                                descripcionkpi_completa = descripcionkpi + " " + " = " + calkpi + " " + "<br>";
                                descripcion_kpi.Text = descripcion_kpi.Text + descripcionkpi_completa;
                            }
                        }
                    }


                }
                catch (Exception e3)
                {
                    throw e3;
                }

                //CreateGrid();
            }
            //using (OracleConnection cn = new OracleConnection(ConfigurationManager.ConnectionStrings["conexionEBS"].ToString()))
            //{
            //    string query = " select a.employee_number, a.full_name, a.person_id from PER_ALL_ASSIGNMENTS_F  b inner join PER_ALL_PEOPLE_F a on b.person_id=a.person_id " +
            //                   " where b.SUPERVISOR_ID = " + txtPersonid.Text + "";

            //    OracleCommand cmd = new OracleCommand(query, cn);
            //    cn.Open();
            //    System.Data.OracleClient.OracleDataReader table = cmd.ExecuteReader();
            //    //System.Data.DataTable table = (DataTable)cmd.ExecuteReader();
            //    lista_empleados.DataSource = table;


            //}          
        }
コード例 #11
0
ファイル: frmConsultaJefe.aspx.cs プロジェクト: tinovo/Sitio
        protected void BuscarEmp_Click(object sender, EventArgs e)
        {
            // String numeroempleado = TextNoEmp.ToString();
            String idEmpleadoJDE = lista_empleados.SelectedValue.ToString();

            TablaEmpleados empleadosEbs = new TablaEmpleados();
            DataTable table = empleadosEbs.empleadogrid(idEmpleadoJDE);
            GridViewXemp.DataSource = table;
            GridViewXemp.DataBind();
            panel3.Visible = true;
            //ButtonExp.Visible = true;
            //panel1.Visible = false;
            //panel2.Visible = false;
            //botonExportar.Visible = false;
            //panel4.Visible = false;
            //LinkBCGral.Visible = false;
        }
コード例 #12
0
ファイル: frmCapturaJefe.aspx.cs プロジェクト: tinovo/Sitio
        public void CreateGrid()
        {
            // saco la ultima evaluacion que capturo
            // MUESTRA EL GRID

            String idEmpleadoJDE = lista_empleados.SelectedValue.ToString();

            string connectionString = ConfigurationManager.ConnectionStrings["conexionAPPS"].ConnectionString;
            using (SqlConnection cnx = new SqlConnection(connectionString))
            {
                cnx.Open();
                string query = " SELECT  distinct c.*, d.id_plantilla " +
                               " FROM   EVA_C_EVALUACION as c, EVA_D_EVALUACION as d " +
                               " WHERE  (c.id_emp = " + idEmpleadoJDE + ") and c.estatus<>'2'  and c.estatus<>'3' and c.id_eva=d.id_eva " +
                               " order by c.fecha_captura ";

                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        idplantilla.Text = dr["id_plantilla"].ToString();
                        idbanda.Text = dr["id_banda_emp"].ToString();
                        ideva.Text = dr["id_eva"].ToString();
                        IDEmpleado.Text = dr["id_emp"].ToString();

                    }
                }
                else
                {
                    idplantilla.Text = "0";
                    idbanda.Text = "0";
                    ideva.Text = "0";

                }

            }

            // MUESTRA EL GRID para CONSULTA CUANDO TERMINO
            using (SqlConnection cnx = new SqlConnection(connectionString))
            {

                cnx.Open();
                string query = "SELECT d.d_partida_eva as idpe, d.id_eva as ideva, d.id_plantilla, d.c_seccion, d.c_valor as valor2, d.c_comportamiento as comp, " +
                               "d.calificacion_val_emp as calificacionemp, d.calificacion_val_jefe as calificacionjefe, d.id_ind, v.valornuvoil as valor, " +
                              " d.calificacion_ind_emp, d.calificacion_id_jefe, v.conducta1 as c1, v.conducta2 as c2, v.conducta3 as c3, v.c_banda, c.d_valor as nomvalor " +
                              " FROM   EVA_D_EVALUACION AS d INNER JOIN " +
                              " EVA_D_VALORES AS v ON d.c_comportamiento = v.c_comportamiento and v.id_plantilla = d.id_plantilla INNER JOIN " +
                              " EVA_C_VALORES AS c ON v.c_comportamiento = c.c_valor " +
                              " WHERE (d.id_eva = '" + ideva.Text + "')  AND (v.c_banda = '" + idbanda.Text + "') AND (d.id_plantilla = '" + idplantilla.Text + "')  order by 5 ";

                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader myReader = cmd.ExecuteReader();
                grid5.DataSource = myReader;

                grid5.AllowGrouping = true; //para el agrupado de columnas en el grid
                grid5.GroupBy = "valor";

                grid5.DataBind();

            }


            //DEVUELVE LOS VALORES DEL EBS
            this.capitalHumano = new NegocioCapitalHumano();

            TablaEmpleados empleadosEbs = new TablaEmpleados();

            try
            {
                List<Employee> listaEmpleados = capitalHumano.ListaEmpleados(IDEmpleado.Text, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));
                TxtPuesto.Text = listaEmpleados[0].Puesto.ToString();
                TxtDepto.Text = listaEmpleados[0].Organizacion.ToString();


                Banda.Text = listaEmpleados[0].Grado.ToString();
                TxtEmpleado.Text = listaEmpleados[0].NombreCompleto.ToString();
            }
            catch (Exception e3)
            {
                throw e3;
            }
            string separarpto = TxtPuesto.Text;
            if (separarpto == null || separarpto == "")
            {
                MensajeError("No se encuentra asignado su Puesto o Depto en BD, consulte con Capital Humano");
                return;
            }
            else
            {
                // Split separator
                string[] parts = separarpto.Split('.');
                Depto.Text = parts[0];
                Pto.Text = parts[1];
            }
            // MUESTRA EL GRID de INDICADORES
            using (SqlConnection cnx = new SqlConnection(connectionString))
            {


                cnx.Open();
                string query = " SELECT    d.id_eva as ideva, d.id_plantilla as idplantilla, d.depto as depto, d.puesto as puesto, d.id_linea as idlinea, d.resultado_logrado as reslogrado, " +
                               " d.ptos, d.ponderacion_ind as ponderacionind, c.descripcion_kpi as descripcion_kpi, c.unidad_medida as umedida, c.porcentaje_pondera as porcentaje_pondera, " +
                               " c.meta_minima as meta_minima, c.meta_satisfactoria as meta_satisfactoria, c.meta_excelente as meta_excelente, d.calificacion_ind as calind, " +
                               " d.resultado_logrado_jefe as reslogradojefe, d.ptos_jefe, d.ponderacion_ind_jefe  as ponderacionindgf, d.calificacion_ind_jefe as calindgf " +
                               " FROM  EVA_D_INDICADORES as d, EVA_C_INDICADORES  as c " +
                               " WHERE d.depto=c.depto and d.puesto=c.puesto and d.id_plantilla=c.id_plantilla and " +
                               " SUBSTRING(d.id_linea, 1, 1)=c.id_linea and (d.id_eva = '" + ideva.Text + "') and d.id_plantilla='" + idplantilla.Text + "' and " +
                               " d.depto='" + Depto.Text + "' and d.puesto='" + Pto.Text + "' ";

                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader myReader = cmd.ExecuteReader();
                grid9.DataSource = myReader;
                grid9.DataBind();

            }



        }
コード例 #13
0
ファイル: frmCapturaJefe.aspx.cs プロジェクト: tinovo/Sitio
        public void InsertaNuevo(string noEmpleado)
        {
            IDEmpleado.Text = noEmpleado;
            this.capitalHumano = new NegocioCapitalHumano();

            TablaEmpleados empleadosEbs = new TablaEmpleados();
            try
            {
                List<Employee> listaEmpleados_insert = capitalHumano.ListaEmpleados(noEmpleado, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));
                TxtPuesto.Text = listaEmpleados_insert[0].Puesto.ToString();
                TxtDepto.Text = listaEmpleados_insert[0].Organizacion.ToString();


                Banda.Text = listaEmpleados_insert[0].Grado.ToString();
                TxtEmpleado.Text = listaEmpleados_insert[0].NombreCompleto.ToString();
                antiguedadmes.Text = listaEmpleados_insert[0].mesContratacion.ToString();

            }
            catch (Exception e3)
            {
                throw e3;
            }
            string separarpto = TxtPuesto.Text;
            if (separarpto == null || separarpto == "")
            {
                MensajeError("No se encuentra asignado su Puesto o Depto en BD, consulte con Capital Humano");
                return;
            }
            else
            {
                // Split separator
                string[] parts = separarpto.Split('.');
                Depto.Text = parts[0];
                Pto.Text = parts[1];
            }

            TablaEmpleados empleadosEbs2 = new TablaEmpleados();

            List<Employee> listaEmpleados2 = capitalHumano.ListaPersona(IDEmpleado.Text);

            //----para validar que no venga vacio los datos y marque error
            if (listaEmpleados2 == null)
            {
                TextBox1.Text = "";
                MensajeError(capitalHumano.Log + " / o No se encuentra asignado su Jefe en BD, consulte con Capital Humano");
                return;

            }
            else
            {
                TextBox1.Text = listaEmpleados2[0].Supervisor.ToString();
                // antiguedadmes.Text = listaEmpleados2[0].mesContratacion.ToString();
            }

            decimal antiguedadm;
            antiguedadm = Convert.ToDecimal(antiguedadmes.Text);

            if (antiguedadm <= 3)
            {
                MensajeError("No puedes realizar la AutoEvaluacion hasta que cumpla 3 Meses Laborando, consulte a Capital Humano");
                return;
            }



            string connectionString = ConfigurationManager.ConnectionStrings["conexionAPPS"].ConnectionString;
            using (SqlConnection cnx = new SqlConnection(connectionString))
            {
                cnx.Open();

                string query = "SELECT id_plantilla FROM EVA_PLANTILLAS WHERE (vigencia_plant = '1')";
                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        lbPlantilla.Text = dr["id_plantilla"].ToString();
                    }
                }
                else
                {
                    //lbPlantilla.Text = "No se encontro plantilla autorizada";
                    lbPlantilla.Text = "1";
                }

            }   // cierre de la conn

            //--------------------------------PARA SACAR LA CATEGORIA POR LA BANDA
            lbidcategoria.Text = Banda.Text;

            using (SqlConnection cnx = new SqlConnection(connectionString))
            {
                cnx.Open();

                string query = "SELECT id_cat, banda, d_categoria FROM EVA_CATEGORIA " +
                               "WHERE d_categoria=  '" + Banda.Text + "' ";
                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        ban.Text = dr["banda"].ToString();
                    }
                }
                else
                {
                    ban.Text = "No se encontro categoria";
                }
            }

            //PARA SACAR LA BANDA
            using (SqlConnection cnxban = new SqlConnection(connectionString))
            {
                cnxban.Open();

                string queryb = "SELECT id_banda, banda FROM  EVA_BANDA WHERE (id_banda = '" + ban.Text + "')";
                SqlCommand cmdb = new SqlCommand(queryb, cnxban);
                SqlDataReader drb = cmdb.ExecuteReader();

                if (drb.HasRows)
                {
                    while (drb.Read())
                    {
                        Banda.Text = drb["banda"].ToString();
                    }
                }
            }   // cierre de la conn

            List<Employee> listaEmpleados3 = capitalHumano.ListaPersonaName(TextBox1.Text);
            if (listaEmpleados3 != null)
            {

                TxtJefeDir.Text = listaEmpleados3[0].SupervisorName.ToString();
                lbl_id_empAutoriza.Text = listaEmpleados3[0].SupervisorNoemp.ToString();
            }
            else
            {
                MensajeError(capitalHumano.Log + " NO se encuentra actualizado su Jefe en BD, consulte con Capital Humano");
                return;
            }


            // ULTIMO FOLIO USADO
            using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
            {
                cnx.Open();

                string query = "SELECT MAX(id_eva) AS ultimofolio FROM EVA_FOLIOS";
                SqlCommand cmd = new SqlCommand(query, cnx);
                //cmd.Parameters.AddWithValue("@banda", Banda.Text);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        lbFolioeva.Text = dr["ultimofolio"].ToString();
                    }
                }
                else
                {
                    lbFolioeva.Text = "No rows found";
                }

            }   // cierre de la conn
            SumaFolio(lbFolioeva.Text, 1);
            //INCREMENTO FOLIO
            lbFolioevanew.Text = SumaFolio(lbFolioeva.Text, 1);

            // para saber cual fue su ultima evaluacion o si es la primera vez que entra
            using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
            {
                cnx.Open();
                string query = " SELECT distinct(c.id_eva) as eva, c.id_emp, c.id_jefe, c.id_categoria_emp, c.id_banda_emp, c.estatus, c.fecha_captura,  " +
                               " DATEDIFF(day,  c.fecha_captura, GETDATE()) AS diastranscurridos , d.id_plantilla " +
                               " FROM EVA_C_EVALUACION  as c,  EVA_D_EVALUACION as d " +
                               " WHERE (c.id_emp = @noempleado) and c.id_eva=d.id_eva and d.id_plantilla= @idplantilla and c.estatus<>'3'" +
                               " ORDER BY c.fecha_captura";
                SqlCommand cmd = new SqlCommand(query, cnx);
                cmd.Parameters.AddWithValue("@noempleado", IDEmpleado.Text);
                cmd.Parameters.AddWithValue("@idplantilla", lbPlantilla.Text);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        diastranscurridos.Text = dr["diastranscurridos"].ToString();
                        idestatus.Text = dr["estatus"].ToString();
                        opcion.Text = "-";
                        int diastras = Convert.ToInt32(diastranscurridos.Text);
                    }
                }
                else
                {
                    opcion.Text = "nuevo";
                    int diastras = 0;
                }
            }   // cierre de la conn

            if (opcion.Text == "nuevo")
            {
                // inserto
                // si es mayor crear una nueva evaluacion e insertar valores e indicadores en tabla detalles
                DatoEvaluacion DatEvaluacion = new DatoEvaluacion();
                if (DatEvaluacion.InsertEvaluaciones(lbFolioevanew.Text, Convert.ToInt32(IDEmpleado.Text), Convert.ToInt32(lbl_id_empAutoriza.Text), lbidcategoria.Text, ban.Text, "1") > 0)
                {
                    //inserto en tabla detalle los valores nuvoil primero saco los datos a consultar
                    using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
                    {
                        cnx.Open();

                        string query = "SELECT  a.c_seccion as seccion, a.c_valor as valor, a.c_comportamiento as comp " +
                                       "FROM    EVA_D_VALORES AS a INNER JOIN EVA_C_VALORES AS b ON a.c_comportamiento = b.c_valor " +
                                       "WHERE   a.c_banda =  '" + ban.Text + "' and a.id_plantilla = '" + lbPlantilla.Text + "' ";
                        SqlCommand cmd = new SqlCommand(query, cnx);
                        cmd.Parameters.AddWithValue("@banda", Banda.Text);
                        SqlDataReader dr = cmd.ExecuteReader();

                        if (dr.HasRows)
                        {
                            while (dr.Read())
                            {
                                seccion.Text = dr["seccion"].ToString();
                                valor.Text = dr["valor"].ToString();
                                comportamiento.Text = dr["comp"].ToString();
                                DatoDeteva DatDeteva = new DatoDeteva();
                                if (DatDeteva.InsertDetEvaluacion(lbFolioevanew.Text, Convert.ToInt32(lbPlantilla.Text), seccion.Text, valor.Text, comportamiento.Text, 0) > 0)
                                {
                                    //se ha insertado exitosamente
                                }
                            }
                        }
                        else
                        {
                            seccion.Text = "No hay seccion";
                        }
                    }   // cierre de la using
                } // del if de guardado de cabecera de evaluacion

                //ACTUALIZO EL FOLIO
                using (SqlConnection cnx2 = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
                {
                    cnx2.Open();
                    string query = "UPDATE EVA_FOLIOS set fecha=GETDATE(), idempleado='" + Convert.ToInt32(IDEmpleado.Text) + "', id_eva= '" + lbFolioevanew.Text + "'";
                    SqlCommand cmd = new SqlCommand(query, cnx2);
                    SqlDataReader dr = cmd.ExecuteReader();
                }

            } // del if del if (opcion.Text == "nuevo")

            //if (idestatus.Text == "0")
            //{

            //    using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
            //    {
            //        cnx.Open();

            //        string query2 = " SELECT id_eva as ideva, id_emp, id_jefe, id_categoria_emp, id_banda_emp, estatus, fecha_captura, " +
            //                      " DATEDIFF(day,  fecha_captura, GETDATE()) AS diastranscurridos, ptos_ftes as ptos, necesidades, comentarios " +
            //                      " FROM EVA_C_EVALUACION " +
            //                      " WHERE (id_emp = @noempleado) " +
            //                      " ORDER BY fecha_captura";
            //        SqlCommand cmd2 = new SqlCommand(query2, cnx);
            //        cmd2.Parameters.AddWithValue("@noempleado", IDEmpleado.Text);
            //        SqlDataReader dr2 = cmd2.ExecuteReader();

            //        if (dr2.HasRows)
            //        {
            //            while (dr2.Read())
            //            {
            //                foliopendiente.Text = dr2["ideva"].ToString();
            //                lbFolioevanew.Text = foliopendiente.Text;

            //            }
            //        }

            //    }

            //} // del if (idestatus.Text=="0") {


            //----------- para insertar indicadores
            //inserto si es la primera vez que va capturar sino solo consulto los resultados
            using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
            {

                cnx.Open();
                string query = " SELECT    d.id_eva as ideva, d.id_plantilla as idplantilla, d.depto as depto, d.puesto as puesto, d.id_linea as idlinea, d.resultado_logrado as reslogrado, " +
                               " d.ptos, d.ponderacion_ind as ponderacionind, c.descripcion_kpi as descripcion_kpi, c.unidad_medida as umedida, c.porcentaje_pondera as porcentaje_pondera, " +
                               " c.meta_minima as meta_minima, c.meta_satisfactoria as meta_satisfactoria, c.meta_excelente as meta_excelente, d.calificacion_ind as calind " +
                               " FROM  EVA_D_INDICADORES as d, EVA_C_INDICADORES  as c " +
                               " WHERE left(d.depto,3)=left(c.depto,3) and left(d.puesto,3)=left(c.puesto,3) and d.id_plantilla=c.id_plantilla and " +
                               " d.id_linea=c.id_linea and (d.id_eva = '" + lbFolioevanew.Text + "') and d.id_plantilla='" + lbPlantilla.Text + "' and " +
                               " left(d.depto,3)='" + Depto.Text + "' and left(d.puesto,3)='" + Pto.Text + "' ";

                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();


                if (dr.HasRows)
                {
                    while (dr.Read())
                    {

                        ban_existe_eva.Text = "1";

                    }
                }
                else
                {
                    ban_existe_eva.Text = "0";

                }
            }
            if (ban_existe_eva.Text == "0")
            {
                // busco los indicadores que le corresponde por su puesto y depto y plantilla cuando es la 1 vez
                using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
                {
                    cnx.Open();
                    string query = " SELECT id_plantilla, depto, puesto, id_linea, descripcion_kpi, unidad_medida, porcentaje_pondera, meta_minima, meta_satisfactoria, meta_excelente " +
                                   " FROM EVA_C_INDICADORES " +
                                   " WHERE id_plantilla='" + lbPlantilla.Text + "' and " +
                                   " left(puesto,3)='" + Pto.Text + "' and left(depto,3)='" + Depto.Text + "' ";
                    SqlCommand cmd = new SqlCommand(query, cnx);
                    SqlDataReader dr2 = cmd.ExecuteReader();

                    if (dr2.HasRows)
                    {
                        while (dr2.Read())
                        {

                            idlinea.Text = dr2["id_linea"].ToString();
                            desckpi.Text = dr2["descripcion_kpi"].ToString();
                            umedida.Text = dr2["unidad_medida"].ToString();
                            ppondera.Text = dr2["porcentaje_pondera"].ToString();
                            metaminima.Text = dr2["meta_minima"].ToString();
                            metasat.Text = dr2["meta_satisfactoria"].ToString();
                            metaexc.Text = dr2["meta_excelente"].ToString();


                            using (SqlConnection cnx2 = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
                            {
                                cnx2.Open();

                                string query2 = " INSERT EVA_D_INDICADORES (id_eva, id_plantilla, depto, puesto, id_linea, fecha_captura_ind, resultado_logrado, ptos, ponderacion_ind, resultado_logrado_jefe, ptos_jefe, ponderacion_ind_jefe)  " +
                                                " values ('" + lbFolioevanew.Text + "', '" + lbPlantilla.Text + "', '" + Depto.Text + "','" + Pto.Text + "', '" + idlinea.Text + "', GETDATE(), 0, 0, 0, 0, 0, 0 )";
                                SqlCommand cmd2 = new SqlCommand(query2, cnx2);
                                SqlDataReader dr3 = cmd2.ExecuteReader();
                                //MensajeExito("Se ha guardado con Exito tu Evaluacion");
                            }


                        }
                    }
                    else
                    {
                        MensajeError("No se puede insertar el detalle de indicador, revise con Capital Humano si tiene indicadores en su puesto");
                        return;
                    }


                }

            }


        }
コード例 #14
0
ファイル: Captura_Ind.aspx.cs プロジェクト: tinovo/Sitio
        protected void Page_Load(object sender, EventArgs e)
        {

            ValidadSession();

            TxtEmpleado.Text = (string)(Session["Nombre"]);
            TxtPuesto.Text = (string)(Session["Puesto"]);
            IDEmpleado.Text = (string)(Session["ClaveJDE"]);

            lbFolioeva.Text = Request.QueryString[0];

            //DEVUELVE LOS VALORES DEL EBS
            this.capitalHumano = new NegocioCapitalHumano();

            TablaEmpleados empleadosEbs = new TablaEmpleados();

            try
            {
                List<Employee> listaEmpleados = capitalHumano.ListaEmpleados(IDEmpleado.Text, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));
                TxtPuesto.Text = listaEmpleados[0].Puesto.ToString();
                //Banda.Text = listaEmpleados[0].Grado.ToString();
                TxtDepto.Text = listaEmpleados[0].Organizacion.ToString();
                TxtEmpleado.Text = listaEmpleados[0].NombreCompleto.ToString();
            }
            catch (Exception e3)
            {
                throw e3;
            }

            TablaEmpleados empleadosEbs2 = new TablaEmpleados();

            List<Employee> listaEmpleados2 = capitalHumano.ListaPersona(IDEmpleado.Text);
            lbSupervisor.Text = listaEmpleados2[0].Supervisor.ToString();

            if (string.IsNullOrEmpty(lbSupervisor.Text))
            {
                MensajeError("No se encuentra asignado su Jefe en BD, consulte con Capital Humano");
                //lbBanda.Text = "No se encuentra asignado su Jefe en BD, consulte con Capital Humano";
                return;
            }
            else
            {

                List<Employee> listaEmpleados3 = capitalHumano.ListaPersonaName(lbSupervisor.Text);
                TxtJefeDir.Text = listaEmpleados3[0].SupervisorName.ToString();
                NombrejefeBS.Text = listaEmpleados3[0].SupervisorNoemp.ToString();
            }


            //--------------------------------PARA SACAR LA PLANTILLA AUTORIZADA ACTUALMENTE
            using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
            {
                cnx.Open();

                string query = "SELECT id_plantilla FROM EVA_PLANTILLAS WHERE (vigencia_plant = '1')";
                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        lbPlantilla.Text = dr["id_plantilla"].ToString();
                    }
                }
                else
                {
                    lbPlantilla.Text = "No se encontro plantilla autorizada";
                }

            }   // cierre de la conn

            //--------------------------------PARA SACAR LA PLANTILLA AUTORIZADA ACTUALMENTE
            //using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
            //{
            //    cnx.Open();

            //    string query = " SELECT  DISTINCT(c.id_eva) as evaluacion, c.id_emp, c.id_jefe, c.id_categoria_emp, " +
            //                   " c.id_banda_emp, c.estatus, c.fecha_captura, d.id_plantilla " +
            //                   " FROM EVA_C_EVALUACION as c,   EVA_D_EVALUACION as d " +
            //                   " WHERE c.id_emp='" + IDEmpleado.Text + "' and c.id_eva=d.id_eva and d.id_plantilla='" + lbPlantilla.Text + "' ";
            //    SqlCommand cmd = new SqlCommand(query, cnx);
            //    SqlDataReader dr = cmd.ExecuteReader();

            //    if (dr.HasRows)
            //    {
            //        while (dr.Read())
            //        {

            //            lbFolioeva.Text = dr["evaluacion"].ToString();
            //        }
            //    }
            //    else
            //    {
            //        MensajeError("No se encontro Evaluacion anterior realizada");
            //        return;
            //    }

            //}   // cierre de la conn

            // para separar el puesto y depto
            string separarpto = TxtPuesto.Text;
            // Split on directory separator
            string[] parts = separarpto.Split('.');
            Depto.Text = parts[0];
            Pto.Text = parts[1];
            des_puesto.Text = parts[2];

            //inserto si es la primera vez que va capturar sino solo consulto los resultados
            using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
            {

                cnx.Open();
                string query = " SELECT    d.id_eva as ideva, d.id_plantilla as idplantilla, d.depto as depto, d.puesto as puesto, d.id_linea as idlinea, d.resultado_logrado as reslogrado, " +
                               " d.ptos, d.ponderacion_ind as ponderacionind, c.descripcion_kpi as descripcion_kpi, c.unidad_medida as umedida, c.porcentaje_pondera as porcentaje_pondera, " +
                               " c.meta_minima as meta_minima, c.meta_satisfactoria as meta_satisfactoria, c.meta_excelente as meta_excelente, d.calificacion_ind as calind " +
                               " FROM  EVA_D_INDICADORES as d, EVA_C_INDICADORES  as c " +
                               " WHERE left(d.depto,3)=left(c.depto,3) and left(d.puesto,3)=left(c.puesto,3) and d.id_plantilla=c.id_plantilla and " +
                               " d.id_linea=c.id_linea and (d.id_eva = '" + lbFolioeva.Text + "') and d.id_plantilla='" + lbPlantilla.Text + "' and " +
                               " left(d.depto,3)='" + Depto.Text + "' and left(d.puesto,3)='" + Pto.Text + "' ";

                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();


                if (dr.HasRows)
                {
                    while (dr.Read())
                    {

                        ban_existe_eva.Text = "1";

                    }
                }
                else
                {
                    ban_existe_eva.Text = "0";

                }
            }
            if (ban_existe_eva.Text == "0")
            {
                // busco los indicadores que le corresponde por su puesto y depto y plantilla cuando es la 1 vez
                using (SqlConnection cnx = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
                {
                    cnx.Open();
                    string query = " SELECT id_plantilla, depto, puesto, id_linea, descripcion_kpi, unidad_medida, porcentaje_pondera, meta_minima, meta_satisfactoria, meta_excelente " +
                                   " FROM EVA_C_INDICADORES " +
                                   " WHERE id_plantilla='" + lbPlantilla.Text + "' and " +
                                   " left(puesto,3)='" + Pto.Text + "' and left(depto,3)='" + Depto.Text + "' ";
                    SqlCommand cmd = new SqlCommand(query, cnx);
                    SqlDataReader dr2 = cmd.ExecuteReader();

                    if (dr2.HasRows)
                    {
                        while (dr2.Read())
                        {

                            idlinea.Text = dr2["id_linea"].ToString();
                            desckpi.Text = dr2["descripcion_kpi"].ToString();
                            umedida.Text = dr2["unidad_medida"].ToString();
                            ppondera.Text = dr2["porcentaje_pondera"].ToString();
                            metaminima.Text = dr2["meta_minima"].ToString();
                            metasat.Text = dr2["meta_satisfactoria"].ToString();
                            metaexc.Text = dr2["meta_excelente"].ToString();


                            using (SqlConnection cnx2 = new SqlConnection(ConfigurationManager.ConnectionStrings["conexionAPPS"].ToString()))
                            {
                                cnx2.Open();

                                string query2 = " INSERT EVA_D_INDICADORES (id_eva, id_plantilla, depto, puesto, id_linea, fecha_captura_ind, resultado_logrado, ptos, ponderacion_ind, resultado_logrado_jefe, ptos_jefe, ponderacion_ind_jefe)  " +
                                                " values ('" + lbFolioeva.Text + "', '" + lbPlantilla.Text + "', '" + Depto.Text + "','" + Pto.Text + "', '" + idlinea.Text + "', GETDATE(), 0, 0, 0, 0, 0, 0 )";
                                SqlCommand cmd2 = new SqlCommand(query2, cnx2);
                                SqlDataReader dr3 = cmd2.ExecuteReader();
                                //MensajeExito("Se ha guardado con Exito tu Evaluacion");
                            }

                            //DatoDetEvaIndicador DatEvaluacionIndi = new DatoDetEvaIndicador();
                            //if (DatEvaluacionIndi.InsertEvaIndicador(lbFolioeva.Text, Convert.ToInt32(lbPlantilla.Text), "54", Pto.Text, idlinea.Text) > 0)
                            //{
                            //    //inserta el detalle cuando es nuevo
                            //    ban_existe_eva.Text = "1";
                            //}
                            //else
                            //{
                            //    MensajeError("No se pudo insertar el detalle de indicador, revise si tiene indicadores en su puesto");
                            //    return;
                            //}
                        }
                    }
                    else
                    {
                        MensajeError("No se puede insertar el detalle de indicador, revise con Capital Humano si tiene indicadores en su puesto");
                        return;
                    }


                }
                CreateGrid();
            }
            else
            {
                CreateGrid();
            }

        }
コード例 #15
0
ファイル: frmConsultaRH.aspx.cs プロジェクト: tinovo/Sitio
        protected void gridBuscarEmp_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            int bandera = 0;
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string idempleado = e.Row.Cells[1].Text.ToString();
                string opcioneva = opcestatus.SelectedItem.Text;
                // PARA SACAR la plantilla
                using (SqlConnection cnx2 = new SqlConnection(connectionString))
                {
                    cnx2.Open();
                    string query = "SELECT id_plantilla FROM EVA_PLANTILLAS WHERE (vigencia_plant = '1')";
                    SqlCommand cmd = new SqlCommand(query, cnx2);
                    SqlDataReader dr = cmd.ExecuteReader();

                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            idplantilla.Text = dr["id_plantilla"].ToString();
                            Session["idplantilla"] = idplantilla.Text;
                        }
                    }
                }   // cierre de la conn

                using (SqlConnection cnx = new SqlConnection(connectionString))
                {
                    cnx.Open();
                    string query2 = " SELECT a.id_eva as ideva, a.id_emp, a.id_jefe, a.id_categoria_emp, a.id_banda_emp, a.estatus, a.fecha_captura, " +
                                    " DATEDIFF(day,  a.fecha_captura, GETDATE()) AS diastranscurridos, a.ptos_ftes as ptos, a.necesidades, a.comentarios " +
                                    " FROM EVA_C_EVALUACION as a INNER JOIN EVA_D_EVALUACION as d ON a.id_eva=d.id_eva " +
                                    " WHERE (a.id_emp = @noempleado) and d.id_plantilla=@idplantilla " +
                                    " ORDER BY a.fecha_captura";
                    SqlCommand cmd2 = new SqlCommand(query2, cnx);
                    cmd2.Parameters.AddWithValue("@noempleado", idempleado);
                    cmd2.Parameters.AddWithValue("@idplantilla", Session["idplantilla"]);
                    SqlDataReader dr2 = cmd2.ExecuteReader();

                    if (dr2.HasRows)
                    {
                        while (dr2.Read())
                        {
                            ideva.Text = dr2["ideva"].ToString();
                            estatus.Text = dr2["estatus"].ToString();
                            fecaptura.Text = dr2["fecha_captura"].ToString();
                            idbanda.Text = dr2["id_banda_emp"].ToString();

                            string noevaluacion = ideva.Text;

                            // PARA SACAR ELPUNTAJE TOTAL
                            using (SqlConnection cnx2 = new SqlConnection(connectionString))
                            {
                                cnx2.Open();
                                string query = " SELECT  SUM(calificacion_val_jefe) AS total_puntaje " +
                                               " FROM  EVA_D_EVALUACION " +
                                               " WHERE  (id_eva = '" + ideva.Text + "') and id_plantilla= '" + Session["idplantilla"] + "' ";
                                SqlCommand cmd = new SqlCommand(query, cnx2);
                                SqlDataReader dr = cmd.ExecuteReader();

                                if (dr.HasRows)
                                {
                                    while (dr.Read())
                                    {
                                        puntaje.Text = dr["total_puntaje"].ToString();
                                    }
                                }
                            }   // cierre de la conn

                            // PARA SACAR PONDERACION
                            using (SqlConnection cnx2 = new SqlConnection(connectionString))
                            {
                                cnx2.Open();
                                string query = " SELECT desc_pond as descripcion_pondera " +
                                               " FROM   EVA_PONDERA " +
                                               " WHERE  ('" + puntaje.Text + "' BETWEEN min_pond AND max_pond) ";
                                SqlCommand cmd = new SqlCommand(query, cnx2);
                                SqlDataReader dr = cmd.ExecuteReader();

                                if (dr.HasRows)
                                {
                                    while (dr.Read())
                                    {
                                        ponderacion.Text = dr["descripcion_pondera"].ToString();
                                    }
                                }
                            }   // cierre de la conn

                            // PARA SACAR BANDA
                            using (SqlConnection cnx3 = new SqlConnection(connectionString))
                            {
                                cnx3.Open();
                                string query3 = " SELECT id_banda, banda FROM EVA_BANDA where id_banda='" + idbanda.Text + "' ";
                                SqlCommand cmd3 = new SqlCommand(query3, cnx3);
                                SqlDataReader dr3 = cmd3.ExecuteReader();

                                if (dr3.HasRows)
                                {
                                    while (dr3.Read())
                                    {
                                        banda.Text = dr3["banda"].ToString();
                                    }
                                }
                            }   // cierre de la conn

                            //---PARA SACAR la calificacion kpis
                            using (SqlConnection cnx4 = new SqlConnection(connectionString))
                            {
                                cnx4.Open();
                                string querykpi = " select {fn IFNULL(SUM(ponderacion_ind_jefe),0)} AS total_puntaje_indicadores " +
                                               " from EVA_C_EVALUACION as e, EVA_D_INDICADORES as d " +
                                               " where e.id_eva='" + ideva.Text + "' and e.estatus='2' and d.id_plantilla='" + idplantilla.Text + "'  " +
                                               " and e.id_eva=d.id_eva ";
                                SqlCommand cmd = new SqlCommand(querykpi, cnx4);
                                SqlDataReader drk = cmd.ExecuteReader();

                                if (drk.HasRows)
                                {
                                    while (drk.Read())
                                    {
                                        total_valores_ind.Text = drk["total_puntaje_indicadores"].ToString();
                                    }
                                }
                                else
                                {
                                    total_valores_ind.Text = "No se pudo sacar el puntaje";
                                }
                            }   // cierre de la conn

                            // para sacar la calificacion en Letra 
                            using (SqlConnection cnx5 = new SqlConnection(connectionString))
                            {
                                cnx5.Open();
                                string query5 = " SELECT ponderacion_kpi, calificacion_kpi, descripcion_kpi " +
                                                " FROM   EVA_C_CALIFICACION_KPI " +
                                                " WHERE  ponderacion_kpi <=  '" + total_valores_ind.Text + "' order by 1 ";
                                SqlCommand cmd5 = new SqlCommand(query5, cnx5);

                                SqlDataReader dr5 = cmd5.ExecuteReader();

                                if (dr5.HasRows)
                                {
                                    while (dr5.Read())
                                    {
                                        cal_indicador.Text = dr5["calificacion_kpi"].ToString();
                                    }
                                }
                                else
                                {
                                    //MensajeError("No se encontro Calificacion");
                                    //return;
                                }
                            }



                            if (int.Parse(estatus.Text) == 0)
                            {
                                e.Row.Cells[1].Text = "PENDIENTE DE TERMINAR EVALUACION";
                                e.Row.Cells[2].Text = "-";
                                e.Row.Cells[3].Text = "-";
                                e.Row.Cells[4].Text = "-";
                                e.Row.Cells[5].Text = "-";
                                e.Row.Cells[6].Text = "-";
                                e.Row.Cells[7].Text = "-";
                                e.Row.Cells[8].Text = "-";
                                e.Row.Cells[9].Text = "-";
                                e.Row.Cells[10].Text = "-";

                                bandera = 1;
                            }

                            if (int.Parse(estatus.Text) == 1)
                            {
                                e.Row.Cells[1].Text = "TERMINADA POR EMPLEADO FALTA EVALUACION JEFE INMEDIATO";
                                e.Row.Cells[2].Text = "-";
                                e.Row.Cells[3].Text = "-";
                                e.Row.Cells[4].Text = "-";
                                e.Row.Cells[5].Text = "-";
                                e.Row.Cells[6].Text = "-";
                                e.Row.Cells[7].Text = "-";
                                e.Row.Cells[8].Text = "-";
                                e.Row.Cells[9].Text = "-";
                                e.Row.Cells[10].Text = "-";

                                bandera = 1;
                            }

                            if (int.Parse(estatus.Text) == 2)
                            {
                                e.Row.Cells[1].Text = "EVALUACION LIBERADA";
                                e.Row.Cells[2].Text = puntaje.Text;
                                e.Row.Cells[3].Text = ponderacion.Text;
                                e.Row.Cells[4].Text = cal_indicador.Text;
                                e.Row.Cells[5].Text = fecaptura.Text;
                                e.Row.Cells[6].Text = banda.Text;
                                e.Row.Cells[7].Text = ideva.Text;


                                //DEVUELVE LOS VALORES DEL EBS
                                this.capitalhumano = new NegocioCapitalHumano();

                                TablaEmpleados empleadosEbs = new TablaEmpleados();

                                List<Employee> listaEmpleados = capitalhumano.ListaPersona(idempleado);
                                personaid.Text = listaEmpleados[0].Supervisor.ToString();

                                List<Employee> listaEmpleados2 = capitalhumano.ListaPersonaName(personaid.Text);
                                gerente.Text = listaEmpleados2[0].SupervisorName.ToString();
                                //TextBox1.Text = listaEmpleados2[0].SupervisorNoemp.ToString();

                                e.Row.Cells[8].Text = gerente.Text;
                                bandera = 1;
                                //-------------------------------PARA SACAR LA CALIFICACION TOTAL-----------------------
                                if ((Convert.ToInt32(puntaje.Text) >= 1) && ((Convert.ToInt32(puntaje.Text.Trim())) <= 22))
                                {
                                    if (cal_indicador.Text.Trim() == "A" || cal_indicador.Text.Trim() == "B")
                                    {
                                        calificacion_total.Text = "CRITICO";
                                    }
                                    if (cal_indicador.Text.Trim() == "C-" || cal_indicador.Text.Trim() == "C")
                                    {
                                        calificacion_total.Text = "NECESITA CAPACITAR/ENTRENAR";
                                    }
                                    if (cal_indicador.Text.Trim() == "C+" || cal_indicador.Text.Trim() == "D")
                                    {
                                        calificacion_total.Text = "NECESITA CAPACITAR/ENTRENAR";
                                    }
                                }
                                else
                                {
                                    if ((Convert.ToInt32(puntaje.Text) >= 23) && (Convert.ToInt32(puntaje.Text.Trim()) <= 50))
                                    {
                                        if (cal_indicador.Text.Trim() == "A" || cal_indicador.Text.Trim() == "B")
                                        {
                                            calificacion_total.Text = "NECESITA CAPACITAR/ENTRENAR";
                                        }
                                        if (cal_indicador.Text.Trim() == "C-" || cal_indicador.Text.Trim() == "C")
                                        {
                                            calificacion_total.Text = "RECONOCER Y DESARROLLAR";
                                        }
                                        if (cal_indicador.Text.Trim() == "C+" || cal_indicador.Text.Trim() == "D")
                                        {
                                            calificacion_total.Text = "RECONOCER Y DESARROLLAR";
                                        }
                                    }
                                    else
                                    {
                                        if ((Convert.ToInt32(puntaje.Text) >= 51) && (Convert.ToInt32(puntaje.Text.Trim()) <= 54))
                                        {
                                            if (cal_indicador.Text.Trim() == "A" || cal_indicador.Text.Trim() == "B")
                                            {
                                                calificacion_total.Text = "NECESITA CAPACITAR/ENTRENAR";
                                            }
                                            if (cal_indicador.Text.Trim() == "C-" || cal_indicador.Text.Trim() == "C")
                                            {
                                                calificacion_total.Text = "RECONOCER Y DESARROLLAR";
                                            }
                                            if (cal_indicador.Text.Trim() == "C+" || cal_indicador.Text.Trim() == "D")
                                            {
                                                calificacion_total.Text = "RETENER";
                                            }
                                        }
                                    }
                                }
                                e.Row.Cells[9].Text = calificacion_total.Text;


                                LinkButton button = (LinkButton)e.Row.FindControl("LinkButton1");
                                //string desc = DataBinder.Eval(e.Row.DataItem, "employee_number").ToString();
                                string desc = ideva.Text;

                                //button.Attributes.Add("onclick", string.Format("userSelected('{0}')", desc));


                            }


                        }
                    }
                }

                if (bandera == 0)
                {
                    e.Row.Cells[1].Text = "NO HA REALIZADO LA EVALUACION";
                    e.Row.Cells[1].ForeColor = System.Drawing.Color.Red;
                    e.Row.Cells[2].Text = "-";
                    e.Row.Cells[3].Text = "-";
                    e.Row.Cells[4].Text = "-";
                    e.Row.Cells[5].Text = "-";
                    e.Row.Cells[6].Text = "-";
                    e.Row.Cells[7].Text = "-";
                    e.Row.Cells[8].Text = "-";
                    e.Row.Cells[9].Text = "-";

                }

                //----------------------------------------------------------------------------------------------------------------------------------------------------------

            }

        }
コード例 #16
0
ファイル: RecursosHumanos.cs プロジェクト: tinovo/Sitio
        public List<Employee> CumpleañosMes()
        {
            TablaEmpleados tablaEmpleados = new TablaEmpleados();
            List<Employee> listaEmpleados = tablaEmpleados.ObtenerEbs();

            if (listaEmpleados != null)
            {
                List<Employee> listaCumpleañeros = new List<Employee>();

                foreach (Employee fila in listaEmpleados)
                {
                    DateTime fechaActual = DateTime.Today;

                    if (fila.FechaNacimiento != null && fila.FechaNacimiento != string.Empty)
                    {
                        DateTime fechaEmpleado = Convert.ToDateTime(fila.FechaNacimiento);

                        if (fechaEmpleado.ToString("MM") == fechaActual.ToString("MM"))
                        {
                            if (Convert.ToInt32(fechaEmpleado.ToString("dd")) >= Convert.ToInt32(fechaActual.ToString("dd")))
                            {
                                fila.FechaNacimiento = fechaEmpleado.ToString("dd");
                                listaCumpleañeros.Add(fila);
                            }
                        }
                    }
                }

                this.log = listaCumpleañeros.Count.ToString() + " empleados cumplen años este mes";

                return listaCumpleañeros;

            }
            else
            {
                if (tablaEmpleados.Log == "VACIO")
                {
                    this.log = "No existen cumpleaños este mes";
                }
                else
                {
                    this.log = tablaEmpleados.Log;
                }

                return null;
            }

        }
コード例 #17
0
ファイル: frmConsultaRH.aspx.cs プロジェクト: tinovo/Sitio
        protected void gridBuscarEmpGral_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            int bandera;
            string opcionBusquedaGral = DDBusquedaGral.SelectedItem.Text;
            if (opcionBusquedaGral.Trim() == "Terminado") // si es 2 es de estatus terminada
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    string idempleado = e.Row.Cells[1].Text.ToString();

                    string opcioneva = opcestatus.SelectedItem.Text;

                    // PARA SACAR la plantilla
                    using (SqlConnection cnx2 = new SqlConnection(connectionString))
                    {
                        cnx2.Open();
                        string query = "SELECT id_plantilla FROM EVA_PLANTILLAS WHERE (vigencia_plant = '1')";
                        SqlCommand cmd = new SqlCommand(query, cnx2);
                        SqlDataReader dr = cmd.ExecuteReader();

                        if (dr.HasRows)
                        {
                            while (dr.Read())
                            {
                                idplantilla.Text = dr["id_plantilla"].ToString();
                                Session["idplantilla"] = idplantilla.Text;
                            }
                        }
                    }   // cierre de la conn

                    using (SqlConnection cnx = new SqlConnection(connectionString))
                    {
                        cnx.Open();

                        string query2 = " SELECT a.id_eva as ideva, a.id_emp, a.id_jefe, a.id_categoria_emp, a.id_banda_emp, a.estatus, a.fecha_captura, " +
                                        " DATEDIFF(day,  a.fecha_captura, GETDATE()) AS diastranscurridos, a.ptos_ftes as ptos, a.necesidades, a.comentarios " +
                                        " FROM EVA_C_EVALUACION as a INNER JOIN EVA_D_EVALUACION as d ON a.id_eva=d.id_eva " +
                                        " WHERE (a.id_emp = @noempleado) and d.id_plantilla=@idplantilla " +
                                        " ORDER BY a.fecha_captura";
                        SqlCommand cmd2 = new SqlCommand(query2, cnx);
                        cmd2.Parameters.AddWithValue("@noempleado", idempleado);
                        cmd2.Parameters.AddWithValue("@idplantilla", Session["idplantilla"]);
                        SqlDataReader dr2 = cmd2.ExecuteReader();

                        if (dr2.HasRows)
                        {
                            while (dr2.Read())
                            {
                                ideva.Text = dr2["ideva"].ToString();
                                estatus.Text = dr2["estatus"].ToString();
                                fecaptura.Text = dr2["fecha_captura"].ToString();
                                idbanda.Text = dr2["id_banda_emp"].ToString();

                                string noevaluacion = ideva.Text;

                                // PARA SACAR ELPUNTAJE TOTAL
                                using (SqlConnection cnx2 = new SqlConnection(connectionString))
                                {
                                    cnx2.Open();
                                    string query = " SELECT  SUM(calificacion_val_jefe) AS total_puntaje " +
                                                   " FROM  EVA_D_EVALUACION " +
                                                   " WHERE  (id_eva = '" + ideva.Text + "') ";
                                    SqlCommand cmd = new SqlCommand(query, cnx2);
                                    SqlDataReader dr = cmd.ExecuteReader();

                                    if (dr.HasRows)
                                    {
                                        while (dr.Read())
                                        {
                                            puntaje.Text = dr["total_puntaje"].ToString();
                                        }
                                    }
                                }   // cierre de la conn

                                // PARA SACAR PONDERACION
                                using (SqlConnection cnx2 = new SqlConnection(connectionString))
                                {
                                    cnx2.Open();
                                    string query = " SELECT desc_pond as descripcion_pondera " +
                                                   " FROM   EVA_PONDERA " +
                                                   " WHERE  ('" + puntaje.Text + "' BETWEEN min_pond AND max_pond) ";
                                    SqlCommand cmd = new SqlCommand(query, cnx2);
                                    SqlDataReader dr = cmd.ExecuteReader();

                                    if (dr.HasRows)
                                    {
                                        while (dr.Read())
                                        {
                                            ponderacion.Text = dr["descripcion_pondera"].ToString();
                                        }
                                    }
                                }   // cierre de la conn

                                // PARA SACAR BANDA
                                using (SqlConnection cnx3 = new SqlConnection(connectionString))
                                {
                                    cnx3.Open();
                                    string query3 = " SELECT id_banda, banda FROM EVA_BANDA where id_banda='" + idbanda.Text + "' ";
                                    SqlCommand cmd3 = new SqlCommand(query3, cnx3);
                                    SqlDataReader dr3 = cmd3.ExecuteReader();

                                    if (dr3.HasRows)
                                    {
                                        while (dr3.Read())
                                        {
                                            banda.Text = dr3["banda"].ToString();
                                        }
                                    }
                                }   // cierre de la conn

                                //---PARA SACAR la calificacion kpis
                                using (SqlConnection cnx4 = new SqlConnection(connectionString))
                                {
                                    cnx4.Open();
                                    string querykpi = " select {fn IFNULL(SUM(ponderacion_ind_jefe),0)} AS total_puntaje_indicadores " +
                                                   " from EVA_C_EVALUACION as e, EVA_D_INDICADORES as d " +
                                                   " where e.id_eva='" + ideva.Text + "' and e.estatus='2' and d.id_plantilla='" + idplantilla.Text + "'  " +
                                                   " and e.id_eva=d.id_eva ";
                                    SqlCommand cmd = new SqlCommand(querykpi, cnx4);
                                    SqlDataReader drk = cmd.ExecuteReader();

                                    if (drk.HasRows)
                                    {
                                        while (drk.Read())
                                        {
                                            total_valores_ind.Text = drk["total_puntaje_indicadores"].ToString();
                                        }
                                    }
                                    else
                                    {
                                        total_valores_ind.Text = "No se pudo sacar el puntaje";
                                    }
                                }   // cierre de la conn

                                // para sacar la calificacion en Letra 
                                using (SqlConnection cnx5 = new SqlConnection(connectionString))
                                {
                                    cnx5.Open();
                                    string query5 = " SELECT ponderacion_kpi, calificacion_kpi, descripcion_kpi " +
                                                    " FROM   EVA_C_CALIFICACION_KPI " +
                                                    " WHERE  ponderacion_kpi <=  '" + total_valores_ind.Text + "' order by 1 ";
                                    SqlCommand cmd5 = new SqlCommand(query5, cnx5);

                                    SqlDataReader dr5 = cmd5.ExecuteReader();

                                    if (dr5.HasRows)
                                    {
                                        while (dr5.Read())
                                        {
                                            cal_indicador.Text = dr5["calificacion_kpi"].ToString();
                                        }
                                    }
                                    else
                                    {
                                        //MensajeError("No se encontro Calificacion");
                                        //return;
                                    }

                                    //DEVUELVE LOS VALORES DEL EBS
                                    this.capitalhumano = new NegocioCapitalHumano();
                                    TablaEmpleados empleadosEbs = new TablaEmpleados();
                                    try
                                    {
                                        List<Employee> listaEmpleados = capitalhumano.ListaEmpleados(idempleado, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));

                                        if (listaEmpleados != null)
                                        {
                                            nombreemp.Text = listaEmpleados[0].NombreCompleto.ToString();
                                        }
                                        else
                                        {
                                            MensajeError(capitalhumano.Log);
                                            nombreemp.Text = idempleado;
                                        }
                                    }
                                    catch (Exception e3)
                                    {
                                        throw e3;
                                    }
                                    //empnec.Text = idempleado + "<br>" + nombreemp.Text;
                                    empnec.Text = nombreemp.Text;
                                }
                                if (int.Parse(estatus.Text) == 0)
                                {
                                    e.Row.Cells[1].Text = "PENDIENTE DE TERMINAR EVALUACION";
                                    e.Row.Cells[2].Text = "-";
                                    e.Row.Cells[3].Text = "-";
                                    e.Row.Cells[4].Text = "-";
                                    e.Row.Cells[5].Text = "-";
                                    e.Row.Cells[6].Text = "-";
                                    e.Row.Cells[7].Text = "-";
                                    e.Row.Cells[8].Text = "-";
                                    e.Row.Cells[9].Text = "-";
                                    e.Row.Cells[10].Text = "-";
                                    bandera = 1;
                                }
                                if (int.Parse(estatus.Text) == 1)
                                {
                                    e.Row.Cells[1].Text = "TERMINADA POR EMPLEADO FALTA EVALUACION JEFE INMEDIATO";
                                    e.Row.Cells[2].Text = "-";
                                    e.Row.Cells[3].Text = "-";
                                    e.Row.Cells[4].Text = "-";
                                    e.Row.Cells[5].Text = "-";
                                    e.Row.Cells[6].Text = "-";
                                    e.Row.Cells[7].Text = "-";
                                    e.Row.Cells[8].Text = "-";
                                    e.Row.Cells[9].Text = "-";
                                    e.Row.Cells[10].Text = "-";
                                    bandera = 1;
                                }
                                if (int.Parse(estatus.Text) == 2)
                                {
                                    e.Row.Cells[0].Text = empnec.Text;
                                    e.Row.Cells[1].Text = "EVALUACION LIBERADA";
                                    e.Row.Cells[2].Text = puntaje.Text;
                                    e.Row.Cells[3].Text = ponderacion.Text;
                                    e.Row.Cells[4].Text = cal_indicador.Text;
                                    e.Row.Cells[5].Text = fecaptura.Text;
                                    e.Row.Cells[6].Text = banda.Text;
                                    e.Row.Cells[7].Text = ideva.Text;
                                    //DEVUELVE LOS VALORES DEL EBS
                                    this.capitalhumano = new NegocioCapitalHumano();
                                    TablaEmpleados empleadosEbs = new TablaEmpleados();
                                    List<Employee> listaEmpleados = capitalhumano.ListaPersona(idempleado);

                                    if (listaEmpleados != null)
                                    {
                                        personaid.Text = listaEmpleados[0].Supervisor.ToString();
                                        List<Employee> listaEmpleados2 = capitalhumano.ListaPersonaName(personaid.Text);
                                        if (listaEmpleados2 != null)
                                        {
                                            gerente.Text = listaEmpleados2[0].SupervisorName.ToString();
                                            //TextBox1.Text = listaEmpleados2[0].SupervisorNoemp.ToString();
                                            e.Row.Cells[8].Text = gerente.Text;
                                            bandera = 1;
                                        }
                                        else
                                        {
                                            MensajeErrorFiltros(capitalhumano.Log);
                                        }
                                    }
                                    else
                                    {
                                        MensajeErrorFiltros(capitalhumano.Log);
                                    }

                                    //================================PARA SACAR RESULTADO DE LA CALIFICION GRAL============
                                    if ((Convert.ToInt32(puntaje.Text) >= 1) && ((Convert.ToInt32(puntaje.Text.Trim())) <= 22))
                                    {
                                        if (cal_indicador.Text.Trim() == "A" || cal_indicador.Text.Trim() == "B")
                                        {
                                            calificacion_total.Text = "CRITICO";
                                        }
                                        if (cal_indicador.Text.Trim() == "C-" || cal_indicador.Text.Trim() == "C")
                                        {
                                            calificacion_total.Text = "NECESITA CAPACITAR/ENTRENAR";
                                        }
                                        if (cal_indicador.Text.Trim() == "C+" || cal_indicador.Text.Trim() == "D")
                                        {
                                            calificacion_total.Text = "NECESITA CAPACITAR/ENTRENAR";
                                        }
                                    }
                                    else
                                    {
                                        if ((Convert.ToInt32(puntaje.Text) >= 23) && (Convert.ToInt32(puntaje.Text.Trim()) <= 50))
                                        {
                                            if (cal_indicador.Text.Trim() == "A" || cal_indicador.Text.Trim() == "B")
                                            {
                                                calificacion_total.Text = "NECESITA CAPACITAR/ENTRENAR";
                                            }
                                            if (cal_indicador.Text.Trim() == "C-" || cal_indicador.Text.Trim() == "C")
                                            {
                                                calificacion_total.Text = "RECONOCER Y DESARROLLAR";
                                            }
                                            if (cal_indicador.Text.Trim() == "C+" || cal_indicador.Text.Trim() == "D")
                                            {
                                                calificacion_total.Text = "RECONOCER Y DESARROLLAR";
                                            }
                                        }
                                        else
                                        {
                                            if ((Convert.ToInt32(puntaje.Text) >= 51) && (Convert.ToInt32(puntaje.Text.Trim()) <= 54))
                                            {
                                                if (cal_indicador.Text.Trim() == "A" || cal_indicador.Text.Trim() == "B")
                                                {
                                                    calificacion_total.Text = "NECESITA CAPACITAR/ENTRENAR";
                                                }
                                                if (cal_indicador.Text.Trim() == "C-" || cal_indicador.Text.Trim() == "C")
                                                {
                                                    calificacion_total.Text = "RECONOCER Y DESARROLLAR";
                                                }
                                                if (cal_indicador.Text.Trim() == "C+" || cal_indicador.Text.Trim() == "D")
                                                {
                                                    calificacion_total.Text = "RETENER";
                                                }
                                            }
                                        }
                                    }
                                    e.Row.Cells[9].Text = calificacion_total.Text;
                                    //======================================================================================
                                    LinkButton button = (LinkButton)e.Row.FindControl("LinkButton1");
                                    //string desc = DataBinder.Eval(e.Row.DataItem, "employee_number").ToString();
                                    string desc = ideva.Text;

                                    button.Attributes.Add("onclick", string.Format("userSelected('{0}')", desc));

                                }
                            }
                        }
                    }

                } // if del grid del RowDataBound
            }
            else
            {
                // TODOS LOS EMPLEADOS CON ESTATUS TERMINADO
                if (opcionBusquedaGral.Trim() == "Pendiente") // si es 2 es de estatus terminada
                {
                    if (e.Row.RowType == DataControlRowType.DataRow)
                    {
                        string idempleado = e.Row.Cells[1].Text.ToString();
                        string opcioneva = opcestatus.SelectedItem.Text;
                        // PARA SACAR la plantilla
                        using (SqlConnection cnx2 = new SqlConnection(connectionString))
                        {
                            cnx2.Open();
                            string query = "SELECT id_plantilla FROM EVA_PLANTILLAS WHERE (vigencia_plant = '1')";
                            SqlCommand cmd = new SqlCommand(query, cnx2);
                            SqlDataReader dr = cmd.ExecuteReader();
                            if (dr.HasRows)
                            {
                                while (dr.Read())
                                {
                                    idplantilla.Text = dr["id_plantilla"].ToString();
                                    Session["idplantilla"] = idplantilla.Text;
                                }
                            }
                        }  // cierre de la conn

                        using (SqlConnection cnx = new SqlConnection(connectionString))
                        {
                            cnx.Open();

                            string query2 = " SELECT a.id_eva as ideva, a.id_emp, a.id_jefe, a.id_categoria_emp, a.id_banda_emp, a.estatus, a.fecha_captura, " +
                                            " DATEDIFF(day,  a.fecha_captura, GETDATE()) AS diastranscurridos, a.ptos_ftes as ptos, a.necesidades, a.comentarios " +
                                            " FROM EVA_C_EVALUACION as a INNER JOIN EVA_D_EVALUACION as d ON a.id_eva=d.id_eva " +
                                            " WHERE (a.id_emp = @noempleado) and d.id_plantilla= @idplantilla " +
                                            " ORDER BY a.fecha_captura ";
                            SqlCommand cmd2 = new SqlCommand(query2, cnx);
                            cmd2.Parameters.AddWithValue("@noempleado", idempleado);
                            cmd2.Parameters.AddWithValue("@idplantilla", Session["idplantilla"]);
                            SqlDataReader dr2 = cmd2.ExecuteReader();

                            if (dr2.HasRows)
                            {
                                while (dr2.Read())
                                {
                                    ideva.Text = dr2["ideva"].ToString();
                                    estatus.Text = dr2["estatus"].ToString();
                                    fecaptura.Text = dr2["fecha_captura"].ToString();
                                    idbanda.Text = dr2["id_banda_emp"].ToString();
                                    string noevaluacion = ideva.Text;
                                }
                            }
                            else
                            {
                                estatus.Text = "8";
                            }
                        }

                        string puestoregistrado = "";
                        string mesContratacion = "";

                        //DEVUELVE LOS VALORES DEL EBS
                        this.capitalhumano = new NegocioCapitalHumano();
                        TablaEmpleados empleadosEbs = new TablaEmpleados();
                        try
                        {
                            List<Employee> listaEmpleados = capitalhumano.ListaEmpleados(idempleado, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));

                            if (listaEmpleados != null)
                            {
                                nombreemp.Text = listaEmpleados[0].NombreCompleto.ToString();
                                ubicacion.Text = listaEmpleados[0].Ubicacion.ToString();
                                puesto.Text = listaEmpleados[0].Puesto.ToString();
                                fechacontratacion.Text = listaEmpleados[0].FechaContratacion.ToString();
                                mesContratacion = listaEmpleados[0].mesContratacion.ToString();
                            }
                            else
                            {
                                MensajeError(capitalhumano.Log);
                            }
                        }
                        catch (Exception e3)
                        {
                            throw e3;
                        }
                        //empnec.Text = idempleado + "<br>" + nombreemp.Text;
                        empnec.Text = nombreemp.Text;

                        // para revisar si tiene justificacion por no realizar la evaluacion para no mostrarlo
                        using (SqlConnection cnx5 = new SqlConnection(connectionString))
                        {
                            cnx5.Open();
                            string query5 = " SELECT     id_observacion, id_plantilla, id_emp, observacion " +
                                            " FROM EVA_D_OBSERVACIONES " +
                                            " WHERE (id_emp =  '" + idempleado + "') and id_plantilla='" + idplantilla.Text + "' ";
                            SqlCommand cmd5 = new SqlCommand(query5, cnx5);

                            SqlDataReader dr5 = cmd5.ExecuteReader();

                            if (dr5.HasRows)
                            {
                                while (dr5.Read())
                                {
                                    justificacion.Text = dr5["observacion"].ToString();
                                }
                            }
                            else
                            {
                                justificacion.Text = "-";
                            }
                        }


                        string puestosinno = "";
                        if (puesto.Text != string.Empty)
                        {
                            puestoregistrado = puesto.Text;
                            string[] parts = puestoregistrado.Split('.');
                            puestosinno = parts[2];
                        }
                        if (puestosinno == "RESIDENTE")
                        {
                            justificacion.Text = "RESIDENTE";
                        }
                        //para quitar a los q tengan menos de 3 meses
                        decimal antiguedadm;
                        antiguedadm = 0;
                        if (mesContratacion != string.Empty)
                        {
                            antiguedadm = Convert.ToDecimal(mesContratacion);
                        }

                        if ((antiguedadm <= 3) && (justificacion.Text == "-"))
                        {
                            justificacion.Text = "Antiguedad menos de 3 meses: " + fechacontratacion.Text;
                        }

                        ////DEVUELVE LOS VALORES DEL EBS
                        //this.capitalhumano = new RecursosHumanos();
                        //TablaEmpleados empleadosEbs = new TablaEmpleados();
                        //try
                        //{
                        //    List<Employee> listaEmpleados = capitalhumano.ListaEmpleados(idempleado, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));
                        //    if (listaEmpleados != null)
                        //    {
                        //        nombreemp.Text = listaEmpleados[0].NombreCompleto.ToString();
                        //        //supervisor.Text = listaEmpleados[0].SupervisorNoemp.ToString();

                        //        List<Employee> listaEmpleados2 = capitalhumano.ListaPersonaName(personaid.Text);
                        //        if (listaEmpleados2 != null)
                        //        {
                        //            gerente.Text = listaEmpleados2[0].SupervisorName.ToString();
                        //            //TextBox1.Text = listaEmpleados2[0].SupervisorNoemp.ToString();
                        //            e.Row.Cells[8].Text = gerente.Text;
                        //            bandera = 1;
                        //        }
                        //        else
                        //        {
                        //            MensajeErrorFiltros(capitalhumano.Log);
                        //        }

                        //    }
                        //    else
                        //    {
                        //        MensajeError(capitalhumano.Log);
                        //    }
                        //}
                        //catch (Exception e3)
                        //{
                        //    throw e3;
                        //}
                        //empnec.Text = idempleado + "<br>" + nombreemp.Text;
                        //empnec.Text = idempleado;


                        if (int.Parse(estatus.Text) == 8)
                        {
                            e.Row.Cells[0].Text = empnec.Text;
                            e.Row.Cells[1].Text = "NO HA REALIZADO LA EVALUACION";
                            e.Row.Cells[2].Text = ubicacion.Text;
                            e.Row.Cells[3].Text = puesto.Text;
                            e.Row.Cells[4].Text = fechacontratacion.Text;
                            e.Row.Cells[5].Text = "-";
                            e.Row.Cells[6].Text = "-";
                            e.Row.Cells[7].Text = "-";
                            // e.Row.Cells[8].Text = "-";
                            //DEVUELVE LOS VALORES DEL EBS

                            List<Employee> listaEmpleados = capitalhumano.ListaPersona(idempleado);

                            if (listaEmpleados != null)
                            {
                                personaid.Text = listaEmpleados[0].Supervisor.ToString();
                                List<Employee> listaEmpleados2 = capitalhumano.ListaPersonaName(personaid.Text);
                                if (listaEmpleados2 != null)
                                {
                                    gerente.Text = listaEmpleados2[0].SupervisorName.ToString();
                                    //TextBox1.Text = listaEmpleados2[0].SupervisorNoemp.ToString();
                                    e.Row.Cells[8].Text = gerente.Text;
                                    bandera = 1;
                                }
                                else
                                {
                                    MensajeErrorFiltros(capitalhumano.Log);
                                }
                            }
                            else
                            {
                                MensajeErrorFiltros(capitalhumano.Log);
                            }
                        }

                        if (int.Parse(estatus.Text) == 0)
                        {
                            e.Row.Cells[0].Text = empnec.Text;
                            e.Row.Cells[1].Text = "PENDIENTE DE TERMINAR EVALUACION";
                            e.Row.Cells[2].Text = ubicacion.Text;
                            e.Row.Cells[3].Text = puesto.Text;
                            e.Row.Cells[4].Text = fechacontratacion.Text;
                            e.Row.Cells[5].Text = "-";
                            e.Row.Cells[6].Text = "-";
                            e.Row.Cells[7].Text = "-";
                            //e.Row.Cells[8].Text = "-";
                            List<Employee> listaEmpleados = capitalhumano.ListaPersona(idempleado);

                            if (listaEmpleados != null)
                            {
                                personaid.Text = listaEmpleados[0].Supervisor.ToString();
                                List<Employee> listaEmpleados2 = capitalhumano.ListaPersonaName(personaid.Text);
                                if (listaEmpleados2 != null)
                                {
                                    gerente.Text = listaEmpleados2[0].SupervisorName.ToString();
                                    //TextBox1.Text = listaEmpleados2[0].SupervisorNoemp.ToString();
                                    e.Row.Cells[8].Text = gerente.Text;
                                    bandera = 1;
                                }
                                else
                                {
                                    MensajeErrorFiltros(capitalhumano.Log);
                                }
                            }
                            else
                            {
                                MensajeErrorFiltros(capitalhumano.Log);
                            }
                        }

                        if (int.Parse(estatus.Text) == 1)
                        {
                            e.Row.Cells[0].Text = empnec.Text;
                            e.Row.Cells[1].Text = "TERMINADA POR EMPLEADO FALTA EVALUACION JEFE INMEDIATO";
                            e.Row.Cells[2].Text = ubicacion.Text;
                            e.Row.Cells[3].Text = puesto.Text;
                            e.Row.Cells[4].Text = fechacontratacion.Text;
                            e.Row.Cells[5].Text = "-";
                            e.Row.Cells[6].Text = "-";
                            e.Row.Cells[7].Text = "-";
                            //e.Row.Cells[8].Text = "-";
                            List<Employee> listaEmpleados = capitalhumano.ListaPersona(idempleado);

                            if (listaEmpleados != null)
                            {
                                personaid.Text = listaEmpleados[0].Supervisor.ToString();
                                List<Employee> listaEmpleados2 = capitalhumano.ListaPersonaName(personaid.Text);
                                if (listaEmpleados2 != null)
                                {
                                    gerente.Text = listaEmpleados2[0].SupervisorName.ToString();
                                    //TextBox1.Text = listaEmpleados2[0].SupervisorNoemp.ToString();
                                    e.Row.Cells[8].Text = gerente.Text;
                                    bandera = 1;
                                }
                                else
                                {
                                    MensajeErrorFiltros(capitalhumano.Log);
                                }
                            }
                            else
                            {
                                MensajeErrorFiltros(capitalhumano.Log);
                            }
                        }

                        if (int.Parse(estatus.Text) == 2)
                        {
                            //e.Row.Cells[0].Text = empnec.Text;
                            //e.Row.Cells[1].Text = "TERMINO CICLO DE LA EVALUACION ";
                            //e.Row.Cells[2].Text = ubicacion.Text;
                            //e.Row.Cells[3].Text = puesto.Text;
                            //e.Row.Cells[4].Text = fechacontratacion.Text;
                            //e.Row.Cells[5].Text = "-";
                            //e.Row.Cells[6].Text = "-";
                            //e.Row.Cells[7].Text = "-";
                            //e.Row.Cells[8].Text = "";
                            //e.Row.Cells[9].Text = "";

                            e.Row.Cells[0].Visible = false;
                            e.Row.Cells[1].Visible = false;
                            e.Row.Cells[2].Visible = false;
                            e.Row.Cells[3].Visible = false;
                            e.Row.Cells[4].Visible = false;
                            e.Row.Cells[5].Visible = false;
                            e.Row.Cells[6].Visible = false;
                            e.Row.Cells[7].Visible = false;
                            e.Row.Cells[8].Visible = false;
                            e.Row.Cells[9].Visible = false;
                            e.Row.Cells[10].Visible = false;
                        }

                        if (justificacion.Text != "-")   //para empleados que no pudieron realizar su evaluacion
                        {
                            e.Row.Cells[1].Text = "NO REALIZO EVALUACION - OBSERVACION";
                            e.Row.Cells[2].Text = justificacion.Text;
                            e.Row.Cells[3].Text = "-";
                            e.Row.Cells[4].Text = "-";
                            e.Row.Cells[5].Text = "-";
                            e.Row.Cells[6].Text = "-";
                            e.Row.Cells[7].Text = "-";
                            e.Row.Cells[8].Text = "-";
                            e.Row.Cells[9].Text = "-";
                            e.Row.Cells[10].Text = "-";
                            bandera = 1;
                        }
                    }
                }
            }
        }
コード例 #18
0
ファイル: RecursosHumanos.cs プロジェクト: tinovo/Sitio
        public List<Employee> ListaPersona(string parNumeroEmpleado)
        {
            TablaEmpleados tablaEmpleados2 = new TablaEmpleados();

            List<Employee> listaPersona = tablaEmpleados2.ObtenerPersonaid(parNumeroEmpleado);

            if (listaPersona != null)
            {
                this.log = "Se encontraron " + tablaEmpleados2.Log + " empleados";
                return listaPersona;
            }
            else
            {
                if (tablaEmpleados2.Log == "VACIO")
                {
                    this.log = "No se encontraro empleados con los siguientes filtros: " + "\n" +
                                "\t Clave Persona: " + parNumeroEmpleado;
                }
                else
                {
                    this.log = tablaEmpleados2.Log;
                }

                return null;
            }
        }
コード例 #19
0
ファイル: frmConsultaRH.aspx.cs プロジェクト: tinovo/Sitio
        protected void Page_Load(object sender, EventArgs e)
        {
            ValidadSession();

            if (!Page.IsPostBack)
            {
                try
                {
                    //DEVUELVE LOS VALORES DEL EBS
                    this.capitalhumano = new NegocioCapitalHumano();
                    TablaEmpleados empleadosEbs = new TablaEmpleados();
                    DataTable table = empleadosEbs.departamentos();
                    lista_depto.DataSource = table;
                    lista_depto.DataValueField = "idorganization";
                    lista_depto.DataTextField = "name";
                    lista_depto.DataBind();
                    lista_depto.SelectedIndex = 0;
                }
                catch (Exception e3)
                {
                    throw e3;
                }
                panel1.Visible = false;

                usuario.Text = (string)(Session["Nombre"]);

                using (SqlConnection cnxdel = new SqlConnection(connectionString))
                {
                    cnxdel.Open();
                    string query_del = " DELETE FROM   EVA_C_GRAFICA " +
                                       " WHERE iduser= '******' ";
                    SqlCommand cmdd = new SqlCommand(query_del, cnxdel);
                    SqlDataReader drd = cmdd.ExecuteReader();
                }
                using (SqlConnection cnxdel = new SqlConnection(connectionString))
                {
                    cnxdel.Open();
                    string query_del = " DELETE FROM EVA_D_GRAFICA " +
                                       " WHERE usuario= '" + usuario.Text + "' ";
                    SqlCommand cmdd = new SqlCommand(query_del, cnxdel);
                    SqlDataReader drd = cmdd.ExecuteReader();
                }

                empcritico.Text = "";
                empnec.Text = "";
                empreconocer.Text = "";
                empretener.Text = "";
                //renderChart(); se comento 8dic2014
            }
        }
コード例 #20
0
ファイル: RecursosHumanos.cs プロジェクト: tinovo/Sitio
        public List<Employee> ListaPersonaName(string parPersonid)
        {
            TablaEmpleados tablaEmpleados3 = new TablaEmpleados();

            List<Employee> listaPersonaname = tablaEmpleados3.ObtenerNomSupervisor(parPersonid);

            if (listaPersonaname != null)
            {
                this.log = "Se encontro nombre supervisor " + tablaEmpleados3.Log + "del  empleado";
                return listaPersonaname;
            }
            else
            {
                if (tablaEmpleados3.Log == "VACIO")
                {
                    this.log = "No se encontraro empleados con los siguientes filtros: " + "\n" +
                                "\t Clave Persona: " + parPersonid;
                }
                else
                {
                    this.log = tablaEmpleados3.Log;
                }

                return null;
            }
        }
コード例 #21
0
ファイル: frmEnvio_correo.aspx.cs プロジェクト: tinovo/Sitio
        protected void Page_Load(object sender, EventArgs e)
        {
            mensaje = "";
            mensaje_ind = "";
            mensaje1_ind = "";
            mensaje3 = "";
            cal_valores = "";
            lbfaltaInd = "";
            correo_empleado = "";
            mensaje_obs = "";
            ptos_jefe = "";
            comentario_jefe = "";
            necesidad_jefe = "";
            ban = "";
            total_valores_ind = "";
            cal_indicador = "";


            ideva.Text = Convert.ToString(Request.QueryString["ideva"]);

            ///-=======================================ENVIA CORREO AL EMPLEADO================================================
            // -------- PARA ENVIAR CORREO DE CONFIRMACION  -------------------------------------------------------
            string connectionString = ConfigurationManager.ConnectionStrings["conexionAPPS"].ConnectionString;
            //usuario myUsuario = new usuario();
            //usuarioBO myUsuarioBO = new usuarioBO();
            //txtUser.Text = (string)(Session["Puesto"]);

            //if (IsEmail(txtUser.Text))
            //{
            //    myUsuario.Correo = txtUser.Text;
            //    myUsuario = myUsuarioBO.RetrievexCorreo(myUsuario);

            //}
            //else
            //{
            //    myUsuario.Usuario = txtUser.Text;
            //    myUsuario = myUsuarioBO.Retrieve(myUsuario);
            //}

            //saco la plantilla actual
            using (SqlConnection cnx = new SqlConnection(connectionString))
            {
                cnx.Open();
                string query = "SELECT id_plantilla FROM EVA_PLANTILLAS WHERE (vigencia_plant = '1')";
                SqlCommand cmd = new SqlCommand(query, cnx);
                SqlDataReader dr = cmd.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        idplantilla.Text = dr["id_plantilla"].ToString();
                    }
                }
                else
                {
                    idplantilla.Text = "No se encontro plantilla autorizada";
                }

            }   // cierre de la conn

            using (SqlConnection cnxe = new SqlConnection(connectionString))
            {
                cnxe.Open();

                string querye = " SELECT  id_eva, id_emp, id_jefe, id_categoria_emp, id_banda_emp, estatus, " +
                               " ptos_ftes_jefe, necesidades_jefe, comentarios_jefe, fecha_captura_jefe " + " FROM  EVA_C_EVALUACION" +
                              " WHERE (id_eva = '" + ideva.Text + "') ";
                SqlCommand cmde = new SqlCommand(querye, cnxe);
                SqlDataReader dre = cmde.ExecuteReader();

                if (dre.HasRows)
                {
                    while (dre.Read())
                    {
                        ban = dre["id_banda_emp"].ToString();
                        lbEmpleados.Text = dre["id_emp"].ToString();
                        ptos_jefe = dre["ptos_ftes_jefe"].ToString();
                        comentario_jefe = dre["comentarios_jefe"].ToString();
                        necesidad_jefe = dre["necesidades_jefe"].ToString();
                    }
                }
            }   // cierre de la conn

            //DEVUELVE LOS VALORES DEL EBS
            this.capitalHumano = new NegocioCapitalHumano();

            TablaEmpleados empleadosEbs = new TablaEmpleados();

            try
            {
                List<Employee> listaEmpleados = capitalHumano.ListaEmpleados(lbEmpleados.Text, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));
                TxtPuesto.Text = listaEmpleados[0].Puesto.ToString();
                TxtDepto.Text = listaEmpleados[0].Organizacion.ToString();
            }
            catch (Exception e3)
            {
                throw e3;
            }
            string separarpto = TxtPuesto.Text;
            if (separarpto == null || separarpto == "")
            {
                MensajeError("No se encuentra asignado su Puesto o Depto en BD, consulte con Capital Humano");
                return;
            }
            else
            {
                // Split separator
                string[] parts = separarpto.Split('.');
                Depto.Text = parts[0];
                Pto.Text = parts[1];
            }



            // MUESTRA EL GRID
            //String mensaje = String.Format("Tus datos de acceso a Apps son los siguientes: <br /><br />Usuario: {0}<br />Password: {1}", myUsuario.Usuario, myUsuario.Password);
            //enviarCorreo.EnviaMail("Recuperación de password", mensaje, myUsuario.Correo);
            string mensaje1 = " <table class=style1 font-family='calibri'> " +
                    " <tr><td colspan='5' align='center'><strong>   SECCION VALORES  </strong></td></tr> " +
                    " <tr> " +
                        " <td style=background-color: #C0C0C0> " +
                            " <strong>COMPORTAMIENTO</strong></td> " +
                        " <td style=background-color: #C0C0C0> " +
                            " <strong>DESCRIPCION 1</strong></td> " +
                        " <td style=background-color: #C0C0C0> " +
                            " <strong>DESCRIPCION 2</strong></td> " +
                        " <td style=background-color: #C0C0C0> " +
                            " <strong>DESCRIPCION 3</strong></td> " +
                        " <td style=background-color: #C0C0C0> " +
                            " <strong>SELECCIONADA</strong></td> " +
                    " </tr> <tr>";


            using (SqlConnection cnxee = new SqlConnection(connectionString))
            {

                cnxee.Open();
                string queryee = "SELECT d.d_partida_eva as idpe, d.id_eva as ideva, d.id_plantilla, d.c_seccion, d.c_valor as valor2, d.c_comportamiento as comp, " +
                               "d.calificacion_val_emp as calificacionemp, d.calificacion_val_jefe as calificacionjefe, d.id_ind, v.valornuvoil as valor, " +
                              " d.calificacion_ind_emp, d.calificacion_id_jefe, v.conducta1 as c1, v.conducta2 as c2, v.conducta3 as c3, v.c_banda, c.d_valor as nomvalor " +
                              " FROM   EVA_D_EVALUACION AS d INNER JOIN " +
                              " EVA_D_VALORES AS v ON d.c_comportamiento = v.c_comportamiento INNER JOIN " +
                              " EVA_C_VALORES AS c ON v.c_comportamiento = c.c_valor " +
                              " WHERE (d.id_eva = '" + ideva.Text + "') AND (v.c_banda = '" + ban + "') AND (d.id_plantilla = '" + idplantilla.Text + "') ";

                SqlCommand cmdee = new SqlCommand(queryee, cnxee);
                SqlDataReader dree = cmdee.ExecuteReader();
                if (dree.HasRows)
                {
                    while (dree.Read())
                    {

                        mensaje = mensaje + " <tr> <td> " + dree["nomvalor"].ToString() + " </td> " +
                                   " <td> " + dree["c1"].ToString() + " </td> " +
                                   " <td> " + dree["c2"].ToString() + " </td> " +
                                   " <td> " + dree["c3"].ToString() + " </td> " +
                                   " <td align='center'> " + dree["calificacionjefe"].ToString() + " </td> </tr>";
                    }
                    //mensaje = mensaje +                                  
                }
                mensaje3 = mensaje1 + mensaje + "</table>";
            }

            using (SqlConnection cnxe2 = new SqlConnection(connectionString))
            {
                mensaje1_ind = " <table class=style1 font-family='calibri'> " +
                    " <tr><td colspan='5' align='center'><strong>  SECCION INDICADORES  </strong></td></tr> " +
                    " <tr> " +
                        " <td style=background-color: #C0C0C0> " +
                            " <strong>LINEA</strong></td> " +
                        " <td style=background-color: #C0C0C0> " +
                            " <strong>DESCRIPCION</strong></td> " +
                        " <td style=background-color: #C0C0C0> " +
                            " <strong>UNIDAD MEDIDA</strong></td> " +
                        " <td style=background-color: #C0C0C0> " +
                            " <strong>SELECCIONADO</strong></td> " +
                    //" <td style=background-color: #C0C0C0> " +
                    //    " <strong>CALIFICACION</strong></td> " +
                    " </tr> <tr>";

                cnxe2.Open();
                string query2 = " SELECT    d.id_eva as ideva, d.id_plantilla as idplantilla, d.depto as depto, d.puesto as puesto, d.id_linea as idlinea, d.resultado_logrado as reslogrado, d.resultado_logrado_jefe as reslogradojefe, " +
                       " d.ptos, d.ponderacion_ind as ponderacionind, c.descripcion_kpi as descripcion_kpi, c.unidad_medida as umedida, c.porcentaje_pondera as porcentaje_pondera, " +
                       " c.meta_minima as meta_minima, c.meta_satisfactoria as meta_satisfactoria, c.meta_excelente as meta_excelente, d.calificacion_ind_jefe as calindjefe " +
                       " FROM  EVA_D_INDICADORES as d, EVA_C_INDICADORES  as c " +
                       " WHERE d.depto=c.depto and d.puesto=c.puesto and d.id_plantilla=c.id_plantilla and " +
                       " d.id_linea=c.id_linea and (d.id_eva = '" + ideva.Text + "') and d.id_plantilla='" + idplantilla.Text + "' and " +
                       " d.depto='" + Depto.Text + "' and d.puesto='" + Pto.Text + "' ";

                SqlCommand cmd2 = new SqlCommand(query2, cnxe2);
                SqlDataReader dr2 = cmd2.ExecuteReader();
                if (dr2.HasRows)
                {
                    while (dr2.Read())
                    {
                        mensaje_ind = mensaje_ind + " <tr> <td> " + dr2["idlinea"].ToString() + " </td> " +
                                          " <td> " + dr2["descripcion_kpi"].ToString() + " </td> " +
                                          " <td> " + dr2["umedida"].ToString() + " </td> " +
                                          " <td> " + dr2["reslogradojefe"].ToString() + " </td></tr> ";
                        //" <td> " + dr2["calindjefe"].ToString() + " </td> </tr>";
                    }
                }


            }

            //---PARA SACAR la calificacion kpis

            using (SqlConnection cnx4 = new SqlConnection(connectionString))
            {
                cnx4.Open();
                string querykpi = " select {fn IFNULL(SUM(ponderacion_ind_jefe),0)} AS total_puntaje_indicadores  " +
                               " from EVA_C_EVALUACION as e, EVA_D_INDICADORES as d " +
                               " where e.id_eva='" + ideva.Text + "' and e.estatus='2' and d.id_plantilla='" + idplantilla.Text + "'  " +
                               " and e.id_eva=d.id_eva ";
                SqlCommand cmdi = new SqlCommand(querykpi, cnx4);
                SqlDataReader drk = cmdi.ExecuteReader();

                if (drk.HasRows)
                {
                    while (drk.Read())
                    {
                        total_valores_ind = drk["total_puntaje_indicadores"].ToString();
                    }
                }
                else
                {
                    total_valores_ind = "0";
                }
            }   // cierre de la conn

            // para sacar la calificacion en Letra 
            using (SqlConnection cnx5 = new SqlConnection(connectionString))
            {
                cnx5.Open();
                string query5 = " SELECT ponderacion_kpi, calificacion_kpi, descripcion_kpi " +
                                " FROM   EVA_C_CALIFICACION_KPI " +
                                " WHERE  ponderacion_kpi <=  '" + total_valores_ind + "' order by 1 ";
                SqlCommand cmd5 = new SqlCommand(query5, cnx5);

                SqlDataReader dr5 = cmd5.ExecuteReader();

                if (dr5.HasRows)
                {
                    while (dr5.Read())
                    {
                        cal_indicador = dr5["calificacion_kpi"].ToString();
                    }
                }
            }

            // para sacar la calificacion de valores
            using (SqlConnection cnx6 = new SqlConnection(connectionString))
            {
                cnx6.Open();
                string query6 = " SELECT SUM(d.calificacion_val_emp) as total_calificacionemp, SUM(d.calificacion_val_jefe) as total_calificacion_val_jefe " +
                                " FROM   EVA_D_EVALUACION AS d INNER JOIN " +
                                " EVA_D_VALORES AS v ON d.c_comportamiento = v.c_comportamiento INNER JOIN " +
                                " EVA_C_VALORES AS c ON v.c_comportamiento = c.c_valor  " +
                                " WHERE (d.id_eva = '" + ideva.Text + "') AND (v.c_banda = '" + ban + "') AND (d.id_plantilla = '" + idplantilla.Text + "')  ";
                SqlCommand cmd6 = new SqlCommand(query6, cnx6);

                SqlDataReader dr6 = cmd6.ExecuteReader();

                if (dr6.HasRows)
                {
                    while (dr6.Read())
                    {
                        cal_valores = dr6["total_calificacion_val_jefe"].ToString();
                    }
                }
            }
            // para sacar el usuario del empleado q se califico
            using (SqlConnection cnxe = new SqlConnection(connectionString))
            {
                cnxe.Open();

                string queryemp = " SELECT  usr_username, usr_passwd, usr_nombre, usr_apellido_pat, usr_apellido_mat, usr_direccion, usr_email, usr_id_JDE, usr_id_JDE_AB " +
                                " FROM SYS_USR_USERS " +
                                " WHERE (usr_id_JDE_AB  = '" + lbEmpleados.Text + "') ";
                SqlCommand cmde = new SqlCommand(queryemp, cnxe);
                SqlDataReader dremp = cmde.ExecuteReader();

                if (dremp.HasRows)
                {
                    while (dremp.Read())
                    {
                        correo_empleado = dremp["usr_email"].ToString();
                    }
                }
                else
                {
                    correo_empleado = "";
                    MensajeError("No tiene asignado E-mail en el Apps");
                }
            }   // cierre de la conn


            //mensaje3 = mensaje3 + "<p align='center'><strong>CALIFICACION SECCION VALORES: " + cal_valores + " </strong> </p><br><br>";
            mensaje3 = mensaje3 + "<br><br>";
            //mensaje3_ind = mensaje1_ind + mensaje_ind + "<tr><td colspan='5' align='center'><strong>CALIFICACION INDICADORES : </strong>" + cal_indicador + " </td></tr></table>  <br><br>";
            mensaje3_ind = mensaje1_ind + mensaje_ind + "</table>  <br><br>";

            mensaje_obs = " <br><table class=style1 font-family='calibri'> " +
                        " <tr><td colspan='3' align='left'><strong>  COMENTARIOS ADICIONALES (JEFE INMEDIATO) </strong></td></tr> " +
                         " <tr> " +
                            " <td style=background-color: #C0C0C0> " +
                                " <strong> PUNTOS FUERTES:  </strong>" + ptos_jefe + "</td></tr>" +
                            "  <tr><td style=background-color: #C0C0C0> " +
                                " <strong> NECESIDADES DE DESARROLLO:  </strong>" + necesidad_jefe + "</td>" +
                            "  <tr><td style=background-color: #C0C0C0> " +
                                " <strong> COMENTARIOS:  </strong>" + comentario_jefe + "</td>" +
                        " </tr> </table> <br>";

            mensaje3 = mensaje3 + mensaje3_ind + mensaje_obs;
            correo.Text = correo_empleado;
            correoDO enviarCorreo = new correoDO();
            enviarCorreo.EnviaMail_Eva("Retroalimentacion de Evaluacion de Desempeño ", mensaje3, correo_empleado);
            //guardo el log de envios a correo
            using (SqlConnection cnxc = new SqlConnection(connectionString))
            {
                cnxc.Open();
                string querycc = "INSERT EVA_ENVIO (id_emp, folio_eva, correo, fecha) values ( '" + lbEmpleados.Text + "'," +
                                  "'" + ideva.Text + "','" + correo.Text + "', GETDATE()) ";
                SqlCommand cmd = new SqlCommand(querycc, cnxc);
                SqlDataReader dr = cmd.ExecuteReader();
            }
            // aqui debe ir la direccion del empleado calificado lbEmpleados.Text 
            //pnlSuccess.Visible = true;
            ///===============================================================================================================================




        }
コード例 #22
0
ファイル: NegocioCapitalHumano.cs プロジェクト: tinovo/Sitio
        public List<Employee> ListaEmpleados2(string parNumeroEmpleado,
                                                    string parTipo,
                                                    string parPrimerNombre,
                                                    string parSegundoNombre,
                                                    string parApellidoPaterno,
                                                    string parApellidoMaterno,
                                                    string parGeneroClave,
                                                    string parZona,
                                                    string parCompañia,
                                                    string parPuestoClave,
                                                    string parDepartamentoClave,
                                                    DateTime parContratacionInicio,
                                                    DateTime parContratacionFin)
        {
            TablaEmpleados tablaEmpleados = new TablaEmpleados();

            List<Employee> listaEmpleados = tablaEmpleados.ObtenerEbs(parNumeroEmpleado,
                                        parTipo,
                                        parPrimerNombre,
                                        parSegundoNombre,
                                        parApellidoPaterno,
                                        parApellidoMaterno,
                                        parGeneroClave,
                                        parZona,
                                        parCompañia,
                                        parPuestoClave,
                                        parDepartamentoClave,
                                        parContratacionInicio,
                                        parContratacionFin);

            if (listaEmpleados != null)
            {
                this.log = "Se encontraron " + tablaEmpleados.Log + " empleados";
                return listaEmpleados;
            }
            else
            {
                if (tablaEmpleados.Log == "VACIO")
                {
                    this.log = "No se encontro el empleado con el siguiente filtro: " + "\n" +
                                "\t Numero: " + parNumeroEmpleado;
                }
                else
                {
                    this.log = tablaEmpleados.Log;
                }

                return null;
            }
        }