--Método de actualización de contratos
This commit is contained in:
@@ -85,7 +85,7 @@
|
|||||||
|
|
||||||
<asp:TemplateField HeaderText="Importe">
|
<asp:TemplateField HeaderText="Importe">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="LtlImporte" runat="server" Text='<%# Eval("Importe") %>'></asp:Literal>
|
<asp:Literal ID="LtlImporte" runat="server" Text='<%# Eval("Importe", "{0:n}") %>'></asp:Literal>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
|||||||
@@ -104,8 +104,7 @@ Partial Class ListadoBoletos
|
|||||||
New ReportParameter("TelefonoAgencia", "Telefono Agencia")
|
New ReportParameter("TelefonoAgencia", "Telefono Agencia")
|
||||||
}
|
}
|
||||||
|
|
||||||
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos/Boleto.mrt", dtResult, params, NombreArchivo:="Boleto")
|
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Boleto.mrt", dtResult, params, NombreArchivo:="Boleto")
|
||||||
|
|
||||||
'Empresas/Grales/Formatos/EntradaSalida.mrt
|
'Empresas/Grales/Formatos/EntradaSalida.mrt
|
||||||
'Empresas/188/Formatos/Boleto.mrt
|
'Empresas/188/Formatos/Boleto.mrt
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<%@ Page Language="VB" AutoEventWireup="false" Title="Transportes V&A - Contratos" MasterPageFile="~/Site.master"
|
<%@ Page Language="VB" AutoEventWireup="false" Title="Transportes V&A - Contratos"
|
||||||
|
MasterPageFile="~/Site.master"
|
||||||
CodeFile="RepContratos.aspx.vb"
|
CodeFile="RepContratos.aspx.vb"
|
||||||
Inherits="ListadoContratos" %>
|
Inherits="ListadoContratos" %>
|
||||||
|
|
||||||
@@ -46,7 +47,6 @@
|
|||||||
<asp:HyperLink ID="LBListadoViajes" runat="server" NavigateUrl="RepViajes.aspx"
|
<asp:HyperLink ID="LBListadoViajes" runat="server" NavigateUrl="RepViajes.aspx"
|
||||||
Target="_blank"><i class='fa fa-road'></i>Viajes</asp:HyperLink>
|
Target="_blank"><i class='fa fa-road'></i>Viajes</asp:HyperLink>
|
||||||
</li>--%>
|
</li>--%>
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
@@ -85,6 +85,12 @@
|
|||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Cliente">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtNombreComercial" runat="server" Text='<%# Eval("NombreComercial") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
|
||||||
<HeaderTemplate>
|
<HeaderTemplate>
|
||||||
Fecha<br />
|
Fecha<br />
|
||||||
@@ -119,6 +125,8 @@
|
|||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
|
|
||||||
|
<asp:UpdatePanel runat="server" ID="UpModal">
|
||||||
|
<ContentTemplate>
|
||||||
<div id="ModalAgregar" class="modal ADS fade" role="dialog">
|
<div id="ModalAgregar" class="modal ADS fade" role="dialog">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div id="UpAddChofer" class="modal-content rowpadding" tabindex="-1"
|
<div id="UpAddChofer" class="modal-content rowpadding" tabindex="-1"
|
||||||
@@ -271,6 +279,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
|
||||||
|
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
|
||||||
</contenttemplate>
|
</contenttemplate>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -5,13 +5,20 @@ Imports Extensiones.ModExtensiones
|
|||||||
Partial Class ListadoContratos
|
Partial Class ListadoContratos
|
||||||
Inherits ClsPaginas
|
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
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
InicializaCombos()
|
InicializaCombos()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub InicializaCombos()
|
Private Sub InicializaCombos()
|
||||||
DdlClientes.setEsWebService(True)
|
DdlClientes.setEsWebService(True)
|
||||||
'Lista Activos Fijos'
|
'Lista Activos Fijos'
|
||||||
@@ -25,7 +32,6 @@ Partial Class ListadoContratos
|
|||||||
DdlTransporte.DataBind()
|
DdlTransporte.DataBind()
|
||||||
ObjAF.Dispose()
|
ObjAF.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then
|
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then
|
||||||
@@ -34,7 +40,6 @@ Partial Class ListadoContratos
|
|||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
GvContratos.DataBind()
|
GvContratos.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub MostrarModal()
|
Protected Sub MostrarModal()
|
||||||
TxtDescripcion.Text = ""
|
TxtDescripcion.Text = ""
|
||||||
TxtFechaSalida.Text = ""
|
TxtFechaSalida.Text = ""
|
||||||
@@ -43,6 +48,8 @@ Partial Class ListadoContratos
|
|||||||
TxtUbicacion.Text = ""
|
TxtUbicacion.Text = ""
|
||||||
DdlTransporte.SelectedValue = ""
|
DdlTransporte.SelectedValue = ""
|
||||||
BtnGuardar.Text = "Guardar"
|
BtnGuardar.Text = "Guardar"
|
||||||
|
myModalLabel.InnerHtml = "Agregar Contrato"
|
||||||
|
|
||||||
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
|
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub LBAgregarContrato_Click(sender As Object, e As EventArgs) Handles LBAgregarContrato.Click
|
Private Sub LBAgregarContrato_Click(sender As Object, e As EventArgs) Handles LBAgregarContrato.Click
|
||||||
@@ -63,17 +70,31 @@ Partial Class ListadoContratos
|
|||||||
Dim CveEstatusInicial As Integer = 10
|
Dim CveEstatusInicial As Integer = 10
|
||||||
Dim CveContratoHijo As Integer = -1
|
Dim CveContratoHijo As Integer = -1
|
||||||
Dim CveContratoTipo As Integer = 2
|
Dim CveContratoTipo As Integer = 2
|
||||||
|
Dim retorno As Boolean = False
|
||||||
|
|
||||||
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
||||||
CveEstatusInicial = ObjContratos.DtResultados.FiltroPrimeroValor("CveContratoEstatus", "TipoEstatus=1").ToEntero
|
CveEstatusInicial = ObjContratos.DtResultados.FiltroPrimeroValor("CveContratoEstatus", "TipoEstatus=1").ToEntero
|
||||||
End If
|
End If
|
||||||
|
'Agregar contrato
|
||||||
|
If BtnGuardar.Text = "Guardar" Then
|
||||||
CveContratoHijo = 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, -1, -1, -1, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=1, CveTipoAF:=DdlTransporte.SelectedValue.ToEntero)
|
CveContratoHijo = 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, -1, -1, -1, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=1, CveTipoAF:=DdlTransporte.SelectedValue.ToEntero)
|
||||||
|
End If
|
||||||
|
|
||||||
If CveContratoHijo > 0 Then
|
If CveContratoHijo > 0 Then
|
||||||
ObjContratos.Commit()
|
ObjContratos.Commit()
|
||||||
Alert("Agregado Correctamente.")
|
Alert("Agregado Correctamente.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Actualizar contrato
|
||||||
|
If BtnGuardar.Text = "Editar" Then
|
||||||
|
retorno = 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, -1, -1, -1, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=1)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If retorno Then
|
||||||
|
ObjContratos.Commit()
|
||||||
|
Alert("Actualizado Correctamente.")
|
||||||
|
End If
|
||||||
|
|
||||||
TxtDescripcion.Text = ""
|
TxtDescripcion.Text = ""
|
||||||
TxtFechaSalida.Text = ""
|
TxtFechaSalida.Text = ""
|
||||||
TxtFechaRegreso.Text = ""
|
TxtFechaRegreso.Text = ""
|
||||||
@@ -81,9 +102,7 @@ Partial Class ListadoContratos
|
|||||||
TxtUbicacion.Text = ""
|
TxtUbicacion.Text = ""
|
||||||
DdlClientes.SelectedValue = ""
|
DdlClientes.SelectedValue = ""
|
||||||
DdlTransporte.SelectedValue = ""
|
DdlTransporte.SelectedValue = ""
|
||||||
|
BtnGuardar.Text = "Guardar"
|
||||||
End If
|
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Alert($"Ocurrió un error {ex}", TipoMensaje.MsgError)
|
Alert($"Ocurrió un error {ex}", TipoMensaje.MsgError)
|
||||||
ObjContratos.RollBack()
|
ObjContratos.RollBack()
|
||||||
@@ -94,7 +113,6 @@ Partial Class ListadoContratos
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
@@ -102,6 +120,7 @@ Partial Class ListadoContratos
|
|||||||
Dim fechaInicial As DateTime
|
Dim fechaInicial As DateTime
|
||||||
Dim fechaFinal As DateTime
|
Dim fechaFinal As DateTime
|
||||||
|
|
||||||
|
CveContrato = GvRow.DataKey("CveContrato").ToEntero
|
||||||
DdlClientes.SelectedValue = GvRow.DataKey("CveCliente")
|
DdlClientes.SelectedValue = GvRow.DataKey("CveCliente")
|
||||||
TxtDescripcion.Text = GvRow.DataKey("DescripcionContrato")
|
TxtDescripcion.Text = GvRow.DataKey("DescripcionContrato")
|
||||||
TxtObservaciones.Text = GvRow.DataKey("DescripcionContrato")
|
TxtObservaciones.Text = GvRow.DataKey("DescripcionContrato")
|
||||||
@@ -112,12 +131,10 @@ Partial Class ListadoContratos
|
|||||||
TxtFechaRegreso.Text = fechaFinal.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
TxtFechaRegreso.Text = fechaFinal.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
BtnGuardar.Text = "Editar"
|
BtnGuardar.Text = "Editar"
|
||||||
|
myModalLabel.InnerHtml = "Editar Contrato"
|
||||||
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
|
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub RemoveContrato(sender As Object, e As EventArgs)
|
Protected Sub RemoveContrato(sender As Object, e As EventArgs)
|
||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
|
|||||||
Reference in New Issue
Block a user