--
This commit is contained in:
@@ -59,6 +59,7 @@ Partial Class Boletos
|
||||
|
||||
|
||||
#End Region
|
||||
#Region "Carga Página"
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
If Request.QueryString("CveViaje") Is Nothing And UsuarioActual.CveVendedor <> Nothing And UsuarioActual.CveVendedor <> -1 Then
|
||||
@@ -88,7 +89,10 @@ Partial Class Boletos
|
||||
DtPasajeros.Columns.Add("CveViajePasajero", GetType(Integer))
|
||||
DtPasajeros.Columns.Add("Numero", GetType(Integer))
|
||||
DtPasajeros.Columns.Add("Nombre", GetType(String))
|
||||
DtPasajeros.Columns.Add("INE", GetType(String))
|
||||
DtPasajeros.Columns.Add("Visa", GetType(String))
|
||||
DtPasajeros.Columns.Add("VisaVigencia", GetType(Date))
|
||||
DtPasajeros.Columns.Add("FechaNacimiento", GetType(Date))
|
||||
DtPasajeros.Columns.Add("Sexo", GetType(String))
|
||||
DtPasajeros.Columns.Add("CveSexo", GetType(Integer))
|
||||
DtPasajeros.Columns.Add("Celular", GetType(String))
|
||||
@@ -140,29 +144,15 @@ Partial Class Boletos
|
||||
If ObjDestinos.GetDestinosTarifas(CveSubProyecto, -1, -1) Then
|
||||
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||
DtDestinos = ObjDestinos.DtResultados
|
||||
DdlPartida.DataSource = DtDestinos.FiltraParametros("", DistinctColumns:={"CveDestinoOrigen", "Partida"})
|
||||
DdlPartida.DataBind()
|
||||
DdlPartida.DataSource = DtDestinos.FiltraParametros("", DistinctColumns:={"CveDestinoOrigen", "Partida"}) : DataBind()
|
||||
DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", "-1"))
|
||||
|
||||
'DdlDestino.DataSource = DtDestinos
|
||||
'DdlDestino.DataBind()
|
||||
'DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "-1"))
|
||||
End If
|
||||
End If
|
||||
|
||||
'If ObjDestinos.GetDestinos(CveSubProyecto:=CveSubProyecto) Then
|
||||
' If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||
' DdlPartida.DataSource = ObjDestinos.DtResultados
|
||||
' DdlPartida.DataBind()
|
||||
' DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", "-1"))
|
||||
|
||||
' DdlDestino.DataSource = ObjDestinos.DtResultados
|
||||
' DdlDestino.DataBind()
|
||||
' DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "-1"))
|
||||
' End If
|
||||
'End If
|
||||
ObjDestinos.Dispose()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub CotizarTarifa()
|
||||
If DdlDestino.SelectedValue <> "-1" And DdlPartida.SelectedValue <> "-1" Then
|
||||
Dim ImporteR As Decimal = 0
|
||||
@@ -170,7 +160,18 @@ Partial Class Boletos
|
||||
Dim CveSubProyecto As Integer = Contrato.Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||
|
||||
If ObjDestinos.GetDestinosTarifas(CveSubProyecto, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero) Then
|
||||
ImporteR = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL
|
||||
Dim fechaHoy As Date = Date.Today
|
||||
Dim fechaNacimiento As Date = TxtFechaNacimiento.Text.ToDate
|
||||
Dim edad As Integer
|
||||
|
||||
' Calcular la diferencia en años entre la fecha actual y la fecha de nacimiento
|
||||
edad = CInt(DateDiff(DateInterval.Year, fechaNacimiento, fechaHoy))
|
||||
If edad < 8 Or edad > 65 Then
|
||||
ImporteR = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL - 20
|
||||
Else
|
||||
ImporteR = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL
|
||||
|
||||
End If
|
||||
End If
|
||||
If ImporteR > 0 Then
|
||||
ViewState("Importe") = ImporteR
|
||||
@@ -216,22 +217,9 @@ Partial Class Boletos
|
||||
|
||||
Try
|
||||
For Each dr As DataRow In DtPasajeros.Rows
|
||||
Dim Nombre, Visa, Celular, Obs, Asiento As String
|
||||
Dim Sexo As Boolean
|
||||
Dim Importe As Decimal = 0
|
||||
Dim CveDestinoOrigen, CveDestinoFinal As Integer
|
||||
|
||||
CveDestinoOrigen = dr("CveDestinoOrigen").ToString.ToEntero
|
||||
CveDestinoFinal = dr("CveDestinoFinal").ToString.ToEntero
|
||||
Importe = dr("Importe").ToString.ToDecimal
|
||||
Asiento = dr("Asiento").ToString
|
||||
Nombre = dr("Nombre").ToString
|
||||
Visa = dr("Visa").ToString
|
||||
Celular = dr("Celular").ToString
|
||||
Sexo = dr("CveSexo").ToString.ToBool
|
||||
Obs = dr("Observaciones").ToString
|
||||
|
||||
Dim CveViajePasajero = ObjTransporte.AddViajesPasajeros(CveViaje, CveDestinoOrigen, CveDestinoFinal, Importe, Asiento.ToEntero, Nombre, Visa, Celular, Sexo, Obs, UsuarioActual.CveUsuario, UsuarioActual.CveVendedor)
|
||||
Dim CveViajePasajero As Integer = ObjTransporte.AddViajesPasajeros(CveViaje, dr("CveDestinoOrigen").ToString.ToEntero, dr("CveDestinoFinal").ToString.ToEntero, UsuarioActual.CveVendedor, dr("Importe").ToString.ToDecimal, dr("Asiento").ToString.ToEntero, dr("Nombre").ToString, dr("INE").ToString, dr("FechaNacimiento").ToString.ToDate, dr("CveSexo").ToString.ToBool, dr("Visa").ToString, dr("VisaVigencia").ToString.ToDate, dr("Celular").ToString, dr("Observaciones").ToString, UsuarioActual.CveUsuario)
|
||||
|
||||
If CveViajePasajero < 1 Then
|
||||
TieneError = True
|
||||
@@ -328,6 +316,12 @@ Partial Class Boletos
|
||||
DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "-1"))
|
||||
End Sub
|
||||
Protected Sub DdlDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDestino.SelectedIndexChanged
|
||||
If TxtFechaNacimiento.Text = "" Then
|
||||
DdlDestino.SelectedValue = "-1"
|
||||
DdlPartida.SelectedValue = "-1"
|
||||
Alert("Debe seleccionar la fecha de nacimiento", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
CotizarTarifa()
|
||||
End Sub
|
||||
Private Sub GeneraPasajeros(Cantidad As Integer)
|
||||
@@ -353,24 +347,30 @@ Partial Class Boletos
|
||||
Exit Sub
|
||||
End If
|
||||
Dim Dr1 As DataRow = DtPasajeros.NewRow
|
||||
Dr1("Asiento") = AsientoSeleccionado.Replace("A", "")
|
||||
Dr1("Nombre") = TxtNombre.Text.Trim
|
||||
Dr1("Visa") = TxtVisa.Text.Trim
|
||||
Dr1("Sexo") = RblSexo.SelectedItem
|
||||
Dr1("CveSexo") = RblSexo.SelectedValue.ToBool
|
||||
Dr1("Celular") = TxtCelular.Text.Trim
|
||||
Dr1("Observaciones") = TxtObservaciones.Text.Trim
|
||||
Dr1("Partida") = DdlPartida.SelectedItem
|
||||
Dr1("Destino") = DdlDestino.SelectedItem
|
||||
Dr1("CveDestinoOrigen") = DdlPartida.SelectedValue.ToEntero
|
||||
Dr1("CveDestinoFinal") = DdlDestino.SelectedValue.ToEntero
|
||||
Dr1("Importe") = Me.Importe
|
||||
Dr1("Asiento") = AsientoSeleccionado.Replace("A", "")
|
||||
Dr1("Nombre") = TxtNombre.Text.Trim
|
||||
Dr1("INE") = TxtINE.Text.Trim
|
||||
Dr1("FechaNacimiento") = TxtFechaNacimiento.Text.Trim
|
||||
Dr1("Sexo") = RblSexo.SelectedItem
|
||||
Dr1("CveSexo") = RblSexo.SelectedValue.ToBool
|
||||
Dr1("Visa") = TxtVisa.Text.Trim
|
||||
Dr1("VisaVigencia") = TxtVisaVigencia.Text.Trim
|
||||
Dr1("Celular") = TxtCelular.Text.Trim
|
||||
Dr1("Observaciones") = TxtObservaciones.Text.Trim
|
||||
|
||||
'Reiniciamos Datos'
|
||||
DtPasajeros.Rows.Add(Dr1)
|
||||
AsientoSeleccionado = ""
|
||||
TxtNombre.Text = ""
|
||||
TxtINE.Text = ""
|
||||
TxtFechaNacimiento.Text = ""
|
||||
TxtVisa.Text = ""
|
||||
TxtCelular.Text = ""
|
||||
TxtVisaVigencia.Text = ""
|
||||
TxtCelular.Text = ""
|
||||
TxtObservaciones.Text = ""
|
||||
GvB.DataSource = DtPasajeros
|
||||
@@ -408,7 +408,7 @@ Partial Class Boletos
|
||||
Return Retorno
|
||||
End If
|
||||
|
||||
Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, -1, CveCliente, CveMoneda, "Rem")
|
||||
Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, -1, CveCliente, CveMoneda, "Rem")
|
||||
|
||||
If ObjFactura IsNot Nothing Then
|
||||
'TOMA EL SUBPROYECTO DEL CLIENTE
|
||||
@@ -426,8 +426,8 @@ Partial Class Boletos
|
||||
ObjFactura.SetSubProyectoMatriz()
|
||||
|
||||
For Each Dr As DataRow In DtPasajeros.Rows
|
||||
Dim Obs = Dr("Observaciones").ToString
|
||||
Dim Importe = Dr("Importe").ToString.ToDecimal()
|
||||
Dim Obs As String = Dr("Observaciones").ToString
|
||||
Dim Importe As Decimal = Dr("Importe").ToString.ToDecimal()
|
||||
|
||||
If Importe <= 0 Then
|
||||
Retorno.Mensajes.Add("El importe debe ser mayor a 0")
|
||||
@@ -477,8 +477,5 @@ Partial Class Boletos
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
'Protected Sub TimerActualizar_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles timerActualizar.Tick
|
||||
' ScriptManager.RegisterStartupScript(Me, Me.GetType(), "ActualizarTiempo", "actualizarTiempo();", True)
|
||||
' UpTimer.Update()
|
||||
'End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user