Cambios GlobalDTSubPoryecto

Cambio GlobalDTUsuario
This commit is contained in:
2024-08-01 05:49:07 -07:00
30 changed files with 3675 additions and 1988 deletions

View File

@@ -202,30 +202,35 @@ Partial Class RepContratosCalendario
End Sub
Private Sub OnRowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvContratos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim BackgroundColor As String = DataBinder.Eval(e.Row.DataItem, "BackgroundColor").ToString()
If e.Row.RowType = DataControlRowType.DataRow Then
Dim BackgroundColor As String = DataBinder.Eval(e.Row.DataItem, "BackgroundColor").ToString()
e.Row.BackColor = Drawing.ColorTranslator.FromHtml(BackgroundColor)
e.Row.Cells(1).Attributes.Add("data-order", e.Row.DBCampo("FechaInicial").ToDate.Ticks.ToString)
Dim BGC_Atencion As String = "#bc9b1b"
Dim TipoEstatus As Integer = e.Row.DataKey("TipoEstatus").ToEntero
If TipoEstatus <> 4 AndAlso TipoEstatus <> 3 Then
If e.Row.DataKey("CveChofer").ToEntero <= 0 Or (e.Row.DataKey("CveChofer2").ToEntero <= 0 And e.Row.DataKey("NumChoferes").ToEntero = 2) Or e.Row.DataKey("CveAF").ToEntero <= 0 Then
e.Row.BackColor = Drawing.ColorTranslator.FromHtml(BGC_Atencion)
End If
End If
End If
End Sub
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
If HidModClienteNombre.Value = "" Then
HidModClienteNombre.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, HidModCveCliente.Value.ToEntero).FiltroPrimeroValor("NombreComercial")
Dim NumChoferes As Integer = If(chkSegundoChofer.Checked, 2, 1)
If NumChoferes = 2 AndAlso DdlChofer2.SelectedValue.ToEntero <= 0 Then
Alert("Debe de seleccionar un segundo chofer.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
DdlClientes.SelectedText = HidModClienteNombre.Value
DdlClientes.SelectedValue = HidModCveCliente.Value
DdlClientes.txtText.Value = HidModClienteNombre.Value
DdlClientes.txtValue.Value = HidModCveCliente.Value
UpModal.Update()
RegistraScript("$('#ModalActualizar').modal('show');")
End Sub
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
Dim ObjContratos As New ClsContratos
Dim DTAgendadados As New DataTable
@@ -250,8 +255,12 @@ Partial Class RepContratosCalendario
End If
If ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", DdlSubProyectoModal.SelectedValue.ToEntero,
-1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, CveContratosEstatus:=DdlEstatusContrato.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text.Trim) Then
-1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34,
CveContratosEstatus:=DdlEstatusContrato.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero,
CveAF:=DdlAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text.Trim, NumChoferes:=NumChoferes) Then
RegistraScript("$('#ModalActualizar').modal('hide');")
Alert("Actualizado Correctamente.")
End If
@@ -263,8 +272,11 @@ Partial Class RepContratosCalendario
InicializaCalendar()
End Sub
Protected Sub UpdateModal(sender As Object, e As EventArgs)
Protected Sub UpdateModal(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim NumChoferes As Integer = GvRow.DataKey("NumChoferes").ToEntero
TxtFolio.Text = GvRow.DataKey("NumeroContrato")
TxtCantidadPasajeros.Text = GvRow.DataKey("CantidadPasajeros")
DdlClientes.SelectedValue = GvRow.DataKey("CveCliente")
@@ -274,18 +286,142 @@ Partial Class RepContratosCalendario
TxtUbicacion.Text = GvRow.DataKey("Ubicacion")
TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy HH:mm:ss")
TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy HH:mm:ss ")
TxtMoneda.Text = GvRow.DataKey("Moneda")
'Requeridos
DdlAF.SelectedValueExist(GvRow.DataKey("CveAF"))
TxtMoneda.Text = GvRow.DataKey("Moneda")
'Requeridos
DdlChofer.SelectedValueExist(GvRow.DataKey("CveChofer"))
DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2"))
DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2"))
chkSegundoChofer.Checked = If(NumChoferes = 2, True, False)
DdlEstatusContrato.SelectedValueExist(GvRow.DataKey("CveContratosEstatus"))
DdlSubProyectoModal.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
DdlSubProyectoModal.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
DdlTipoAF.SelectedValueExist(GvRow.DataKey("CveTipoAF"))
DdlTipoAF_SelectedIndexChanged(Nothing, Nothing)
DdlAF.SelectedValueExist(GvRow.DataKey("CveAF"))
HypRemision.Text = GvRow.DataKey("RemisionSerieFolio")
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={GvRow.DataKey("CveVentaRemision")}"
If GvRow.DataKey("RemisionSaldo").ToDecimal > 0 Then
LblSaldo.Text = $"Saldo {GvRow.DataKey("RemisionSaldo").ToDecimal.ToString("###,###,###.00")}"
Else
LblSaldo.Text = ""
End If
CveContrato = GvRow.DataKey("CveContrato").ToEntero
OcultarMostrarSegundoChofer()
UpCommando.Update()
UpModal.Update()
RegistraScript("$('#ModalActualizar').modal('show');")
End Sub
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
If HidModClienteNombre.Value = "" Then
HidModClienteNombre.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, HidModCveCliente.Value.ToEntero).FiltroPrimeroValor("NombreComercial")
End If
DdlClientes.SelectedText = HidModClienteNombre.Value
DdlClientes.SelectedValue = HidModCveCliente.Value
DdlClientes.txtText.Value = HidModClienteNombre.Value
DdlClientes.txtValue.Value = HidModCveCliente.Value
chkSegundoChofer.Checked = If(HidNumChoferes.Value.ToEntero = 2, True, False)
OcultarMostrarSegundoChofer()
HypRemision.Text = HidRemisionSerieFolio.Value
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={HidCveVentaRemision.Value}"
If HidRemisionSaldo.Value.ToDecimal > 0 Then
LblSaldo.Text = $"Saldo {HidRemisionSaldo.Value.ToDecimal.ToString("###,###,###.00")}"
Else
LblSaldo.Text = ""
End If
UpModal.Update()
RegistraScript("$('#ModalActualizar').modal('show');")
End Sub
Protected Sub chkSegundoChofer_CheckedChanged(sender As Object, e As EventArgs)
OcultarMostrarSegundoChofer()
End Sub
Private Sub OcultarMostrarSegundoChofer()
If chkSegundoChofer.Checked Then
DVChofer2.Attributes.Add("style", "display:block")
Else
DVChofer2.Attributes.Add("style", "display:none")
End If
UpCommando.Update()
UpModal.Update()
End Sub
Protected Sub DdlTipoAF_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaAFDdl(DdlTipoAF.SelectedValue.ToEntero)
End Sub
Protected Sub BtnDdlTipoAF_Click(sender As Object, e As EventArgs)
CargaAFDdl(HidCveTipoAF.Value.ToEntero)
End Sub
Private Sub CargaAFDdl(CveTipoAF As Integer)
'Lista de Activos fijos
DdlAF.ClearSelection()
DdlAF.SelectedValue = Nothing
DdlAF.Items.Clear()
Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratosValUnidadesAgendadas(DdlAF.SelectedValue.ToEntero, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, UsuarioActual.CveEmpresa, CveContrato, 2) Then
If CveTipoAF > 0 Then
DdlAF.DataSource = ObjContratos.DtResultados.FiltraParametros($" CveTipoActivoFijo = {CveTipoAF} ")
Else
DdlAF.DataSource = ObjContratos.DtResultados
End If
End If
ObjContratos.Dispose()
'If CveTipoAF > 0 Then
' DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros($" EstadoActivoFijo= 'Activo' AND CveTipoActivoFijo = {CveTipoAF} ")
'Else
' DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros($" EstadoActivoFijo= 'Activo' ")
'End If
DdlAF.DataBind()
DdlAF.Items.Insert(0, New ListItem("-", "-1"))
UpModal.Update()
End Sub
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
End Sub
@@ -325,4 +461,10 @@ Partial Class RepContratosCalendario
Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaCronograma(DdlTipoVista.SelectedValue.ToEntero)
End Sub
End Class