<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQLClient" %>
<%@ Import Namespace="CrystalDecisions.Web" %>
<%@ Import Namespace="CrystalDecisions.CrystalReports.Engine" %>
<%@ Import Namespace="CrystalDecisions.Shared" %>
<script language="vbscript" runat="server">
Protected Sub BtnVer_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim rep As ReportDocument = New ReportDocument
rep.Load(Server.MapPath("ReporteContratation.rpt"))
Dim rpe As ParameterDiscreteValue = New ParameterDiscreteValue
rpe.Value = Text_rpe.Text
Dim nombre As ParameterDiscreteValue = New ParameterDiscreteValue
nombre.Value = Text_nombre.Text
Dim fechaant As ParameterDiscreteValue = New ParameterDiscreteValue
fechaant.Value = Text_Feant.Text
Dim escolaridad As ParameterDiscreteValue = New ParameterDiscreteValue
escolaridad.Value = Text_Escolar.Text
rep.ParameterFields(0).CurrentValues.Add(rpe)
rep.ParameterFields(1).CurrentValues.Add(nombre)
rep.ParameterFields(2).CurrentValues.Add(fechaant)
rep.ParameterFields(3).CurrentValues.Add(escolaridad)
Me.CRVReemplazos.ReportSource = rep
Me.CRVReemplazos.DataBind()
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim reader As SqlDataReader
Dim values As ArrayList = New ArrayList()
Dim conn As SqlConnection = New SqlConnection("server=myhost;database=mydb;User ID=myuser;Password=mypass;Trusted_Connection=no")
Dim Answer = Text_rpe.Text.ToString()
Dim sql2 As String = "SELECT TOP 1 [extractor].[dbo].[b_traba1].rpe, [extractor].[dbo].[b_traba1].nombre, [extractor].[dbo].[b_traba1].fe_antre, [extractor].[dbo].[b_traba2].cl_escol, [extractor].[dbo].[l_escol].nivescol, [extractor].[dbo].[c_puesto].puesto, [extractor].[dbo].[b_traba1].cl_nides, [extractor].[dbo].[c_cencos].ds_cenco, [extractor].[dbo].[b_plazas].numplaza, [extractor].[dbo].[c_ubica].ubicapza, [extractor].[dbo].[b_contra].fe_inico, [extractor].[dbo].[b_contra].fe_terco, [extractor].[dbo].[b_contra].im_saltr, [extractor].[dbo].[c_cencos].cl_cenco, GETDATE() AS num, CASE WHEN grupo='A' THEN 10 WHEN grupo='B' THEN 11 WHEN grupo='C' THEN 12 WHEN grupo='D' THEN 13..."
Dim dr As New SqlCommand(sql2, conn)
conn.Open()
reader = dr.ExecuteReader()
If reader.Read() Then
Dim fecha = DateTime.Now
lblFecha.Text = fecha.ToShortDateString() + " " + fecha.ToShortTimeString()
Text_nombre.Text = CStr(reader("nombre")).ToString
Text_nombre.Attributes.Add("readonly", "readonly")
Text_nombre.BackColor = Drawing.Color.Silver
Text_Feant.Text = CStr(reader("fe_antre")).ToString
Text_Feant.Attributes.Add("readonly", "readonly")
Text_Feant.BackColor = Drawing.Color.Silver
Text_Escolar.Text = CStr(reader("nivescol")).ToString
Text_Escolar.Attributes.Add("readonly", "readonly")
Text_Escolar.BackColor = Drawing.Color.Silver
Text_Ingre2.Text = ("X").ToString
Text_Ingre2.Attributes.Add("readonly", "readonly")
Text_Ingre2.BackColor = Drawing.Color.Silver
Text_Puesto1.Text = CStr(reader("puesto")).ToString
Text_Puesto1.Attributes.Add("readonly", "readonly")
Text_Puesto1.BackColor = Drawing.Color.Silver
Text_GO1.Text = CStr(reader("orga")).ToString
Text_GO1.Attributes.Add("readonly", "readonly")
Text_GO1.BackColor = Drawing.Color.Silver
Text_Ceco1.Text = CStr(reader("ds_cenco")).ToString
Text_Ceco1.Attributes.Add("readonly", "readonly")
Text_Ceco1.BackColor = Drawing.Color.Silver
Text_ND1.Text = CStr(reader("cl_nides")).ToString
Text_ND1.Attributes.Add("readonly", "readonly")
Text_ND1.BackColor = Drawing.Color.Silver
Text_Plaza1.Text = CStr(reader("numplaza")).ToString
Text_Plaza1.Attributes.Add("readonly", "readonly")
Text_Plaza1.BackColor = Drawing.Color.Silver
Text_Ubica1.Text = CStr(reader("ubicapza")).ToString
Text_Ubica1.Attributes.Add("readonly", "readonly")
Text_Ubica1.BackColor = Drawing.Color.Silver
Text_Inic1.Text = CStr(reader("fe_inico")).ToString
Text_Inic1.Attributes.Add("readonly", "readonly")
Text_Inic1.BackColor = Drawing.Color.Silver
If IsDBNull((reader("fe_terco"))) Then
Text_Terc1.Text = "nulo"
Text_Terc1.BackColor = Drawing.Color.Silver
Text_Sal1.Attributes.Add("readonly", "readonly")
Else
Text_Terc1.Text = CStr(reader("fe_terco"))
Text_Terc1.BackColor = Drawing.Color.Silver
Text_Sal1.Attributes.Add("readonly", "readonly")
End If
Text_Sal1.Text = CStr(reader("im_saltr")).ToString
Text_Sal1.Attributes.Add("readonly", "readonly")
Text_Sal1.BackColor = Drawing.Color.Silver
Text_Clave1.Text = CStr(reader("cl_cenco")).ToString
Text_Clave1.Attributes.Add("readonly", "readonly")
Text_Clave1.BackColor = Drawing.Color.Silver
Text_Puesto2.Text = CStr(reader("puesto")).ToString
Text_Puesto2.Attributes.Add("readonly", "readonly")
Text_GO2.Text = CStr(reader("orga")).ToString
Text_GO2.Attributes.Add("readonly", "readonly")
Text_Ceco2.Text = CStr(reader("ds_cenco")).ToString
Text_Ceco2.Attributes.Add("readonly", "readonly")
Text_ND2.Text = CStr(reader("cl_nides")).ToString
Text_ND2.Attributes.Add("readonly", "readonly")
Text_Plaza2.Text = CStr(reader("numplaza")).ToString
Text_Plaza2.Attributes.Add("readonly", "readonly")
Text_Ubica2.Text = CStr(reader("ubicapza")).ToString
Text_Ubica2.Attributes.Add("readonly", "readonly")
Text_Sal2.Text = CStr(reader("im_saltr")).ToString
Text_Sal2.Attributes.Add("readonly", "readonly")
Text_Clave2.Text = CStr(reader("cl_cenco")).ToString
Text_Clave2.Attributes.Add("readonly", "readonly")
Text_Ingre1.BackColor = Drawing.Color.Silver
Text_rpe.BackColor = Drawing.Color.Silver
Text_rpe.Attributes.Add("readonly", "readonly")
Else
Text_Ingre1.Text = ("X")
Text_Ingre1.BackColor = Drawing.Color.Silver
Text_Ingre1.Attributes.Add("readonly", "readonly")
Text_Ingre2.BackColor = Drawing.Color.Silver
Text_Ingre2.Attributes.Add("readonly", "readonly")
End If
reader.Close()
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Response.Redirect("Default.aspx")
End Sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<td style="font-size: 7pt; width: 954px; font-family: Arial">
Nueva Creación</td>
<td style="width: 178px; font-size: 7pt; font-family: Arial;">
<asp:TextBox ID="TextBox22" runat="server" Width="38px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 584px; font-size: 7pt; font-family: Arial;">
R.P.E.:<asp:TextBox ID="Text_rpe" runat="server" Width="173px" MaxLength="5"></asp:TextBox></td>
<td style="width: 455px; font-size: 7pt; font-family: Arial;">
Clave: Adscripción: <br />
<asp:TextBox ID="Text_Clave1" runat="server" Width="72px"></asp:TextBox>
<asp:TextBox ID="Text_Ubica1" runat="server" Width="223px"></asp:TextBox></td>
<td style="font-size: 7pt; width: 589px; font-family: Arial">
Clave: Adscripción: <br />
</span>
<br />
</div>
</form>
</body>
</html>