protected void btnActualizarTurno_Click(object sender, EventArgs e)
 {
     string RESUL = Session["codi"].ToString();
     string RESUL2 = Session["hola"].ToString();
     ConexionBaseDatos conn = new ConexionBaseDatos();
     string sqlQuery = "EXEC PROC_WEB_UPD_PLANTURNO '" + txtCodigo.Text + "','" + txtFecha.Text + "','" + RESUL+ "','" + RESUL2 + "'";
     SqlCommand comando = new SqlCommand(sqlQuery, conn.AbrirConexion());
 }
        public void CargaCCosto(object sender, EventArgs e)
        {
            int CodEmpresa = Convert.ToInt32(DropDownList1.SelectedItem.Value);

            try
            {
                string sqlquery = "Select UNIDAD_NEGOCIO,DESC_UNIDAD FROM P_UNIDAD_NEGOCIO Where COD_EMPRESA =" + CodEmpresa;
                ConexionBaseDatos conn = new ConexionBaseDatos();
                DataSet Tablavirtual = new DataSet();

                SqlDataAdapter ds = new SqlDataAdapter(sqlquery, conn.AbrirConexion());
                ds.Fill(Tablavirtual, "P_UNIDAD_NEGOCIO");

                DropDownList2.DataSource = Tablavirtual;
                DropDownList2.DataTextField = "DESC_UNIDAD";
                DropDownList2.DataValueField = "UNIDAD_NEGOCIO";
                DropDownList2.DataBind();
                conn.CerrarConexion();
            }
            catch (Exception ex)
            {
                Mensaje.Text = ex.ToString();
            }
        }
        /* SE DEVUELVE UN DATATABLE CON TODOS LOS TURNOS CORRESPONDIENTES A LA EMPRESA QUE SE LE PASO POR PARAMETRO */
        public DataTable TurnosEmpresa(string codEmpresa)
        {
            string sqlQuery = "EXEC SP_TURNOS '" + codEmpresa + "'";
            ConexionBaseDatos conn = new ConexionBaseDatos();
            DataTable tabla = new DataTable();
            SqlDataAdapter ds = new SqlDataAdapter(sqlQuery, conn.AbrirConexion());
            ds.Fill(tabla);

            conn.CerrarConexion();
            return tabla;
        }
        /* FUNCION LA CUAL PERMITE SACAR LOS TURNOS DE UN EMPLEADO ESPECIFIO Y LOS DEVUELVE EN UN HASHTABLE (CLAVE,VALOR) */
        public ArrayList TurnoEmpleadoPorFecha(string cod_empleado, string fecha_ini, string fecha_fin)
        {
            /* CONEXION A LA BASE DE DATOS Y EJECUCION DE SP */
                ConexionBaseDatos conn = new ConexionBaseDatos();
                string sqlQuery = "EXEC PROC_TURNO_EMPLEADO '" + cod_empleado + "','" + fecha_ini + "','" + fecha_fin + "'";

                /* SE PASA EL RESULTADO DE LA CONSULTA A UN DATATABLE, EL CUAL SE RECORRE PARA SACAR LOS DATOS DEL TURNO (FECHA,COD_TURNO)
                 * LOS CUALES LUEGO SON GUARDADOS EN UN HASHTABLE */
                DataTable TablaBD = new DataTable();
                SqlDataAdapter ds = new SqlDataAdapter(sqlQuery, conn.AbrirConexion());
                ds.Fill(TablaBD);
                ArrayList TurnoEmpleado = new ArrayList();

                foreach (DataRow rows in TablaBD.Rows)
                {
                    TurnoEmpleado.Add(rows["Fecha"].ToString());
                    TurnoEmpleado.Add(rows["COD_TURNO"].ToString());
                }

                conn.CerrarConexion();
                return TurnoEmpleado;
        }