Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
|
||||
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD text-center" GridLines="None"
|
||||
data-sort="true" DataKeyNames="CveContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente, CveTipoAF">
|
||||
data-sort="true" DataKeyNames="CveContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente, CveTipoAF, CveContratoEstatus ">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderText="No. Contrato">
|
||||
|
||||
@@ -1,46 +1,38 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
Imports ADSNetLibrary.SIGAPI.Helpers
|
||||
Imports Extensiones.ModExtensiones
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class ListadoContratos
|
||||
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
InicializaCombos()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
|
||||
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then
|
||||
GvContratos.DataSource = ObjContratos.DtResultados
|
||||
ObjContratos.Dispose()
|
||||
GvContratos.DataBind()
|
||||
Else
|
||||
Me.GvContratos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
|
||||
Private Sub InicializaCombos()
|
||||
DdlClientes.setEsWebService(True)
|
||||
'Lista Activos Fijos'
|
||||
Dim ObjAF As New ClsAF()
|
||||
If ObjAF.GetActivosFijos(-1, 13, "-1", "-1", -1, -1, "-1", -1, -1, -1, -1, 1, "-1", -1, -1, -1) Then
|
||||
If ObjAF.DtResultados.Rows.Count > 0 Then
|
||||
DdlTransporte.DataSource = ObjAF.DtResultados
|
||||
DdlTransporte.DataBind()
|
||||
|
||||
DdlTransporte.Items.Insert(0, New ListItem("Seleccione Transporte", ""))
|
||||
DdlTransporte.Items.Insert(0, New ListItem("Seleccione", "0"))
|
||||
End If
|
||||
End If
|
||||
ObjAF.Dispose()
|
||||
DdlTransporte.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then
|
||||
GvContratos.DataSource = ObjContratos.DtResultados
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
GvContratos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
|
||||
@@ -56,14 +48,13 @@ Partial Class ListadoContratos
|
||||
|
||||
Protected Sub AddContrato(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
If DdlClientes.SelectedValue = "" Then
|
||||
Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
Try
|
||||
|
||||
If BtnGuardar.Text = "Guardar" Then
|
||||
@@ -71,6 +62,7 @@ Partial Class ListadoContratos
|
||||
Dim CveEstatusInicial As Integer = 10
|
||||
Dim CveContratoHijo As Integer = -1
|
||||
Dim CveContratoTipo As Integer = 2
|
||||
|
||||
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
||||
CveEstatusInicial = ObjContratos.DtResultados.FiltroPrimeroValor("CveContratoEstatus", "TipoEstatus=1").ToEntero
|
||||
End If
|
||||
@@ -117,7 +109,7 @@ Partial Class ListadoContratos
|
||||
ObjContratos.RollBack()
|
||||
Finally
|
||||
ObjContratos.Dispose()
|
||||
Response.Redirect("ListadoContratos.aspx")
|
||||
CargaDatos()
|
||||
|
||||
End Try
|
||||
|
||||
@@ -150,19 +142,11 @@ Partial Class ListadoContratos
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
Try
|
||||
|
||||
ObjContratos.RemoveContrato(GvRow.DataKey("CveContrato").ToEntero, UsuarioActual.CveEmpresa)
|
||||
If ObjContratos.RemoveContrato(GvRow.DataKey("CveContrato").ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Contrato eliminado correctamente")
|
||||
CargaDatos()
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
|
||||
ObjContratos.Commit()
|
||||
Response.Redirect(Request.RawUrl)
|
||||
|
||||
Catch ex As Exception
|
||||
Alert($"Ocurrió un error {ex}", TipoMensaje.MsgError)
|
||||
Finally
|
||||
ObjContratos.Dispose()
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user