--Se hace los cambios de colores en CargaEventos. Se carga la barra de filtros con sus estilos . Se crea el método para modificar el background color por fila dependiendo el estatus, la consulta con filtros en calendarios y modificar el contrato a través del listado de contratos.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
Imports System.Data.SqlClient
|
||||
Imports ADSNetLibrary.SIGAPI.Helpers
|
||||
Imports Extensiones.ModExtensiones
|
||||
|
||||
@@ -49,11 +50,53 @@ Partial Class RepContratosCalendario
|
||||
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
||||
End Sub
|
||||
|
||||
Private Sub OnRowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvContratos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim estatusContrato As String = DataBinder.Eval(e.Row.DataItem, "EstatusContrato").ToString()
|
||||
|
||||
Select Case estatusContrato
|
||||
Case "1"
|
||||
e.Row.BackColor = Drawing.Color.FromArgb(0, 165, 106)
|
||||
Case "2"
|
||||
e.Row.BackColor = Drawing.Color.FromArgb(43, 79, 214)
|
||||
Case "3"
|
||||
e.Row.BackColor = Drawing.Color.FromArgb(238, 96, 46)
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
|
||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub Consultar(sender As Object, e As EventArgs)
|
||||
If DdlClientesConsulta.SelectedValue = "" Then
|
||||
Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim cliente As Integer = DdlClientesConsulta.SelectedValue.ToEntero
|
||||
Dim estatus As Integer = DdlEstatusConsulta.SelectedValue.ToEntero
|
||||
Dim fechaInicial As DateTime = txtFechaI.Text.ToDate
|
||||
Dim fechaFinal As DateTime = txtFechaF.Text.ToDate
|
||||
|
||||
Dim query As String = "SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial, RH.NombreCompleto AS NombreCompleto FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente LEFT JOIN RH_Personal RH with(nolock) ON C.CveChofer = RH.CvePersonal WHERE C.CveCliente = @Cliente AND EstatusContrato = @Estatus AND FechaInicial BETWEEN @FechaInicial AND @FechaFinal"
|
||||
|
||||
Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
|
||||
Using command As New SqlCommand(query, connection)
|
||||
command.Parameters.AddWithValue("@Cliente", cliente)
|
||||
command.Parameters.AddWithValue("@Estatus", estatus)
|
||||
command.Parameters.AddWithValue("@FechaInicial", fechaInicial)
|
||||
command.Parameters.AddWithValue("@FechaFinal", fechaFinal)
|
||||
|
||||
connection.Open()
|
||||
Dim reader As SqlDataReader = command.ExecuteReader()
|
||||
GvContratos.DataSource = reader
|
||||
GvContratos.DataBind()
|
||||
End Using
|
||||
End Using
|
||||
|
||||
UpTitulos.Update()
|
||||
End Sub
|
||||
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
||||
|
||||
If DdlClientes.SelectedValue = "" Then
|
||||
@@ -78,8 +121,21 @@ Partial Class RepContratosCalendario
|
||||
ObjContratos.Dispose()
|
||||
CargaDatos()
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub UpdateModal(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
TxtObservaciones.Text = GvRow.DataKey("Observaciones")
|
||||
TxtDescripcion.Text = GvRow.DataKey("DescripcionContrato")
|
||||
TxtUbicacion.Text = GvRow.DataKey("Ubicacion")
|
||||
TxtFechaSalida.Text = GvRow.DataKey("FechaInicial").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||
TxtFechaRegreso.Text = GvRow.DataKey("FechaFinal").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||
DdlClientes.SelectedValue = GvRow.DataKey("CveCliente")
|
||||
DdlAF.SelectedValue = GvRow.DataKey("CveAF")
|
||||
DdlChofer.SelectedValue = GvRow.DataKey("CveChofer")
|
||||
|
||||
UpModal.Update()
|
||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user