diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index 2021d462e..562bcad8c 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -661,6 +661,7 @@ Partial Class AF_AF End Sub Private Sub CargaTipoActivoFijo() + DdlTipoActivoFijo.Items.Clear() DdlTipoActivoFijo.DataSource = GlobalDTTipoActivoFijo(CveEmpresaActual).FiltraParametros("", "TipoActivoFijo") DdlTipoActivoFijo.DataBind() CargaSubTipoActivoFijo() diff --git a/AF/CatClasificacionesCaracteristicas.aspx b/AF/CatClasificacionesCaracteristicas.aspx index 90528e45c..29c63c4cb 100644 --- a/AF/CatClasificacionesCaracteristicas.aspx +++ b/AF/CatClasificacionesCaracteristicas.aspx @@ -90,7 +90,7 @@ - + <%--   @@ -300,7 +300,7 @@ - +   @@ -537,7 +537,7 @@ - +   diff --git a/AF/CatClasificacionesCaracteristicas.aspx.vb b/AF/CatClasificacionesCaracteristicas.aspx.vb index d67d76f89..8f6b1e18f 100644 --- a/AF/CatClasificacionesCaracteristicas.aspx.vb +++ b/AF/CatClasificacionesCaracteristicas.aspx.vb @@ -52,7 +52,6 @@ Partial Class AF_CatClasificacionesCaracteristicas 'Carga Globals para DT CargaTiposActivosFijos() - CargaSubTiposActivosFijos() ''CargaCaracteristicasClasificaciones() 'CargaCaracteristicas() End If @@ -66,17 +65,7 @@ Partial Class AF_CatClasificacionesCaracteristicas DdlTiposActivosFijosOpciones.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa) DdlTiposActivosFijosOpciones.DataBind() End Sub - Private Sub CargaSubTiposActivosFijos() - Dim ObjAF As New ClsAF - If ObjAF.GetSubTiposActivosFijos(UsuarioActual.CveEmpresa) Then - GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa) = ObjAF.DtResultados - Else - Alert("Ocurrio un error al obtener los SubTipos de Activos Fijos", TipoMensaje.MsgError) - End If - - ObjAF.Dispose() - End Sub #Region "CLASIFICACIONES" Protected Sub LbAgregarCL_Click(sender As Object, e As System.EventArgs) Handles LbAgregarCL.Click Dim ObjCaracteristicaClasificacion As New ClsAF @@ -85,8 +74,7 @@ Partial Class AF_CatClasificacionesCaracteristicas TxtCaracteristicaClasificacionCL.Text = "" Alert("La Nueva Clasificación de Activo Fijo se guardó correctamente.", TipoMensaje.MsgInformacion) UpTitulosCL.Update() - - CargaSubTiposActivosFijos() + GlobalDTAFCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) = Nothing If ViewState("OrdenCL").ToString() <> String.Empty Then CargaGrid(ViewState("OrdenCL").ToString(), 0) @@ -147,10 +135,7 @@ Partial Class AF_CatClasificacionesCaracteristicas Dim ObjCaracteristicaClasificacion As New ClsAF If ObjCaracteristicaClasificacion.RemoveClasificacionesCaracteristicas(GvDatosCL.DataKeys(e.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveEmpresa) Then GvDatosCL.EditIndex = -1 - - CargaSubTiposActivosFijos() - 'CargaCaracteristicasClasificaciones() - + GlobalDTAFCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion) End If @@ -183,9 +168,7 @@ Partial Class AF_CatClasificacionesCaracteristicas If ObjCaracteristicaClasificacion.UpdateClasificacionesCaracteristicas(CaracteristicaClasificacion, Estatus, CveCaracteristicaClasificacion, UsuarioActual.CveEmpresa) Then GvDatosCL.EditIndex = -1 - CargaSubTiposActivosFijos() - 'CargaCaracteristicasClasificaciones() - + GlobalDTAFCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If @@ -228,12 +211,10 @@ Partial Class AF_CatClasificacionesCaracteristicas TxtLongitudCA.Text = "" Alert("La Nueva Característica de Activo Fijo se guardó correctamente.", TipoMensaje.MsgInformacion) UpTitulosCA.Update() - ViewState("DTCatacteristica") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - CargaSubTiposActivosFijos() - ''CargaCaracteristicasClasificaciones() - 'CargaCaracteristicas() + GlobalDTAFCaracteristicas(UsuarioActual.CveEmpresa) = Nothing + If ViewState("OrdenCA").ToString() <> String.Empty Then CargaGrid(ViewState("OrdenCA").ToString(), 1) @@ -262,7 +243,7 @@ Partial Class AF_CatClasificacionesCaracteristicas End Sub Protected Sub DdlTiposActivosFijosCA_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTiposActivosFijosCA.SelectedIndexChanged DdlSubTiposActivosFijosCA.Items.Clear() - DdlSubTiposActivosFijosCA.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoActivoFijo = {0} AND CveEmpresa = {1}", DdlTiposActivosFijosCA.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)) + DdlSubTiposActivosFijosCA.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa, DdlTiposActivosFijosCA.SelectedValue.ToEntero) DdlSubTiposActivosFijosCA.DataBind() DdlSubTiposActivosFijosCA.Items.Insert(0, New ListItem("Todos", "-1")) End Sub @@ -368,8 +349,6 @@ Partial Class AF_CatClasificacionesCaracteristicas GvDatosCA.EditIndex = -1 GlobalDTAFCaracteristicas(UsuarioActual.CveEmpresa) = Nothing - CargaSubTiposActivosFijos() - Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If @@ -596,8 +575,6 @@ Partial Class AF_CatClasificacionesCaracteristicas GvDatosOpciones.EditIndex = -1 ViewState("DTCatacteristicaOpciones") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - CargaSubTiposActivosFijos() - Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If diff --git a/AF/CatSubTipos.aspx b/AF/CatSubTipos.aspx index 1c97e6a3e..568d42442 100644 --- a/AF/CatSubTipos.aspx +++ b/AF/CatSubTipos.aspx @@ -74,7 +74,7 @@ - + diff --git a/AF/CatTiposServicios.aspx.cs b/AF/CatTiposServicios.aspx.cs index c553b8dd1..9c3ae2767 100644 --- a/AF/CatTiposServicios.aspx.cs +++ b/AF/CatTiposServicios.aspx.cs @@ -72,7 +72,7 @@ public partial class AF_CatTiposServicios : ClsPaginas GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); CveTipoServicio = GvRow.DataKey("CveTipoServicio").ToEntero(); ClsAF ObjAF = new ClsAF(); - if (ObjAF.DeleteTiposServicios(CveTipoServicio)) + if (ObjAF.DeleteTiposServicios(CveTipoServicio, UsuarioActual.CveEmpresa)) { CargaDatos(); UpDatos.Update(); @@ -87,7 +87,7 @@ public partial class AF_CatTiposServicios : ClsPaginas ClsAF ObjAF = new ClsAF(); if (BtnAgregarTipoServicio.Text == "Agregar") { - if (ObjAF.AddTiposServicios(TxtNombre.Text,DdlTipoMantenimiento.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + if (ObjAF.AddTiposServicios(TxtNombre.Text,DdlTipoMantenimiento.SelectedValue.ToEntero(), 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { CargaDatos(); UpDatos.Update(); @@ -97,7 +97,7 @@ public partial class AF_CatTiposServicios : ClsPaginas } else { - if (ObjAF.UpdateTiposServicios(CveTipoServicio, TxtNombre.Text, DdlTipoMantenimiento.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + if (ObjAF.UpdateTiposServicios(CveTipoServicio, TxtNombre.Text, DdlTipoMantenimiento.SelectedValue.ToEntero(), 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { CargaDatos(); UpDatos.Update(); diff --git a/AF/TipoOrdenTrabajo.aspx.vb b/AF/TipoOrdenTrabajo.aspx.vb index aa2110249..a8396d98a 100644 --- a/AF/TipoOrdenTrabajo.aspx.vb +++ b/AF/TipoOrdenTrabajo.aspx.vb @@ -603,7 +603,7 @@ Partial Class AF_TipoOrdenTrabajo If CveTipoServicio = -1 Then - If ObjAF.AddTiposServicios(TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjAF.AddTiposServicios(TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then CveTipoServicio = ObjAF.CveTipoServicio @@ -651,7 +651,7 @@ Partial Class AF_TipoOrdenTrabajo Else - If Not ObjAF.UpdateTiposServicios(CveTipoServicio, TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If Not ObjAF.UpdateTiposServicios(CveTipoServicio, TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then ErrorProceso = True End If diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 84fcb8ab7..87d41e011 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -190,7 +190,6 @@ Public Class ClsContratos Public Property CveChofer2 As Integer Public Property CveAF As Integer Public Property CantidadPasajeros As Integer - Public Property CveRuta As Integer Public Property CvePartida As Integer Public Property CveDestino As Integer Public Property CveMasivo As Integer @@ -316,8 +315,7 @@ Public Class ClsContratos Me.CveChofer = Data.Rows(0)("CveChofer").ToString.ToEntero Me.CveChofer2 = Data.Rows(0)("CveChofer2").ToString.ToEntero Me.CveAF = Data.Rows(0)("CveAF").ToString.ToEntero - Me.CantidadPasajeros = Data.Rows(0)("CantidadPasajeros").ToString.ToEntero - Me.CveRuta = Data.Rows(0)("CveRuta").ToString.ToEntero + Me.CantidadPasajeros = Data.Rows(0)("CantidadPasajeros").ToString.ToEntero Me.CvePartida = Data.Rows(0)("CvePartida").ToString.ToEntero Me.CveDestino = Data.Rows(0)("CveDestino").ToString.ToEntero Me.CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index d6d68b8cd..bf94a8a1c 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10836,6 +10836,7 @@ Public Class ClsPaginas PaginaDict.Add("/Transportes/RepBoletos.aspx".ToUpper(), 601) PaginaDict.Add("/Transportes/RepContratosCalendario.aspx".ToUpper(), 603) PaginaDict.Add("/Transportes/CatRutas.aspx".ToUpper(), 604) + PaginaDict.Add("/Transportes/RepViajesCalendario.aspx".ToUpper(), 605) #End Region 'Antes de aquí. diff --git a/App_Code/ClsTransportes.vb b/App_Code/ClsTransportes.vb index f286123d7..bbe20d017 100644 --- a/App_Code/ClsTransportes.vb +++ b/App_Code/ClsTransportes.vb @@ -227,7 +227,7 @@ Public Class ClsTransportes #End Region #Region "Destinos" - Public Function GetDestinos(Optional CveRuta As Integer = 0) As Boolean + Public Function GetDestinos(Optional CveSubProyecto As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Trans_DestinosGet") If CveRuta <> 0 Then @@ -309,93 +309,95 @@ Public Class ClsTransportes End Function #End Region -#Region "Rutas" - Public Function GetRutas(CveRuta As Integer, CveUsuario As Integer, CveEmpresa As Integer, Ruta As String, Estatus As Boolean, FechaIng As DateTime) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Trans_RutasGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveRuta", SqlDbType.Int).Value = CveRuta - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@Ruta", SqlDbType.VarChar).Value = Ruta - .Add("@Estatus", SqlDbType.Bit).Value = Estatus - .Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng + '#Region "Rutas" + ' Public Function GetRutas(CveRuta As Integer, CveUsuario As Integer, CveEmpresa As Integer, Ruta As String, Estatus As Boolean, FechaIng As DateTime) As Boolean + ' Dim Retorno As Boolean = False + ' DataAdapter("PA_Trans_RutasGet") + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveRuta", SqlDbType.Int).Value = CveRuta + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + ' .Add("@Ruta", SqlDbType.VarChar).Value = Ruta + ' .Add("@Estatus", SqlDbType.Bit).Value = Estatus + ' .Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng - End With - Try - SqlAdapter.Fill(Data) - Retorno = True + ' End With + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener las rutas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener las rutas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function - Public Function AddRuta(Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer - Dim Retorno As Integer = -1 + ' Return Retorno + ' End Function + ' Public Function AddRuta(Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer + ' Dim Retorno As Integer = -1 - DataAdapter("PA_Trans_RutasAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveRuta", SqlDbType.Int).Direction = ParameterDirection.Output - .Add("@Ruta", SqlDbType.VarChar).Value = Ruta - .Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus) - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveRuta").Value.ToString) - Catch ex As Exception - OnError("Ocurrió un error al agregar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' DataAdapter("PA_Trans_RutasAdd") + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveRuta", SqlDbType.Int).Direction = ParameterDirection.Output + ' .Add("@Ruta", SqlDbType.VarChar).Value = Ruta + ' .Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus) + ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' End With + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveRuta").Value.ToString) + ' Catch ex As Exception + ' OnError("Ocurrió un error al agregar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function - Public Function UpdateRuta(CveRuta As Integer, Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Trans_RutasUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveRuta", SqlDbType.Int).Value = CveRuta - .Add("@Ruta", SqlDbType.VarChar).Value = Ruta - .Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus) - .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Return Retorno + ' End Function + ' Public Function UpdateRuta(CveRuta As Integer, Ruta As String, Estatus As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + ' Dim Retorno As Boolean = False + ' DataAdapter("PA_Trans_RutasUpdate") + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveRuta", SqlDbType.Int).Value = CveRuta + ' .Add("@Ruta", SqlDbType.VarChar).Value = Ruta + ' .Add("@Estatus", SqlDbType.Bit).Value = Convert.ToBoolean(Estatus) + ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' End With + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al actualizar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function - Public Function RemoveRuta(CveRuta As Integer) As Boolean - Dim Retorno As Boolean = False + ' Return Retorno + ' End Function + ' Public Function RemoveRuta(CveRuta As Integer) As Boolean + ' Dim Retorno As Boolean = False - DataAdapter("PA_Trans_RutasRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveRuta", SqlDbType.Int).Value = CveRuta - End With + ' DataAdapter("PA_Trans_RutasRemove") + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveRuta", SqlDbType.Int).Value = CveRuta + ' End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al eliminar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function -#End Region + ' Return Retorno + ' End Function + + '#End Region #Region "Importes" - Public Function GetDestinosTarifas(CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean + Public Function GetDestinosTarifas(CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Trans_DestinosTarifasGet") With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen .Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal End With @@ -409,16 +411,16 @@ Public Class ClsTransportes Return Retorno End Function - Public Function AddDestinosTarifas(CveRuta As String, CveDestinoOrigen As String, CveDestinoFinal As String, Importe As String) As Integer + Public Function AddDestinosTarifas(CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Trans_DestinosTarifasAdd") With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen + .Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal + .Add("@Importe", SqlDbType.SmallMoney).Value = Importe .Add("@CveDestinoTarifa", SqlDbType.Int).Direction = ParameterDirection.Output - .Add("@CveRuta", SqlDbType.Int).Value = CveRuta.ToEntero - .Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen.ToEntero - .Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal.ToEntero - .Add("@Importe", SqlDbType.SmallMoney).Value = Importe.ToDecimal End With Try SqlAdapter.Fill(Data) @@ -429,15 +431,15 @@ Public Class ClsTransportes Return Retorno End Function - Public Function UpdateDestinosTarifas(CveDestinoTarifa As Integer, CveRuta As String, CveDestinoOrigen As String, CveDestinoFinal As String, Importe As String) As Boolean + Public Function UpdateDestinosTarifas(CveDestinoTarifa As Integer, CveSubProyecto As Integer, CveDestinoOrigen As Integer, CveDestinoFinal As Integer, Importe As Decimal) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Trans_DestinosTarifasUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveDestinoTarifa", SqlDbType.Int).Value = CveDestinoTarifa - .Add("@CveRuta", SqlDbType.Int).Value = CveRuta.ToEntero - .Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen.ToEntero - .Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal.ToEntero - .Add("@Importe", SqlDbType.SmallMoney).Value = Importe.ToDecimal + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveDestinoOrigen", SqlDbType.Int).Value = CveDestinoOrigen + .Add("@CveDestinoFinal", SqlDbType.Int).Value = CveDestinoFinal + .Add("@Importe", SqlDbType.SmallMoney).Value = Importe End With Try SqlAdapter.Fill(Data) diff --git a/Contratos/RepContratosAvances.aspx b/Contratos/RepContratosAvances.aspx new file mode 100644 index 000000000..cbc3d6769 --- /dev/null +++ b/Contratos/RepContratosAvances.aspx @@ -0,0 +1,124 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepContratosAvances.aspx.vb" Inherits="RepContratosAvances" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Reporte de Contratos + + + + + + + +
+
+
+
    +
  • Cliente: + +
  • +
  • Contratos: + +
  • +
  • Sección: + +
  • +
  • Partida: + +
  • +
  • Productos y Servicios: + +
  • +
+
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + + +
# + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx index ab17fcfb1..323447b51 100644 --- a/Inventarios/EntregaAlmacen.aspx +++ b/Inventarios/EntregaAlmacen.aspx @@ -229,7 +229,7 @@ Observaciones: - + diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index d7e800585..e16742721 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -672,6 +672,7 @@ Partial Class Inventarios_EntregaAlmacen If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 AndAlso TipoDocto.Contiene("Ped", "Ing") Then TxtObservaciones.Text = $"Dr. {drE("Medico").ToString}{vbCrLf}Cx. {drE("Procedimiento").ToString}{vbCrLf}F. Cirugía {drE("FechaEjecucion").ToString.ToDateTime.ToString("dd/MM/yyyy HH:mm")}{vbCrLf}H. {drE("Sucursal").ToString}{vbCrLf}" + TxtObservaciones.Rows = 4 End If LbCliente.Text = DtDatos.Rows(0)("Nombre").ToString() diff --git a/Transportes/Boletos.aspx b/Transportes/Boletos.aspx index cf1b168df..b4afa5eac 100644 --- a/Transportes/Boletos.aspx +++ b/Transportes/Boletos.aspx @@ -7,84 +7,167 @@ - + - <%-- Datos de cliente y su viaje --%> -
+
+ <%-- Boleto --%> +
+ <%-- Datos del Cliente --%> +
+
+
+
+
+
+ + Datos del Pasajero + +
+ +
+ + + + + +
+
+
+
+
+
+
+ + + +
+ +
+ +
+
+ + +
+
+
+ +
+
+
+ + + + + + +
+
+ +
+
+ + + +
+
+
+ +
+ + + +
+
+
+
+
+ <%-- Datos del Viaje y Destinos --%>
@@ -107,9 +190,10 @@
- + DataValueField="CveDestinoOrigen" Class="form-control input-sm select2me" Width="200px" + runat="server" OnSelectedIndexChanged="DdlPartida_SelectedIndexChanged" >
- -
-
-
+
-
-
-
-
-
- - Datos del Pasajero - - -
-
-
-
-
-
-
-
- - - - -
- -
-
-
- - -
-
- -
-
-
-
- - - - - - -
-
-
-
- - - -
-
-
- -
- - - -
-
- - -
-
-
-
+ <%-- Botón para Agregar Pasajero(Oculto) --%> +
+
+ <%-- Listado de Boletos --%>
- + + + + - + + +
-
-
-
- -
-
+ <%--OnClick="FinalizarVenta"--%> +
+
<%-- Asientos --%> -
+
@@ -500,11 +519,26 @@
+
+ + diff --git a/Transportes/Boletos.aspx.vb b/Transportes/Boletos.aspx.vb index 24d302887..585cea58b 100644 --- a/Transportes/Boletos.aspx.vb +++ b/Transportes/Boletos.aspx.vb @@ -1,221 +1,242 @@ -Option Explicit On -Option Strict On -Imports System.Data -Imports Extensiones -Imports Extensiones.ModExtensiones -Imports Microsoft.Ajax.Utilities - -Partial Class Boletos +Option Explicit On +Option Strict On +Imports System.Data +Imports ADSNetLibrary.Helpers +Imports Extensiones +Imports Extensiones.ModExtensiones +Partial Class Boletos Inherits ClsPaginas -#Region "Propiedades" - Private Property AsientoSeleccionado As String - Get - Return ViewState("AsientoSeleccionado").ToString() - End Get - Set(value As String) - ViewState("AsientoSeleccionado") = value - End Set - End Property - Private Property Importe As Decimal - Get - Return If(IsNothing(ViewState("Importe")), 0, ViewState("Importe")).ToString().ToDecimal() - End Get - Set(value As Decimal) - ViewState("Importe") = value - End Set - End Property - Private Property CveViaje As Integer - Get - Return ViewState("CveViaje").ToString().ToEntero - End Get - Set(value As Integer) - ViewState("CveViaje") = 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 - Private Property DtPasajeros As DataTable - Get - Return CType(ViewState("DtPasajeros"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtPasajeros") = value - End Set +#Region "Propiedades" + Private Property AsientoSeleccionado As String + Get + Return ViewState("AsientoSeleccionado").ToString() + End Get + Set(value As String) + ViewState("AsientoSeleccionado") = value + End Set + End Property + Private Property Importe As Decimal + Get + Return If(IsNothing(ViewState("Importe")), 0, ViewState("Importe")).ToString().ToDecimal() + End Get + Set(value As Decimal) + ViewState("Importe") = value + End Set + End Property + Private Property CveViaje As Integer + Get + Return ViewState("CveViaje").ToString().ToEntero + End Get + Set(value As Integer) + ViewState("CveViaje") = 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 + Private Property DtDestinos As DataTable + Get + Return CType(ViewState("DtDestinos"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtDestinos") = value + End Set + End Property + Private Property DtPasajeros As DataTable + Get + Return CType(ViewState("DtPasajeros"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtPasajeros") = value + End Set End Property -#End Region +#End Region - Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load - If Not IsPostBack Then - If Request.QueryString("CveViaje") Is Nothing Then - Response.Redirect("/Transportes/RepViajes.aspx") - End If - AsientoSeleccionado = "" - CveViaje = Request.QueryString("CveViaje").ToEntero - If CveViaje > 0 Then - CargaDatos() - End If - - End If - End Sub - - Private Sub CreaDTPasajeros() - DtPasajeros = New DataTable - DtPasajeros.Columns.Add("CveViajePasajero", GetType(Integer)) - DtPasajeros.Columns.Add("Numero", GetType(Integer)) - DtPasajeros.Columns.Add("Nombre", GetType(String)) - DtPasajeros.Columns.Add("Visa", GetType(String)) - DtPasajeros.Columns.Add("Asiento", GetType(String)) - DtPasajeros.Columns.Add("Celular", GetType(String)) - DtPasajeros.Columns.Add("Importe", GetType(Decimal)) - DtPasajeros.Columns.Add("Observaciones", GetType(String)) + 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 + Response.Redirect("/Transportes/RepViajes.aspx") + End If + AsientoSeleccionado = "" + CveViaje = Request.QueryString("CveViaje").ToEntero + If CveViaje > 0 Then + CargaDatos() + End If - End Sub - - - Private Sub CargaDatos() - Dim ObjContratos As New ClsContratos - Dim ObjViaje As New ClsTransportes - - If ObjContratos.GetContratos(CveViaje, UsuarioActual.CveEmpresa) Then - Contrato = ObjContratos.DtResultados - If ObjContratos.DtResultados IsNot Nothing AndAlso ObjContratos.DtResultados.Rows.Count > 0 Then - TxtRuta.Text = Contrato.Rows(0)("Ruta").ToString - TxtFecha.Text = Contrato.Rows(0)("FechaInicial").ToString.ToDate.ToShortDateString - - CreaDTPasajeros() - InicializaCombos() - - 'Boletos Vendidos - Dim dt As DataTable - If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=1) Then 'Poner párametro para estatus y cancelado de viajes - dt = ObjViaje.DtResultados - Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder) - For Each dr As DataRow In dt.Rows - Dim lnk As LinkButton = CType(cph.FindControl($"A{dr("Asiento")}"), LinkButton) - If lnk IsNot Nothing Then - lnk.Enabled = False - lnk.CssClass = "nodisponible" - lnk.ToolTip = dr("Nombre").ToString - End If - Next - End If - End If - - Else - ObjContratos.Dispose() - ObjViaje.Dispose() - - Response.Redirect($"~/Transportes/RepContratos.aspx") End If - - ObjContratos.Dispose() - ObjViaje.Dispose() - - 'Boletos Vendidos - - End Sub - - Protected Sub InicializaCombos() - Dim CveRuta As Integer = Contrato.Rows(0)("CveRuta").ToString.ToEntero - - 'Lista Destinos''carga específicos - Dim ObjDestinos As New ClsTransportes() - If ObjDestinos.GetDestinos(CveRuta:=CveRuta) 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 - - Protected Sub CotizarTarifa() - If DdlDestino.SelectedValue <> "" And DdlPartida.SelectedValue <> "" Then - Dim ImporteR As Decimal = 0 - Dim ObjDestinos As New ClsTransportes() - If ObjDestinos.GetDestinosTarifas(DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero) Then + End Sub + + Private Sub CargaDatos() + Dim ObjContratos As New ClsContratos + Dim ObjViaje As New ClsTransportes + + If ObjContratos.GetContratos(CveViaje, UsuarioActual.CveEmpresa) Then + Contrato = ObjContratos.DtResultados + If ObjContratos.DtResultados IsNot Nothing AndAlso ObjContratos.DtResultados.Rows.Count > 0 Then + TxtRuta.Text = Contrato.Rows(0)("SubProyecto").ToString + TxtFecha.Text = Contrato.Rows(0)("FechaInicial").ToString.ToDate.ToShortDateString + DtPasajeros = New DataTable + DtPasajeros.Columns.Add("Numero", GetType(Integer)) + DtPasajeros.Columns.Add("Nombre", GetType(String)) + DtPasajeros.Columns.Add("Visa", GetType(String)) + DtPasajeros.Columns.Add("Sexo", GetType(String)) + DtPasajeros.Columns.Add("CveSexo", GetType(Integer)) + DtPasajeros.Columns.Add("Celular", GetType(String)) + DtPasajeros.Columns.Add("Observaciones", GetType(String)) + DtPasajeros.Columns.Add("Partida", GetType(String)) + DtPasajeros.Columns.Add("Destino", GetType(String)) + DtPasajeros.Columns.Add("CveDestinoOrigen", GetType(Integer)) + DtPasajeros.Columns.Add("CveDestinoFinal", GetType(Integer)) + DtPasajeros.Columns.Add("Asiento", GetType(String)) + DtPasajeros.Columns.Add("Importe", GetType(Decimal)) + InicializaCombos() + + 'Boletos Vendidos + Dim dt As DataTable + If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=1) Then 'Poner párametro para estatus y cancelado de viajes + dt = ObjViaje.DtResultados + Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder) + For Each dr As DataRow In dt.Rows + Dim lnk As LinkButton = CType(cph.FindControl($"A{dr("Asiento")}"), LinkButton) + If lnk IsNot Nothing Then + lnk.Enabled = False + lnk.CssClass = "nodisponible" + lnk.ToolTip = dr("Nombre").ToString + End If + Next + End If + End If + + Else + ObjContratos.Dispose() + ObjViaje.Dispose() + + Response.Redirect($"~/Transportes/RepContratos.aspx") + End If + + ObjContratos.Dispose() + ObjViaje.Dispose() + + 'Boletos Vendidos + + End Sub + + Protected Sub InicializaCombos() + Dim CveSubProyecto As Integer = Contrato.Rows(0)("CveSubProyecto").ToString.ToEntero + + 'Lista Destinos''carga específicos + Dim ObjDestinos As New ClsTransportes() + + 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.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 + + Protected Sub CotizarTarifa() + If DdlDestino.SelectedValue <> "-1" And DdlPartida.SelectedValue <> "-1" Then + Dim ImporteR As Decimal = 0 + Dim ObjDestinos As New ClsTransportes() + 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 End If - ObjDestinos.Dispose() - If ImporteR > 0 Then - ViewState("Importe") = ImporteR - TxtCosto.Text = $"El precio de su boleto es ${ImporteR.FormatoNumero}" - BtnGuardar.Visible = True - Else - Alert("No se encontro una tarifa para esta ruta", TipoMensaje.MsgAdvertencia) + ViewState("Importe") = ImporteR + LbCostos.Text = $"El precio de su boleto es ${ImporteR.FormatoNumero}" + LbCostos.Visible = True + BtnAgregarPasajero.Visible = True + Else + ViewState("Importe") = 0 + BtnAgregarPasajero.Visible = False + LbCostos.Visible = False + Alert("No se encontro una tarifa para estos destinos", TipoMensaje.MsgAdvertencia) + End If - TxtCosto.Text = "" - BtnGuardar.Visible = False - ViewState("Importe") = 0 - End If - End If - End Sub - - Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs) - 'quitamos la selección anterior, en caso de existir. - If AsientoSeleccionado <> "" Then - Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder) - Dim lnk As LinkButton = CType(cph.FindControl(AsientoSeleccionado), LinkButton) - lnk.CssClass = "disponible" - End If - - Dim linkButton As LinkButton = DirectCast(sender, LinkButton) - Dim buttonID As String = linkButton.ID - linkButton.CssClass += " activo" - AsientoSeleccionado = buttonID - - UpPanel.Update() - End Sub - Protected Sub FinalizarVenta(sender As Object, e As EventArgs) + ObjDestinos.Dispose() - Dim SbAlert As New StringBuilder() - Dim Retorno As New Modelos.Factura.MMensajeFactura() - - Dim ObjTransporte As New ClsTransportes() - ObjTransporte.IniciaTransacSQL() - - Dim TieneError As Boolean = False - - Try - For Each dr As DataRow In DtPasajeros.Rows 'gvr As GridViewRow In GvB.Rows - Dim Nombre, Visa, Celular, Obs, Asiento As String - Dim Sexo As Boolean = False - Dim Importe As Decimal = 0 - - Nombre = dr("Nombre").ToString - Visa = dr("Visa").ToString - Celular = dr("Celular").ToString - Obs = dr("Observaciones").ToString - Asiento = dr("Asiento").ToString - Importe = dr("Importe").ToString.ToDecimal - - '.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text - Dim CveViajePasajero = ObjTransporte.AddViajesPasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, Asiento.ToEntero, Nombre, Visa, Celular, Sexo, Obs, UsuarioActual.CveUsuario, UsuarioActual.CveVendedor) - If CveViajePasajero < 1 Then - TieneError = True - SbAlert.Append("Ocurrió un error al generar el viaje") - Exit For - End If - - dr("CveViajePasajero") = CveViajePasajero + End If + End Sub + + Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs) + 'quitamos la selección anterior, en caso de existir. + If AsientoSeleccionado <> "" Then + Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder) + Dim lnk As LinkButton = CType(cph.FindControl(AsientoSeleccionado), LinkButton) + lnk.CssClass = "disponible" + End If + + Dim linkButton As LinkButton = DirectCast(sender, LinkButton) + Dim buttonID As String = linkButton.ID + linkButton.CssClass += " activo" + AsientoSeleccionado = buttonID + + UpPanel.Update() + End Sub + + Protected Sub FinalizarVenta(sender As Object, e As EventArgs) + + Dim SbAlert As New StringBuilder() + Dim Retorno As New Modelos.Factura.MMensajeFactura() + + Dim ObjTransporte As New ClsTransportes() + ObjTransporte.IniciaTransacSQL() + + Dim TieneError As Boolean = False + + 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 + + If ObjTransporte.AddViajesPasajeros(CveViaje, CveDestinoOrigen, CveDestinoFinal, Importe, Asiento.ToEntero, Nombre, Visa, Celular, Sexo, Obs, UsuarioActual.CveUsuario, UsuarioActual.CveVendedor) > 1 Then + ObjTransporte.Commit() + End If Next + If Not TieneError Then Retorno = CrearRemision(ObjTransporte) End If @@ -246,19 +267,20 @@ Partial Class Boletos If SbAlert.Length = 0 Then SbAlert.Append("Ocurrió un error al generar la factura") - End If - - Catch ex As Exception - TieneError = True - SbAlert.Append("Ocurrió un error al generar la factura." + ex.ToString()) + End If + + Catch ex As Exception + TieneError = True + SbAlert.Append("Ocurrió un error al generar la factura." + ex.ToString()) GuardaLog(ex.ToString()) Finally If TieneError Then ObjTransporte.RollBack() ObjTransporte.Dispose() Else - SbAlert.Append("El boleto se genero correctamente") - ObjTransporte.Commit() + SbAlert.Append("El boleto se genero correctamente.") + DtPasajeros.Clear() + ObjTransporte.Dispose() DdlPartida.SelectedValueExist("-1") @@ -266,85 +288,92 @@ Partial Class Boletos AsientoSeleccionado = "" CargaDatos() End If - Alert(SbAlert.ToString(), If(TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion), ShowCloseButton:=False) - UpPanel.Update() + End Try - - End Sub - - - Protected Sub DdlPartida_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPartida.SelectedIndexChanged + + UpPanel.Update() + + End Sub + + Protected Sub DdlPartida_SelectedIndexChanged(sender As Object, e As EventArgs) + DdlDestino.DataSource = DtDestinos.FiltraParametros($"CveDestinoOrigen = {DdlPartida.SelectedValue}") + DdlDestino.DataBind() + DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "-1")) + End Sub + + Protected Sub DdlDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDestino.SelectedIndexChanged CotizarTarifa() - UpPanel.Update() - End Sub - - Protected Sub DdlDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDestino.SelectedIndexChanged - CotizarTarifa() - UpPanel.Update() - End Sub - - Protected Sub BtnNumPasajeros_Click(sender As Object, e As EventArgs) - ' GeneraPasajeros(TxtNumPasajeros.Text.ToEntero) - End Sub - - Private Sub GeneraPasajeros(Cantidad As Integer) - DtPasajeros.Clear() - For i As Integer = 1 To Cantidad - Dim Dr1 As DataRow = DtPasajeros.NewRow - Dr1("Numero") = i - 'asiento - DtPasajeros.Rows.Add(Dr1) - Next - GvB.DataSource = DtPasajeros - GvB.DataBind() - End Sub - - Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs) - - If AsientoSeleccionado = "" Then - Alert("No se ha seleccionado el asiento.") - Exit Sub - End If - - If Me.Importe <= 0 Then - Alert("No hay un importe asignado.") + End Sub + + Private Sub GeneraPasajeros(Cantidad As Integer) + DtPasajeros.Clear() + For i As Integer = 1 To Cantidad + Dim Dr1 As DataRow = DtPasajeros.NewRow + Dr1("Numero") = i + 'asiento + DtPasajeros.Rows.Add(Dr1) + Next + GvB.DataSource = DtPasajeros + GvB.DataBind() + End Sub + + Protected Sub AgregarPasajero(sender As Object, e As EventArgs) + + If AsientoSeleccionado = "" Then + Alert("No se ha seleccionado el asiento.") 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("Importe") = Me.Importe - 'asiento - DtPasajeros.Rows.Add(Dr1) - AsientoSeleccionado = "" - - GvB.DataSource = DtPasajeros - GvB.DataBind() - - 'identifico los asientos seleccionados para la venta - Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder) - For Each dr As DataRow In DtPasajeros.Rows - Dim lnk As LinkButton = CType(cph.FindControl($"A{dr("Asiento")}"), LinkButton) - If lnk IsNot Nothing Then - lnk.Enabled = False - lnk.CssClass = "seleccionado" - lnk.ToolTip = dr("Nombre").ToString - End If - Next - - UpPanel.Update() - End Sub - + End If + + If Me.Importe <= 0 Then + Alert("No hay un importe asignado.") + 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 + 'Reiniciamos Datos' + DtPasajeros.Rows.Add(Dr1) + AsientoSeleccionado = "" + TxtNombre.Text = "" + TxtVisa.Text = "" + TxtCelular.Text = "" + TxtCelular.Text = "" + TxtObservaciones.Text = "" + GvB.DataSource = DtPasajeros + GvB.DataBind() + + 'identifico los asientos seleccionados para la venta + Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder) + For Each dr As DataRow In DtPasajeros.Rows + Dim lnk As LinkButton = CType(cph.FindControl($"A{dr("Asiento")}"), LinkButton) + If lnk IsNot Nothing Then + lnk.Enabled = False + lnk.CssClass = "seleccionado" + lnk.ToolTip = dr("Nombre").ToString + End If + Next + BtnGuardar.Visible = True + UpPanel.Update() + End Sub + Private Function CrearRemision(ByRef objTrans As ClsTransportes) As Modelos.Factura.MMensajeFactura - Dim Retorno As New Modelos.Factura.MMensajeFactura + Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing Dim CveCliente As Integer = 1154164 Dim CveMoneda As Integer = 2 - Dim CveSubProyecto As Integer = -1 + Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero() If CveCliente <= 0 Then Retorno.Mensajes.Add("No se pudo cargar el cliente") @@ -356,46 +385,41 @@ Partial Class Boletos Return Retorno End If - Dim CvePSBoleto As Integer = 912720 - - If EsProduccion Then - CvePSBoleto = 986337 - CveCliente = 1172306 - End If - Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyecto, CveCliente, CveMoneda, "Rem") - If ObjFactura IsNot Nothing Then - CveSubProyecto = ObjFactura.Cliente.CveSubProyecto + Dim CvePSBoleto As Integer = 912720 - For Each Dr As DataRow In DtPasajeros.Rows - Dim Obs = Dr("Nombre").ToString - Dim Importe = Dr("Importe").ToString.ToDecimal() - If Importe <= 0 Then - Retorno.Mensajes.Add("El importe debe ser mayor a 0") - Return Retorno - End If - - ObjFactura.AgregarPS(CvePSBoleto, 1, Importe, 0, Obs, CveSubProyecto:=CveSubProyecto, PorcentajeIVA:=0, CveViajePasajero:=Dr("CveViajePasajero").ToString().ToEntero()) - Next - - ObjFactura.CalculaTotales() - - Try - Retorno = ObjFactura.EmitirFactura(False, Transac:=objTrans.IniciaTransacSQL()) - Catch ex As Exception - Retorno = Nothing - GuardaLog(ex.ToString()) - End Try - - If ObjFactura IsNot Nothing Then - ObjFactura.Dispose() + For Each Dr As DataRow In DtPasajeros.Rows + Dim Obs = Dr("Nombre").ToString + Dim Importe = Dr("Importe").ToString.ToDecimal() + If Importe <= 0 Then + Retorno.Mensajes.Add("El importe debe ser mayor a 0") + Return Retorno End If - Else - Retorno.Mensajes.Add("No se pudo generar la factura") - End If + ObjFactura.AgregarPS(CvePSBoleto, 1, Importe, 0, Obs, CveSubProyecto:=CveSubProyecto, PorcentajeIVA:=0) + Next + + ObjFactura.CalculaTotales() + + Try + Retorno = ObjFactura.EmitirFactura(False, Transac:=objTrans.IniciaTransacSQL()) + Catch ex As Exception + Retorno = Nothing + GuardaLog(ex.ToString()) + End Try + + If ObjFactura IsNot Nothing Then + ObjFactura.Dispose() + End If Return Retorno End Function -End Class + + '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 diff --git a/Transportes/CatRutas.aspx b/Transportes/CatRutas.aspx index 3a6c48f3f..0fcd0aacc 100644 --- a/Transportes/CatRutas.aspx +++ b/Transportes/CatRutas.aspx @@ -26,55 +26,6 @@ <%--Calendario Tab--%> - <%--Rutas Tab--%> - - -
-
- -
-
- " - style="display: inline-block; margin-right: -10px; width: 150px;" /> - " - style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> - -
- -
- - - - - - - - - - - - - - - - - - - - - - -
-
<%--Destinos Tab--%> @@ -133,7 +84,7 @@ <%--Importes Tab--%> - +
@@ -152,29 +103,26 @@
- + data-sort="true" DataKeyNames="CveDestinoTarifa, CveSubProyecto, CveDestinoOrigen, CveDestinoFinal, Importe, Destino, Partida"> - + - - - - - - - + - + - + + + + + @@ -305,8 +253,8 @@
-