Files
SIG/Transportes/RepContratoDetalle.aspx.vb

76 lines
2.6 KiB
VB.net

Option Explicit On
Option Strict On
Imports System.Data
Imports ADSNetLibrary.Helpers
Imports ADSNetLibrary.SIGAPI.Helpers
Imports Extensiones
Partial Class RepContratoDetalle
Inherits ClsPaginas
Private Property CveContrato As Integer
Get
Return CType(ViewState("CveContrato"), Integer)
End Get
Set(value As Integer)
ViewState("CveContrato") = value
End Set
End Property
Private Property Contrato As DataTable
Get
Return CType(ViewState("Contrato"), DataTable)
End Get
Set(value As DataTable)
ViewState("Contrato") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Request("CveContrato") Is Nothing Then
Response.Redirect($"~/Transportes/RepContratos.aspx")
End If
CveContrato = Request("CveContrato").ToEntero
If Not IsPostBack Then
InicializaCombos()
CargaDatos()
End If
End Sub
Private Sub InicializaCombos()
'Lista Tipo AF
DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
DdlTipoAF.DataBind()
DdlTipoAF.Items.Insert(0, New ListItem("-", ""))
End Sub
Private Sub CargaDatos()
Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
Contrato = ObjContratos.DtResultados
Else
Response.Redirect($"~/Transportes/RepContratos.aspx")
End If
If Contrato.Rows(0)("CveContratoTipo").ToString() = "35" Then
TabBoletos.Visible = True
End If
LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString
DdlClientes.SelectedValue = Contrato.Rows(0)("CveCliente").ToString
TxtDescripcion.Text = Contrato.Rows(0)("DescripcionContrato").ToString
TxtObservaciones.Text = Contrato.Rows(0)("Observaciones").ToString
TxtUbicacion.Text = Contrato.Rows(0)("Ubicacion").ToString
TxtFechaSalida.Text = Contrato.Rows(0)("FechaInicial").ToString
TxtFechaRegreso.Text = Contrato.Rows(0)("FechaFinal").ToString
TxtCantidadPasajeros.Text = Contrato.Rows(0)("CantidadPasajeros").ToString
DdlTipoAF.SelectedValue = Contrato.Rows(0)("CveTipoAF").ToString
TxtDolares.Text = Contrato.Rows(0)("Importe").ToString
TxtPesos.Text = Contrato.Rows(0)("ImporteMax").ToString
TxtAnticipo.Text = Contrato.Rows(0)("ImporteMin").ToString
End Sub
End Class