Transportes Mejoras
This commit is contained in:
@@ -21,6 +21,10 @@
|
||||
#C_Tab_ctl00_DdlClientes{
|
||||
width:100%!important;
|
||||
}*/
|
||||
|
||||
.font-light {
|
||||
color:#666666;
|
||||
}
|
||||
.mx-1 {
|
||||
margin: 0 5px 0 5px;
|
||||
}
|
||||
@@ -127,12 +131,7 @@
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4 bold text-primary">Folio</label>
|
||||
<asp:TextBox class="col-md-2" runat="server" ID="TxtFolio" Text="" MaxLength="50" style="margin-left:15px" Width="120px" Height="34px"></asp:TextBox>
|
||||
<div class="col-md-2">
|
||||
<asp:HyperLink runat="server" Text="" Target="_blank" id="HypRemision" CssClass="Texto"></asp:HyperLink>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label runat="server" ID="LblSaldo"></asp:Label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row " style="border:0px!important">
|
||||
@@ -358,61 +357,211 @@
|
||||
</div>
|
||||
<%-- Contrato Digitalizado --%>
|
||||
<div class="col-md-5">
|
||||
<div class="portlet light bordered xspadding">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand1" class=" collapse" data-original-title=""
|
||||
title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand1" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
<i class="fa fa-file-pdf-o"></i>Contrato Digitalizado
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:UpdatePanel ID="UPAFUL" runat="server" UpdateMode="Conditional">
|
||||
<div class="portlet light bordered xspadding">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand1" class=" collapse" data-original-title=""
|
||||
title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand3" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
<i class="fa fa-money"></i>Pagos
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="BtnDescargar" class="btn btn-warning" Visible="false"><i class='fa fa-download' aria-hidden='true'></i> Descargar</asp:LinkButton>
|
||||
<asp:TextBox Style="display: none" ID="TxtArchivo" ClientIDMode="Static" runat="server"
|
||||
Width="200px"></asp:TextBox>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:UpdatePanel ID="UpPagos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<button type="button" class="btn btn-primary" runat="server" clientidmode="Static"
|
||||
id="Button1" data-toggle="modal" data-target="#ModalUpload" visible="true">
|
||||
<i class="fa fa-upload"
|
||||
aria-hidden="true"></i>Subir Archivo</button>
|
||||
<div class="row" runat="server" visible="false" id="DVFactura">
|
||||
<label class="col-md-2">Factura: </label>
|
||||
<div class="col-md-2">
|
||||
<asp:HyperLink runat="server" Text="" Target="_blank" id="HypRemision" CssClass="Texto"></asp:HyperLink>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label runat="server" ID="LblSaldo"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GVAuxiliar" runat="server" AutoGenerateColumns="False" ShowFooter="true"
|
||||
DataKeyNames="CvePrePoliza, Cargo, Abono, CveReferencia, IdPoliza,CvePrePolizaOriginal,TipoReferencia"
|
||||
EmptyDataText="No se encontraron pagos" ToolTip="Listado de Auxiliar Contable" CssClass="table table-striped table-advance table-hover mysmallbtn Widthall" GridLines="None"
|
||||
OnRowDataBound="GVAuxiliar_RowDataBound" >
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Folio</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplReferencia" runat="server" Text='<%# Eval("Referencia", "{0}") %>' Target="_blank"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaMovto" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="LbltotalText" runat="server" Text=""></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>Pago</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCargo" runat="server" Text='<%# If(CDbl(Eval("Abono")) = 0, "", Eval("Abono", "{0:N2}")) %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="Lbltotal" runat="server" Text=""></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnDescargar" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="portlet light bordered xspadding">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand1" class=" collapse" data-original-title=""
|
||||
title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand1" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
<i class="fa fa-file-pdf-o"></i>Contrato Digitalizado
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:UpdatePanel ID="UPAFUL" runat="server" UpdateMode="Conditional">
|
||||
|
||||
<ContentTemplate>
|
||||
<asp:HyperLink target="_blank" runat="server" ID="BtnDescargar" class="btn btn-warning" Visible="false"><i class='fa fa-download' aria-hidden='true'></i> Descargar</asp:HyperLink>
|
||||
<asp:TextBox Style="display: none" ID="TxtArchivo" ClientIDMode="Static" runat="server"
|
||||
Width="200px"></asp:TextBox>
|
||||
|
||||
<button type="button" class="btn btn-primary" runat="server" clientidmode="Static"
|
||||
id="Button1" data-toggle="modal" data-target="#ModalUpload" visible="true">
|
||||
<i class="fa fa-upload"
|
||||
aria-hidden="true"></i>Subir Archivo</button>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<%-- Bitácora --%>
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light bordered xspadding">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand" class=" collapse" data-original-title=""
|
||||
title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand2" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
|
||||
<%--<div class="caption uppercase" style="position: relative;">
|
||||
<i class="fa fa-commenting"></i>Bitácora
|
||||
</div>
|
||||
|
||||
<div class="btn-group">
|
||||
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold font-green" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
|
||||
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold font-green" runat="server" Text=" <i class='fa fa-calendar-plus-o font-green' ></i>Agendar" Visible="false" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Agendar"></asp:HyperLink><br />
|
||||
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
|
||||
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
|
||||
</div>--%>
|
||||
<div class="caption font-default">
|
||||
<%--<i class="fa fa-users font-green"></i>--%>
|
||||
<span class="caption-subject bold uppercase">Bitacora</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold font-light " data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-light ' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important; cursor: pointer" ToolTip="Observaciones"></asp:HyperLink><br />
|
||||
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold font-light " runat="server" Text="" Visible="false" Style="font-weight: 700 !important; cursor: pointer" ToolTip="Agendar"><i class='fa fa-calendar-plus-o font-light ' ></i>Agendar</asp:HyperLink><br />
|
||||
|
||||
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
|
||||
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
|
||||
<%--<script> function OnAddedTareaNueva() { $('.btnupEventoBitacora').click(); }</script>--%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<asp:UpdatePanel ID="UPEventoBitacora" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvEventosBitacora" runat="server" AutoGenerateColumns="True"
|
||||
GridLines="None">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvEB" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEvento" EmptyDataText="No se han capturado comentarios o bitácora" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha Agenda</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaAgenda" runat="server" Text='<%# Eval("FechaInicio") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Usuario</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Descripción</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEventoBitacora" runat="server" Text='<%# Eval("Descripcion") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="10px" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Archivo</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LinkArchivo" Visible="false" runat="server" CssClass="Texto" OnClick="DownloadFile">
|
||||
<asp:Image ImageUrl="/Imagenes/Abajo.png" ID="ImgArchivo" runat="server" />
|
||||
</asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<RowStyle CssClass="Texto" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -1036,4 +1185,48 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="ModalBitacora" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Bitácora</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<label>Bitácora/Observaciones</label>
|
||||
<br />
|
||||
<asp:TextBox CssClass="form-control" ID="TxtEventoDescripcion" class="Widthall" runat="server" TextMode="MultiLine" Columns="60" Rows="8"></asp:TextBox>
|
||||
<br />
|
||||
<%-- <asp:CheckBox ID="ChkEventoPrioridad" CssClass="md-checksd2" Text="Bitácora de Atención" runat="server" />--%>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:TextBox ID="AnexoBit" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<%--<div>
|
||||
|
||||
</div>--%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnGuardarEventoBitacora" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
||||
@@ -201,6 +201,22 @@ Partial Class RepContratoDetalle
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property TotalPagos As Decimal
|
||||
Get
|
||||
If ViewState("TotalPagos") Is Nothing Then
|
||||
ViewState("TotalPagos") = 0
|
||||
End If
|
||||
|
||||
Return ViewState("TotalPagos").ToString.ToDecimal
|
||||
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("TotalPagos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -209,20 +225,42 @@ Partial Class RepContratoDetalle
|
||||
|
||||
#Region "Carga Página"
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
|
||||
|
||||
If Request("CveContrato") Is Nothing Then
|
||||
Response.Redirect($"~/Transportes/RepContratos.aspx")
|
||||
End If
|
||||
|
||||
CveContrato = Request("CveContrato").ToEntero
|
||||
|
||||
If Not IsPostBack Then
|
||||
|
||||
InicializaCombos()
|
||||
CargaDatos()
|
||||
CargaAuxiliarClienteCxC(DdlClientes.SelectedValue.ToEntero, CveVentaRemision)
|
||||
AsientoSeleccionado = ""
|
||||
CveViajePasajero = 0
|
||||
Session("FileExtension") = ""
|
||||
ArchivoUpdate = ""
|
||||
CargaGvBitacora()
|
||||
|
||||
If CveContrato > 0 Then
|
||||
HlEvento.Visible = True
|
||||
HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveContrato=" & CveContrato & "&TB_iframe=true&height=370&width=600;"
|
||||
ImgAddObs.Visible = True
|
||||
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-light"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveContrato:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveContrato)
|
||||
CargaEventoBitacora()
|
||||
End If
|
||||
|
||||
If CveVentaRemision > 0 Then
|
||||
DVFactura.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub InicializaCombos()
|
||||
'Lista Tipo AF
|
||||
@@ -297,6 +335,14 @@ Partial Class RepContratoDetalle
|
||||
If Not IsDBNull(ObjContratos.Archivo) AndAlso ObjContratos.Archivo <> "" AndAlso ObjContratos.Archivo <> "-1" AndAlso ObjContratos.Archivo <> $"{ObjContratos.CveContrato}." Then
|
||||
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "CONTRATOS", ObjContratos.Archivo)
|
||||
BtnDescargar.Visible = True
|
||||
|
||||
Dim File As New FileInfo(ViewState("FUrl").ToString)
|
||||
BtnDescargar.NavigateUrl = $"~/Compras/PopUpVerFactura.aspx?ArchivoContrato={Encripta(File.FullName)}"
|
||||
'If File.Exists Then
|
||||
' RegistraScript($"window.open({Url}, ""_blank"");")
|
||||
'End If
|
||||
|
||||
|
||||
Else
|
||||
BtnDescargar.Visible = False
|
||||
A1.Visible = True
|
||||
@@ -313,13 +359,13 @@ Partial Class RepContratoDetalle
|
||||
ObjTransportes.Dispose()
|
||||
GvViajesPasajeros.DataBind()
|
||||
End If
|
||||
'Bitácora
|
||||
Dim ObjEventoBitacora As New ClsOIEventos
|
||||
If ObjEventoBitacora.GetEventos(-1, -1, -1, "-1", "-1", -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
|
||||
GvEventosBitacora.DataSource = ObjEventoBitacora.DtResultados
|
||||
GvEventosBitacora.DataBind()
|
||||
End If
|
||||
ObjEventoBitacora.Dispose()
|
||||
''Bitácora
|
||||
'Dim ObjEventoBitacora As New ClsOIEventos
|
||||
'If ObjEventoBitacora.GetEventos(-1, -1, -1, "-1", "-1", -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
|
||||
' GvEB.DataSource = ObjEventoBitacora.DtResultados
|
||||
' GvEB.DataBind()
|
||||
'End If
|
||||
'ObjEventoBitacora.Dispose()
|
||||
|
||||
End If
|
||||
Else
|
||||
@@ -332,8 +378,113 @@ Partial Class RepContratoDetalle
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Bitacora"
|
||||
Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(200)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(200)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(500)
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("Archivo").ToString <> "" Then
|
||||
e.Row.FCLinkButton("LinkArchivo").Visible = True
|
||||
e.Row.FCLinkButton("LinkArchivo").CommandArgument = String.Format("OI\{0}", e.Row.DBCampo("Archivo").ToString)
|
||||
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LinkArchivo")) 'Registro un evento Postbacktrigger, que recargue toda la pagina para que funcione
|
||||
End If
|
||||
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnGuardarEventoBitacora_Click(sender As Object, e As EventArgs) Handles BtnGuardarEventoBitacora.Click
|
||||
Dim ObjEventoBitacora As New ClsOIEventos
|
||||
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim Filesgral As List(Of Archivo) = AnexoBit.getfiles().Archivos
|
||||
Dim Filename As String = ""
|
||||
For Each fileItem As Archivo In Filesgral
|
||||
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||
Filename = fileItem.filename
|
||||
Next
|
||||
|
||||
|
||||
|
||||
If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
|
||||
If Filename <> "" Then
|
||||
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
|
||||
End If
|
||||
|
||||
GvEB.DataSource = ObjEventoBitacora.DtResultados
|
||||
TxtEventoDescripcion.Text = ""
|
||||
AnexoBit.Text = "[]"
|
||||
Alert("La bitácora/observación se guardó correctamente", TipoMensaje.MsgInformacion)
|
||||
RegistraScript("$('#ModalBitacora').modal('hide')", "hidemodal")
|
||||
|
||||
End If
|
||||
ObjEventoBitacora.Dispose()
|
||||
GvEB.DataBind()
|
||||
|
||||
UPEventoBitacora.Update()
|
||||
CargaEventoBitacora()
|
||||
UPAddEventoBitacora.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaEventoBitacora()
|
||||
|
||||
If CveContrato > 0 Then
|
||||
Dim ObjEventoBitacora As New ClsOIEventos()
|
||||
If ObjEventoBitacora.GetAgendaBitacora(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
|
||||
GvEB.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento = 6 OR CveTipoEvento = 2")
|
||||
Else
|
||||
GvEB.DataSource = Nothing
|
||||
End If
|
||||
ObjEventoBitacora.Dispose()
|
||||
GvEB.DataBind()
|
||||
UPEventoBitacora.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
'Protected Sub CargarArchivo(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AFU.UploadedComplete
|
||||
' If AFU.HasFile Then
|
||||
|
||||
|
||||
' Dim UploadFolder As String = String.Format("{0}\Temp\", UsuarioActual.Empresa.Ruta)
|
||||
' UploadFolder.DirectoryExistsCreate()
|
||||
' Dim Extension As String = System.IO.Path.GetExtension(AFU.PostedFile.FileName)
|
||||
|
||||
' If File.Exists(String.Format("{0}{1}{2}", UploadFolder, UsuarioActual.CveUsuario.ToString, Extension)) Then File.Delete(String.Format("{0}{1}{2}", UploadFolder, UsuarioActual.CveUsuario.ToString, Extension))
|
||||
|
||||
' AFU.SaveAs(UploadFolder & UsuarioActual.CveUsuario.ToString & Extension)
|
||||
' Session("FileUpload") = UploadFolder & UsuarioActual.CveUsuario.ToString & Extension
|
||||
' Session("FileExtension") = Extension
|
||||
' Session("FileFolder") = UploadFolder
|
||||
' End If
|
||||
'End Sub
|
||||
Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument)
|
||||
Dim Archivo As New System.IO.FileInfo(filePath)
|
||||
|
||||
HttpContext.Current.Response.Clear()
|
||||
HttpContext.Current.Response.ClearContent()
|
||||
HttpContext.Current.Response.ContentType = "application/octet-stream"
|
||||
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + Path.GetFileName(filePath))
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
HttpContext.Current.Response.TransmitFile(filePath)
|
||||
HttpContext.Current.Response.Flush()
|
||||
HttpContext.Current.Response.End()
|
||||
|
||||
Archivo = Nothing
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "Información General"
|
||||
Protected Sub BtnGuardarArchivo_Click1(sender As Object, e As EventArgs) Handles BtnGuardarArchivo.Click
|
||||
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim Filesgral As List(Of Extensiones.Archivo) = Anexo.getfiles().Archivos
|
||||
Dim Filename As String = ""
|
||||
@@ -375,32 +526,61 @@ Partial Class RepContratoDetalle
|
||||
BtnDescargar.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
Private Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
|
||||
DescargarArchivo()
|
||||
End Sub
|
||||
Private Sub DescargarArchivo()
|
||||
Dim File As New FileInfo(ViewState("FUrl").ToString)
|
||||
'Private Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
|
||||
' Dim File As New FileInfo(ViewState("FUrl").ToString)
|
||||
' Dim Url As String = $"{ObtenerUrlCompleta()}Compras/PopUpVerFactura.aspx?ArchivoContrato={Encripta(File.FullName)}"
|
||||
' If File.Exists Then
|
||||
' RegistraScript($"window.open({Url}, ""_blank"");")
|
||||
' End If
|
||||
|
||||
If File.Exists Then 'set appropriate headers
|
||||
Response.Clear()
|
||||
Response.ClearHeaders()
|
||||
Response.ClearContent()
|
||||
Response.AddHeader("Content-Disposition", "attachment; filename=" & TxtFolio.Text & $"{File.Extension}")
|
||||
Response.AddHeader("Content-Length", File.Length.ToString())
|
||||
'Response.ContentType = "text/plain"
|
||||
Response.ContentType = "application/octet-stream"
|
||||
Response.Flush()
|
||||
' Response.TransmitFile(File.FullName)
|
||||
Response.WriteFile(File.FullName)
|
||||
Response.End()
|
||||
'if file does not exist
|
||||
|
||||
Alert("Descargado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
|
||||
'End Sub
|
||||
|
||||
Public Function ObtenerUrlCompleta() As String
|
||||
|
||||
Dim Solicitud As HttpRequest = HttpContext.Current.Request
|
||||
Dim url As String = Solicitud.Url.Scheme & "://" & Solicitud.Url.Host
|
||||
|
||||
If (Solicitud.Url.Port <> 80 AndAlso Solicitud.Url.Port <> 443) Then
|
||||
url &= ":" & Solicitud.Url.Port
|
||||
End If
|
||||
|
||||
|
||||
url &= Solicitud.ApplicationPath
|
||||
|
||||
If Not url.EndsWith("/") Then
|
||||
url &= "/"
|
||||
End If
|
||||
|
||||
Return url
|
||||
|
||||
End Function
|
||||
'Private Sub DescargaArchivo(urlArchivo As String)
|
||||
|
||||
' Dim File As New FileInfo(urlArchivo)
|
||||
|
||||
' If File.Exists Then 'set appropriate headers
|
||||
|
||||
' Response.Clear()
|
||||
' Response.ClearHeaders()
|
||||
' Response.ClearContent()
|
||||
' Response.AddHeader("Content-Disposition", "inline; filename=" & TxtFolio.Text & $"{File.Extension}")
|
||||
' Response.AddHeader("Content-Length", File.Length.ToString())
|
||||
' 'Response.ContentType = "text/plain"
|
||||
' Response.ContentType = "application/octet-stream"
|
||||
' Response.Flush()
|
||||
' ' Response.TransmitFile(File.FullName)
|
||||
' Response.WriteFile(File.FullName)
|
||||
' Response.End()
|
||||
|
||||
' Else
|
||||
|
||||
' Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
|
||||
|
||||
' End If
|
||||
|
||||
'End Sub
|
||||
|
||||
End If 'nothing in the URL as HTTP GET
|
||||
End Sub
|
||||
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
||||
Dim ArchivoUpdate As String = "-1"
|
||||
Dim ErrorProceso As Boolean = False
|
||||
@@ -886,6 +1066,52 @@ Partial Class RepContratoDetalle
|
||||
GvBitacora.DataBind()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "PAGOS"
|
||||
Private Sub CargaAuxiliarClienteCxC(CveCliente As Integer, CveRemision As Integer)
|
||||
|
||||
If CveRemision > 0 Then
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
|
||||
If ObjMovtos.GetCxCClienteAuxiliar(CveCliente, CveRemision) Then
|
||||
|
||||
Dim dtTemp As New DataTable
|
||||
dtTemp = ObjMovtos.DtResultados.FiltraParametros(" Conceptocontable = 'Pago del Cliente' ")
|
||||
TotalPagos = dtTemp.SUM("Abono")
|
||||
GVAuxiliar.DataSource = dtTemp
|
||||
|
||||
Else
|
||||
GVAuxiliar.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjMovtos.Dispose()
|
||||
GVAuxiliar.DataBind()
|
||||
UpPagos.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GVAuxiliar_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DataKey("TipoReferencia").ToEntero = 1 Then
|
||||
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Bancos/IE.aspx?CveIE={e.Row.DataKey("CveReferencia").ToEntero}"
|
||||
End If
|
||||
End If
|
||||
If e.Row.RowType = DataControlRowType.Footer Then
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(1).Text = "Total"
|
||||
e.Row.FCLabel("Lbltotal").Text = TotalPagos.ToString("###,###,###.00")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -392,9 +392,10 @@
|
||||
<div class="col-md-8">
|
||||
<div class="input-group">
|
||||
|
||||
<asp:TextBox ID="TxtCantidadPasajeros" runat="server" CssClass="form-control" CausesValidation="True"
|
||||
<asp:TextBox ID="TxtCantidadPasajeros" runat="server" CssClass="form-control" CausesValidation="True"
|
||||
Width="100%"
|
||||
type="number" MaxLength="2" ></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtCantidadPasajeros" FilterType="Custom" ValidChars="1234567890" />
|
||||
<asp:RequiredFieldValidator ID="RFVCantidadPasajeros" runat="server" ControlToValidate="TxtCantidadPasajeros"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad de pasajeros''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
|
||||
@@ -102,6 +102,10 @@ Partial Class ListadoContratos
|
||||
End Sub
|
||||
Protected Sub AddContrato(sender As Object, e As EventArgs)
|
||||
|
||||
If Not VallidaCantidadPasajeros(DdlTipoAF.SelectedValue.ToEntero, TxtCantidadPasajeros.Text.ToEntero) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ErrorProceso As Boolean = False
|
||||
Dim CveContrato As Integer = -1
|
||||
|
||||
@@ -221,6 +225,22 @@ Partial Class ListadoContratos
|
||||
RegistraScript("$('#ModalAgregar').modal('hide')", "hidemodal1")
|
||||
End Sub
|
||||
|
||||
Private Function VallidaCantidadPasajeros(CveTipoAF As Integer, Cantidad As Integer) As Boolean
|
||||
|
||||
Dim Respuesta As Boolean = True
|
||||
|
||||
If CveTipoAF = 181 And Cantidad < 30 Then 'autobus
|
||||
Respuesta = False
|
||||
Alert("El tipo unidad autobus debe de tener un minimo de 30 pasajeros.", TipoMensaje.MsgAdvertencia)
|
||||
ElseIf CveTipoAF = 184 And Cantidad > 21 Then 'sprinter
|
||||
Respuesta = False
|
||||
Alert("El tipo de unidad sprinter no puede tener más de 21 pasajeros.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
Protected Sub ResetModal()
|
||||
'Reiniciamos modal
|
||||
TxtDescripcion.Text = ""
|
||||
|
||||
Reference in New Issue
Block a user