From cc3a64d18e9a49fde10ea16841aeaadd9d1e1f92 Mon Sep 17 00:00:00 2001 From: AbrahamCastilloV Date: Tue, 13 Feb 2024 13:39:16 -0700 Subject: [PATCH] =?UTF-8?q?--Se=20pasa=20calendarios=20y=20repcontratos=20?= =?UTF-8?q?a=20s=C3=B3lo=20la=20clase=20de=20ClsContratos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/CalendarEvent.vb | 9 +- App_Code/ClsPaginas.vb | 2 +- Ashx/CargaEventos.ashx | 9 +- Transportes/RepContratoDetalle.aspx | 24 ++ Transportes/RepContratoDetalle.aspx.vb | 9 + Transportes/RepContratos - Copy.aspx | 361 --------------------- Transportes/RepContratos - Copy.aspx.vb | 159 --------- Transportes/RepContratos.aspx | 2 +- Transportes/RepContratos.aspx.vb | 18 +- Transportes/RepContratosCalendario.aspx | 87 ++--- Transportes/RepContratosCalendario.aspx.vb | 48 ++- Transportes/RepViajes.aspx.vb | 1 - 12 files changed, 141 insertions(+), 588 deletions(-) create mode 100644 Transportes/RepContratoDetalle.aspx create mode 100644 Transportes/RepContratoDetalle.aspx.vb delete mode 100644 Transportes/RepContratos - Copy.aspx delete mode 100644 Transportes/RepContratos - Copy.aspx.vb diff --git a/App_Code/CalendarEvent.vb b/App_Code/CalendarEvent.vb index 35dfa7999..f5f94aaee 100644 --- a/App_Code/CalendarEvent.vb +++ b/App_Code/CalendarEvent.vb @@ -34,22 +34,19 @@ Public Class CalendarEvent Public Property NomprePersonal As String Public Property NombreAcercamiento As String Public Property CvePersonal As Integer + Public Property CvePersonal2 As Integer Public Property CveCliente As Integer Public Property CveProveedor As Integer Public Property CveOS As Integer Public Property CveOSDetalle As Integer Public Property CveUsuarioAtendio As Integer - Public Property CveSubProyectoUsuarioAtendio As Integer - Public Property CveCompra As Integer Public Property SerieFolioCompra As String - Public Property CveVenta As Integer Public Property SerieFolioVenta As String Public Property CveActivoFijo As Integer Public Property AFCodigo As String - Public Property CveMovimiento As Integer Public Property MovimientoFolio As String Public Property CveIE As Integer @@ -57,7 +54,7 @@ Public Class CalendarEvent Public Property Pesos As Double Public Property Dolares As Double Public Property Anticipo As Double - - + Public Property CantidadPasajeros As String + Public Property NumeroContrato As String End Class diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 365eecdb7..9874e1c47 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10812,7 +10812,7 @@ Public Class ClsPaginas #Region "Transportes" PaginaDict.Add("/Transportes/RepContratos.aspx".ToUpper(), 598) - PaginaDict.Add("/Transportes/RepContratosDetalles.aspx".ToUpper(), 598) + PaginaDict.Add("/Transportes/RepContratoDetalle.aspx".ToUpper(), 598) PaginaDict.Add("/Transportes/RepViajes.aspx".ToUpper(), 599) PaginaDict.Add("/Transportes/Boletos.aspx".ToUpper(), 600) PaginaDict.Add("/Transportes/RepBoletos.aspx".ToUpper(), 601) diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index 84be4f7ec..0513bd853 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -449,7 +449,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState - If ObjContratos.GetContratos(-1, usuarioActual_.CveEmpresa, TipoContrato:=2) Then + If ObjContratos.GetContratos(-1, usuarioActual_.CveEmpresa, TipoContrato:=34) Then If ObjContratos.DtResultados.Rows.Count > 0 Then @@ -465,14 +465,15 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState cevent.NombreAcercamiento = dr("Ubicacion").ToString cevent.CveCliente = dr("CveCliente").ToString.ToEntero cevent.CvePersonal = dr("CveChofer").ToString.ToEntero + cevent.CvePersonal2 = dr("CveChofer2").ToString.ToEntero + cevent.CveEventoEstatus = dr("CveContratosEstatus").ToString.ToEntero cevent.Dolares = dr("Importe").ToString.ToDecimal cevent.Pesos = dr("ImporteMax").ToString.ToDecimal cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero cevent.backgroundColor = dr("BackgroundColor").ToString - - - + cevent.CantidadPasajeros = dr("CantidadPasajeros").ToString + cevent.NumeroContrato = dr("NumeroContrato").ToString If Not cevent.recurrenciatipo > 0 Then diff --git a/Transportes/RepContratoDetalle.aspx b/Transportes/RepContratoDetalle.aspx new file mode 100644 index 000000000..c88825dd2 --- /dev/null +++ b/Transportes/RepContratoDetalle.aspx @@ -0,0 +1,24 @@ +<%@ Page Language="VB" AutoEventWireup="true" Title="Transportes V&A - Detalles del Contrato" + MasterPageFile="~/Site.master" + CodeFile="RepContratoDetalle.aspx.vb" + Inherits="RepContratoDetalle" %> + + + Detalles del Contratos + + + + + + + + + + + + + + + + diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb new file mode 100644 index 000000000..57204ff36 --- /dev/null +++ b/Transportes/RepContratoDetalle.aspx.vb @@ -0,0 +1,9 @@ +Option Explicit On +Option Strict On + +Partial Class RepContratoDetalle + Inherits ClsPaginas + +End Class + + diff --git a/Transportes/RepContratos - Copy.aspx b/Transportes/RepContratos - Copy.aspx deleted file mode 100644 index b89700e5b..000000000 --- a/Transportes/RepContratos - Copy.aspx +++ /dev/null @@ -1,361 +0,0 @@ -<%@ Page Language="VB" AutoEventWireup="true" Title="Transportes V&A - Contratos" - MasterPageFile="~/Site.master" - CodeFile="RepContratos - Copy.aspx.vb" - Inherits="ListadoContratos" %> - - - Listado de Contratos - - - - - - - - - -
  • - Agregar Contrato -
  • -
  • - Generar Excel -
  • -
    - - - -
    -
    - - - - -
    -
    - - - - -
    - -
    - - - - -
    - -
    - - -
    - -
    - -
    - - -
    -
    - - -
    -
    -
    - - - - - - - - - - - - - - Fecha
    - Salida -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - Fecha
    - Regreso -
    - - - -
    - - - - - - - -
    -
    -
    -
    - - - -
    - - diff --git a/Transportes/RepContratos - Copy.aspx.vb b/Transportes/RepContratos - Copy.aspx.vb deleted file mode 100644 index 57ecfc736..000000000 --- a/Transportes/RepContratos - Copy.aspx.vb +++ /dev/null @@ -1,159 +0,0 @@ -Option Explicit On -Option Strict On -Imports System.Data.SqlClient -Imports Extensiones -Imports Extensiones.ModExtensiones - -Partial Class ListadoContratos - Inherits ClsPaginas - - Private Property CveContrato As Integer - Get - Return ViewState("CveContrato").ToString().ToEntero - End Get - Set(value As Integer) - ViewState("CveContrato") = value - End Set - End Property - Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - txtFechaI.Text = DateTime.Now.AddMonths(-1).ToString("MM/dd/yyyy").Replace(" ", "T") - txtFechaF.Text = DateTime.Now.AddDays(7).ToString("MM/dd/yyyy").Replace(" ", "T") - - If Not IsPostBack Then - ViewState("CveContrato") = 0 - 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("-", "")) - 'Lista Chofer' - DdlChofer.DataSource = GlobalDTRHPersonal(185) - DdlChofer.DataBind() - DdlChofer.Items.Insert(0, New ListItem("-", "")) - UpModal.Update() - End Sub - Private Sub CargaDatos() - Dim ObjContratos As New ClsContratos - If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then - GvContratos.DataSource = ObjContratos.DtResultados - GvContratos.DataBind() - End If - If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then - DdlEstatusConsulta.DataSource = ObjContratos.DtResultados - DdlEstatusConsulta.DataBind() - DdlEstatusConsulta.Items.Insert(0, New ListItem("-", "")) - - End If - UpTitulos.Update() - - End Sub - Protected Sub MostrarModal(Optional Descripcion As String = "", Optional FechaSalida As String = "", Optional FechaRegreso As String = "", Optional Observaciones As String = "", Optional Ubicacion As String = "", Optional Transporte As String = "", Optional CveCliente As Integer = 0, Optional Dolares As String = "", Optional Pesos As String = "", Optional Anticipo As String = "", Optional Boton As String = "Guardar", Optional Chofer As String = "") - - 'DdlClientes.SelectedText = Cliente - TxtDescripcion.Text = Descripcion - TxtUbicacion.Text = Ubicacion - TxtFechaSalida.Text = FechaSalida - TxtFechaRegreso.Text = FechaRegreso - TxtObservaciones.Text = Observaciones - TxtUbicacion.Text = Ubicacion - DdlTipoAF.SelectedValue = Transporte - DdlClientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial") - DdlClientes.SelectedValue = CveCliente.ToString - DdlChofer.SelectedValue = Chofer - TxtObservaciones.Text = Observaciones - TxtDolares.Text = Math.Round(Dolares.ToDecimal, 2).ToString - TxtPesos.Text = Math.Round(Pesos.ToDecimal, 2).ToString - TxtAnticipo.Text = Math.Round(Anticipo.ToDecimal * 100, 2).ToString - BtnGuardar.Text = Boton - myModalLabel.InnerHtml = $"{Boton} Contrato" - UpModal.Update() - RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar")) - End Sub - Private Sub LBAgregarContrato_Click(sender As Object, e As EventArgs) Handles LBAgregarContrato.Click - MostrarModal() - End Sub - Protected Sub AddContrato(sender As Object, e As EventArgs) - - If DdlClientes.SelectedValue = "" Then - Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - Dim ObjContratos As New ClsContratos - ObjContratos.IniciaTransacSQL() - - - 'Agregar contrato - If BtnGuardar.Text = "Guardar" Then - If ObjContratos.AddContratos("", TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero) > 0 Then - ObjContratos.Commit() - Alert("Agregado Correctamente.") - End If - End If - - 'Actualizar contrato - If BtnGuardar.Text = "Editar" Then - If ObjContratos.UpdateContratos(CveContrato, "", TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=1, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero) Then - - ObjContratos.Commit() - Alert("Actualizado Correctamente.") - End If - End If - - TxtDescripcion.Text = "" - TxtFechaSalida.Text = "" - TxtFechaRegreso.Text = "" - TxtObservaciones.Text = "" - TxtUbicacion.Text = "" - DdlClientes.SelectedText = "" - DdlTipoAF.SelectedValue = "" - DdlChofer.SelectedValue = "" - TxtDolares.Text = "" - TxtPesos.Text = "" - TxtAnticipo.Text = "" - BtnGuardar.Text = "Guardar" - - ObjContratos.Dispose() - CargaDatos() - - End Sub - - Protected Sub LBExcel_Click(sender As Object, e As EventArgs) Handles LBExcel.Click - GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString) - End Sub - - Protected Sub Consultar(sender As Object, e As EventArgs) - Dim fechaInicial As String = txtFechaI.Text - Dim fechaFinal As String = txtFechaF.Text - - Dim cliente As String = If(DdlClientesConsulta.SelectedValue = "", "", $"C.CveCliente = {DdlClientesConsulta.SelectedValue} AND") - Dim estatus As String = "" - Dim nombreEstatus As String = "" - Dim innerEstatus As String = "" - If (DdlEstatusConsulta.SelectedValue <> "") Then - estatus = $"C.CveContratosEstatus = {DdlEstatusConsulta.SelectedValue} AND" - nombreEstatus = ", CE.ContratoEstatus As ContratoEstatus1" - innerEstatus = "INNER JOIN Con_ContratosEstatus CE with(nolock) ON CE.CveContratoEstatus = C.CveContratosEstatus -" - End If - Dim intervalo As String = If(DdlEstatusConsulta.SelectedValue = "" And DdlClientesConsulta.SelectedValue = "", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'") - - - Dim query As String = $"SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial {nombreEstatus} FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente {innerEstatus} WHERE {cliente} {estatus} {intervalo}" - - Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString) - Using command As New SqlCommand(query, connection) - connection.Open() - Dim reader As SqlDataReader = command.ExecuteReader() - GvContratos.DataSource = reader - GvContratos.DataBind() - End Using - End Using - - UpTitulos.Update() - End Sub -End Class diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx index 146ab1b88..bea5d7eca 100644 --- a/Transportes/RepContratos.aspx +++ b/Transportes/RepContratos.aspx @@ -149,7 +149,7 @@ - + diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb index 0064bb3e2..33482ca77 100644 --- a/Transportes/RepContratos.aspx.vb +++ b/Transportes/RepContratos.aspx.vb @@ -81,14 +81,23 @@ Partial Class ListadoContratos Exit Sub End If + 'Aumentamos Folio + Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero + Dim ObjFolios As New ClsGralFolios + If ObjFolios.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then + ObjFolios.Dispose() + End If + + 'Agregamos Contrato Dim ObjContratos As New ClsContratos ObjContratos.IniciaTransacSQL() - If ObjContratos.AddContratos(LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text) > 0 Then ObjContratos.Commit() Alert("Agregado Correctamente.") End If + ObjContratos.Dispose() + 'Reiniciamos modal TxtDescripcion.Text = "" TxtFechaSalida.Text = "" TxtFechaRegreso.Text = "" @@ -101,7 +110,6 @@ Partial Class ListadoContratos TxtAnticipo.Text = "" TxtCantidadPasajeros.Text = "" - ObjContratos.Dispose() UpModal.Update() CargaDatos() @@ -192,4 +200,10 @@ Partial Class ListadoContratos End If End Sub + + Protected Sub GoContratoDetalle(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim CveContrato As String = GvRow.DataKey("CveContrato") + Response.Redirect(String.Format("~/Transportes/RepContratoDetalle.aspx?CveContrato={0}", CveContrato)) + End Sub End Class diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx index ddd19f296..271280696 100644 --- a/Transportes/RepContratosCalendario.aspx +++ b/Transportes/RepContratosCalendario.aspx @@ -151,6 +151,7 @@ +
    @@ -198,20 +199,20 @@
    - + <%-- Contratos --%> + data-sort="true" DataKeyNames="CveContrato, NumeroContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente,NombreComercial, CveTipoAF, Importe, ImporteMin, ImporteMax, Observaciones, CveAF, CveChofer, CveChofer2, CveContratosEstatus, CantidadPasajeros"> - - + + Fecha
    @@ -221,6 +222,7 @@
    + @@ -235,11 +237,10 @@ - + - @@ -248,9 +249,10 @@ - + + Fecha
    @@ -275,7 +277,6 @@
    -
    @@ -284,13 +285,12 @@ - + <%-- Modal --%>