--
This commit is contained in:
@@ -7,76 +7,76 @@
|
|||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
<asp:Content ID="Content4" ContentPlaceHolderID="Css" runat="Server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="Css" runat="Server">
|
||||||
<style>
|
<style>
|
||||||
.my-1 {
|
.my-1 {
|
||||||
margin-block: 1rem;
|
margin-block: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx-1 {
|
.mx-1 {
|
||||||
margin: 0 2rem;
|
margin: 0 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.disponible {
|
.disponible {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 45px;
|
width: 45px;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
border: 2px solid #45b6af;
|
border: 2px solid #45b6af;
|
||||||
border-radius: 10px !important;
|
border-radius: 10px !important;
|
||||||
margin: .1px;
|
margin: .1px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #45b6af;
|
color: #45b6af;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.disponible:hover, .disponible.activo {
|
.disponible:hover, .disponible.activo {
|
||||||
background-color: #45b6af;
|
background-color: #45b6af;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodisponible {
|
.nodisponible {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 45px;
|
width: 45px;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
background-color: #F3565D;
|
background-color: #F3565D;
|
||||||
border-radius: 10px !important;
|
border-radius: 10px !important;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: white;
|
color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nodisponible:hover {
|
.nodisponible:hover {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.seleccionado {
|
.seleccionado {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 45px;
|
width: 45px;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
background-color: #ff6a00;
|
background-color: #ff6a00;
|
||||||
border-radius: 10px !important;
|
border-radius: 10px !important;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: white;
|
color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnChofer {
|
.btnChofer {
|
||||||
width: 45px;
|
width: 45px;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: black
|
color: black
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnChofer a {
|
.btnChofer a {
|
||||||
color: #2C3E50;
|
color: #2C3E50;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.btnChofer:hover {
|
.btnChofer:hover {
|
||||||
background-color: #E1E5EC;
|
background-color: #E1E5EC;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
@@ -85,74 +85,6 @@
|
|||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<%-- Datos de cliente y su viaje --%>
|
<%-- Datos de cliente y su viaje --%>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="portlet light xspadding bordered ">
|
|
||||||
<div class="portlet-title">
|
|
||||||
<div class="caption font-yellow">
|
|
||||||
<i class=" fa fa-bus font-yellow"></i>
|
|
||||||
<span class="caption-subject bold uppercase">Datos del Viaje</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="portlet-body form">
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
|
||||||
<asp:TextBox ID="TxtRuta" runat="server" Width="100%" Enabled="false" CssClass="form-control"></asp:TextBox>
|
|
||||||
<label for="<%= TxtRuta.ClientID.ToString()%>">Ruta:</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
|
||||||
|
|
||||||
<asp:DropDownList ID="DdlPartida" DataTextField="Destino"
|
|
||||||
AutoPostBack="true"
|
|
||||||
DataValueField="CveDestino" Class="form-control input-sm select2me" Width="200px" runat="server">
|
|
||||||
</asp:DropDownList>
|
|
||||||
<asp:RequiredFieldValidator ID="RFVPartida" runat="server" ControlToValidate="DdlPartida"
|
|
||||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Partida''</b> es necesario, por favor ingréselo."
|
|
||||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
|
||||||
<label for="<%= DdlPartida.ClientID.ToString()%>">Partida:</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
|
||||||
<asp:TextBox ID="TxtFecha" runat="server" Width="100%" Enabled="false" CssClass="form-control"></asp:TextBox>
|
|
||||||
<label for="<%= TxtFecha.ClientID.ToString()%>">Fecha:</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
|
||||||
<asp:DropDownList ID="DdlDestino" DataTextField="Destino"
|
|
||||||
AutoPostBack="true"
|
|
||||||
DataValueField="CveDestino" Class="form-control input-sm select2me"
|
|
||||||
Width="200px" runat="server">
|
|
||||||
</asp:DropDownList>
|
|
||||||
<asp:RequiredFieldValidator ID="RFVDestino" runat="server" ControlToValidate="DdlDestino"
|
|
||||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Destino''</b> es necesario, por favor ingréselo."
|
|
||||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
|
||||||
<label for="<%= DdlDestino.ClientID.ToString()%>">Destino:</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<asp:Label runat="server" ID="TxtCosto" CssClass="text-success bold mx-1"></asp:Label>
|
|
||||||
<br />
|
|
||||||
<div class="text-center">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="portlet light xspadding bordered">
|
<div class="portlet light xspadding bordered">
|
||||||
@@ -216,14 +148,81 @@
|
|||||||
<label>Observaciones:</label>
|
<label>Observaciones:</label>
|
||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group form-md-line-input input-iconright ">
|
|
||||||
<asp:Button ID="BtnAgregar" runat="server" Text="Agregar Pasajero" CssClass="btn btn-success " OnClick="BtnAgregar_Click" />
|
|
||||||
<i></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="portlet light xspadding bordered ">
|
||||||
|
<div class="portlet-title">
|
||||||
|
<div class="caption font-yellow">
|
||||||
|
<i class=" fa fa-bus font-yellow"></i>
|
||||||
|
<span class="caption-subject bold uppercase">Datos del Viaje</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body form">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:TextBox ID="TxtRuta" runat="server" Width="100%" Enabled="false" CssClass="form-control"></asp:TextBox>
|
||||||
|
<label for="<%= TxtRuta.ClientID.ToString()%>">Ruta:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
|
||||||
|
<asp:DropDownList ID="DdlPartida" DataTextField="Destino"
|
||||||
|
AutoPostBack="true"
|
||||||
|
DataValueField="CveDestino" Class="form-control input-sm select2me" Width="200px" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVPartida" runat="server" ControlToValidate="DdlPartida"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Partida''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= DdlPartida.ClientID.ToString()%>">Partida:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:TextBox ID="TxtFecha" runat="server" Width="100%" Enabled="false" CssClass="form-control"></asp:TextBox>
|
||||||
|
<label for="<%= TxtFecha.ClientID.ToString()%>">Fecha:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlDestino" DataTextField="Destino"
|
||||||
|
AutoPostBack="true"
|
||||||
|
DataValueField="CveDestino" Class="form-control input-sm select2me"
|
||||||
|
Width="200px" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVDestino" runat="server" ControlToValidate="DdlDestino"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Destino''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= DdlDestino.ClientID.ToString()%>">Destino:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<asp:Label runat="server" ID="LbCostos" CssClass="text-success bold mx-1" Visible="False"></asp:Label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright ">
|
||||||
|
<asp:Button ID="BtnAgregarPasajero" runat="server" CssClass="btn btn-success" Visible="false" Text="Agregar Pasajeros" OnClick="AgregarPasajero"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<asp:GridView ID="GvB" runat="server" Width="100%" AutoGenerateColumns="false" CssClass="table table-advance table-hover" GridLines="None" DataKeyNames="Nombre,Visa,Asiento">
|
<asp:GridView ID="GvB" runat="server" Width="100%" AutoGenerateColumns="false" CssClass="table table-advance table-hover" GridLines="None" DataKeyNames="Nombre,Visa,Asiento">
|
||||||
@@ -236,10 +235,11 @@
|
|||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<%--OnClick="FinalizarVenta"--%>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<asp:Button ID="BtnGuardar" Visible="False" OnClick="FinalizarVenta" runat="server" CssClass="btn btn-success "
|
<asp:Button ID="BtnGuardar" Visible="False" runat="server" CssClass="btn btn-success "
|
||||||
Text="Finalizar Compra"
|
Text="Finalizar Compra"
|
||||||
ValidationGroup="GrpGuardar"></asp:Button>
|
ValidationGroup="GrpGuardar"></asp:Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,378 +1,381 @@
|
|||||||
Option Explicit On
|
Option Explicit On
|
||||||
Option Strict On
|
Option Strict On
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports Extensiones.ModExtensiones
|
Imports Extensiones.ModExtensiones
|
||||||
Imports Microsoft.Ajax.Utilities
|
|
||||||
|
Partial Class Boletos
|
||||||
Partial Class Boletos
|
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
#Region "Propiedades"
|
#Region "Propiedades"
|
||||||
Private Property AsientoSeleccionado As String
|
Private Property AsientoSeleccionado As String
|
||||||
Get
|
Get
|
||||||
Return ViewState("AsientoSeleccionado").ToString()
|
Return ViewState("AsientoSeleccionado").ToString()
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
ViewState("AsientoSeleccionado") = value
|
ViewState("AsientoSeleccionado") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Private Property Importe As Decimal
|
Private Property Importe As Decimal
|
||||||
Get
|
Get
|
||||||
Return If(IsNothing(ViewState("Importe")), 0, ViewState("Importe")).ToString().ToDecimal()
|
Return If(IsNothing(ViewState("Importe")), 0, ViewState("Importe")).ToString().ToDecimal()
|
||||||
End Get
|
End Get
|
||||||
Set(value As Decimal)
|
Set(value As Decimal)
|
||||||
ViewState("Importe") = value
|
ViewState("Importe") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Private Property CveViaje As Integer
|
Private Property CveViaje As Integer
|
||||||
Get
|
Get
|
||||||
Return ViewState("CveViaje").ToString().ToEntero
|
Return ViewState("CveViaje").ToString().ToEntero
|
||||||
End Get
|
End Get
|
||||||
Set(value As Integer)
|
Set(value As Integer)
|
||||||
ViewState("CveViaje") = value
|
ViewState("CveViaje") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Property Contrato As DataTable
|
Private Property Contrato As DataTable
|
||||||
Get
|
Get
|
||||||
Return CType(ViewState("Contrato"), DataTable)
|
Return CType(ViewState("Contrato"), DataTable)
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
ViewState("Contrato") = value
|
ViewState("Contrato") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Private Property DtPasajeros As DataTable
|
Private Property DtPasajeros As DataTable
|
||||||
Get
|
Get
|
||||||
Return CType(ViewState("DtPasajeros"), DataTable)
|
Return CType(ViewState("DtPasajeros"), DataTable)
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
ViewState("DtPasajeros") = value
|
ViewState("DtPasajeros") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
If Request.QueryString("CveViaje") Is Nothing Then
|
If Request.QueryString("CveViaje") Is Nothing Then
|
||||||
Response.Redirect("/Transportes/RepViajes.aspx")
|
Response.Redirect("/Transportes/RepViajes.aspx")
|
||||||
End If
|
|
||||||
AsientoSeleccionado = ""
|
|
||||||
CveViaje = Request.QueryString("CveViaje").ToEntero
|
|
||||||
If CveViaje > 0 Then
|
|
||||||
CargaDatos()
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub CargaDatos()
|
|
||||||
Dim ObjContratos As New ClsContratos
|
|
||||||
Dim ObjViaje As New ClsTransportes
|
|
||||||
|
|
||||||
If ObjContratos.GetContratos(CveViaje, UsuarioActual.CveEmpresa) Then
|
|
||||||
Contrato = ObjContratos.DtResultados
|
|
||||||
If ObjContratos.DtResultados IsNot Nothing AndAlso ObjContratos.DtResultados.Rows.Count > 0 Then
|
|
||||||
TxtRuta.Text = Contrato.Rows(0)("Ruta").ToString
|
|
||||||
TxtFecha.Text = Contrato.Rows(0)("FechaInicial").ToString.ToDate.ToShortDateString
|
|
||||||
DtPasajeros = New DataTable
|
|
||||||
DtPasajeros.Columns.Add("Numero", GetType(Integer))
|
|
||||||
DtPasajeros.Columns.Add("Nombre", GetType(String))
|
|
||||||
DtPasajeros.Columns.Add("Visa", GetType(String))
|
|
||||||
DtPasajeros.Columns.Add("Asiento", GetType(String))
|
|
||||||
DtPasajeros.Columns.Add("Celular", GetType(String))
|
|
||||||
DtPasajeros.Columns.Add("Importe", GetType(Decimal))
|
|
||||||
DtPasajeros.Columns.Add("Observaciones", GetType(String))
|
|
||||||
|
|
||||||
InicializaCombos()
|
|
||||||
|
|
||||||
'Boletos Vendidos
|
|
||||||
Dim dt As DataTable
|
|
||||||
If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=1) Then 'Poner párametro para estatus y cancelado de viajes
|
|
||||||
dt = ObjViaje.DtResultados
|
|
||||||
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
|
|
||||||
For Each dr As DataRow In dt.Rows
|
|
||||||
Dim lnk As LinkButton = CType(cph.FindControl($"A{dr("Asiento")}"), LinkButton)
|
|
||||||
If lnk IsNot Nothing Then
|
|
||||||
lnk.Enabled = False
|
|
||||||
lnk.CssClass = "nodisponible"
|
|
||||||
lnk.ToolTip = dr("Nombre").ToString
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
|
||||||
ObjContratos.Dispose()
|
|
||||||
ObjViaje.Dispose()
|
|
||||||
|
|
||||||
Response.Redirect($"~/Transportes/RepContratos.aspx")
|
|
||||||
End If
|
|
||||||
|
|
||||||
ObjContratos.Dispose()
|
|
||||||
ObjViaje.Dispose()
|
|
||||||
|
|
||||||
'Boletos Vendidos
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Protected Sub InicializaCombos()
|
|
||||||
Dim CveRuta As Integer = Contrato.Rows(0)("CveRuta").ToString.ToEntero
|
|
||||||
|
|
||||||
'Lista Destinos''carga específicos
|
|
||||||
Dim ObjDestinos As New ClsTransportes()
|
|
||||||
If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then
|
|
||||||
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
|
||||||
|
|
||||||
DdlPartida.DataSource = ObjDestinos.DtResultados
|
|
||||||
DdlPartida.DataBind()
|
|
||||||
DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", "-1"))
|
|
||||||
|
|
||||||
DdlDestino.DataSource = ObjDestinos.DtResultados
|
|
||||||
DdlDestino.DataBind()
|
|
||||||
DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "-1"))
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
ObjDestinos.Dispose()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Protected Sub CotizarTarifa()
|
|
||||||
If DdlDestino.SelectedValue <> "" And DdlPartida.SelectedValue <> "" Then
|
|
||||||
Dim ImporteR As Decimal = 0
|
|
||||||
Dim ObjDestinos As New ClsTransportes()
|
|
||||||
If ObjDestinos.GetDestinosTarifas(DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero) Then
|
|
||||||
ImporteR = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL
|
|
||||||
End If
|
End If
|
||||||
ObjDestinos.Dispose()
|
AsientoSeleccionado = ""
|
||||||
|
CveViaje = Request.QueryString("CveViaje").ToEntero
|
||||||
If ImporteR > 0 Then
|
If CveViaje > 0 Then
|
||||||
ViewState("Importe") = ImporteR
|
|
||||||
TxtCosto.Text = $"El precio de su boleto es ${ImporteR.FormatoNumero}"
|
|
||||||
BtnGuardar.Visible = True
|
|
||||||
Else
|
|
||||||
Alert("No se encontro una tarifa para esta ruta", TipoMensaje.MsgAdvertencia)
|
|
||||||
|
|
||||||
TxtCosto.Text = ""
|
|
||||||
BtnGuardar.Visible = False
|
|
||||||
ViewState("Importe") = 0
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs)
|
|
||||||
'quitamos la selección anterior, en caso de existir.
|
|
||||||
If AsientoSeleccionado <> "" Then
|
|
||||||
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
|
|
||||||
Dim lnk As LinkButton = CType(cph.FindControl(AsientoSeleccionado), LinkButton)
|
|
||||||
lnk.CssClass = "disponible"
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim linkButton As LinkButton = DirectCast(sender, LinkButton)
|
|
||||||
Dim buttonID As String = linkButton.ID
|
|
||||||
linkButton.CssClass += " activo"
|
|
||||||
AsientoSeleccionado = buttonID
|
|
||||||
|
|
||||||
UpPanel.Update()
|
|
||||||
End Sub
|
|
||||||
Protected Sub FinalizarVenta(sender As Object, e As EventArgs)
|
|
||||||
|
|
||||||
Dim SbAlert As New StringBuilder()
|
|
||||||
Dim Retorno As New Modelos.Factura.MMensajeFactura()
|
|
||||||
|
|
||||||
Dim ObjTransporte As New ClsTransportes()
|
|
||||||
ObjTransporte.IniciaTransacSQL()
|
|
||||||
|
|
||||||
Dim TieneError As Boolean = False
|
|
||||||
|
|
||||||
Try
|
|
||||||
For Each dr As DataRow In DtPasajeros.Rows 'gvr As GridViewRow In GvB.Rows
|
|
||||||
Dim Nombre, Visa, Celular, Obs, Asiento As String
|
|
||||||
Dim Sexo As Boolean = False
|
|
||||||
Dim Importe As Decimal = 0
|
|
||||||
|
|
||||||
Nombre = dr("Nombre").ToString
|
|
||||||
Visa = dr("Visa").ToString
|
|
||||||
Celular = dr("Celular").ToString
|
|
||||||
Obs = dr("Observaciones").ToString
|
|
||||||
Asiento = dr("Asiento").ToString
|
|
||||||
Importe = dr("Importe").ToString.ToDecimal
|
|
||||||
|
|
||||||
'.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text
|
|
||||||
If Not ObjTransporte.AddViajesPasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, Asiento.ToEntero, Nombre, Visa, Celular, Sexo, Obs, UsuarioActual.CveUsuario, UsuarioActual.CveVendedor) > 1 Then
|
|
||||||
TieneError = True
|
|
||||||
SbAlert.Append("Ocurrió un error al generar el viaje")
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
If Not TieneError Then
|
|
||||||
Retorno = CrearRemision(ObjTransporte)
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Retorno IsNot Nothing Then
|
|
||||||
TieneError = Retorno.TieneError
|
|
||||||
|
|
||||||
If Not TieneError Then
|
|
||||||
If Retorno.CveVenta > 0 AndAlso Not Retorno.TieneError Then
|
|
||||||
SbAlert.AppendFormat("{0}", Retorno.Mensajes(Retorno.Mensajes.Count - 1))
|
|
||||||
Else
|
|
||||||
TieneError = True
|
|
||||||
SbAlert.Append("Ocurrió un error al generar la factura")
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Retorno.Mensajes IsNot Nothing AndAlso Retorno.Mensajes.Count > 0 Then
|
|
||||||
For Each Mensaje As String In Retorno.Mensajes
|
|
||||||
SbAlert.AppendFormat("{0} <br/>", Mensaje)
|
|
||||||
Next
|
|
||||||
Else
|
|
||||||
TieneError = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
TieneError = True
|
|
||||||
SbAlert.Append("Ocurrió un error al generar la factura")
|
|
||||||
End If
|
|
||||||
|
|
||||||
If SbAlert.Length = 0 Then
|
|
||||||
SbAlert.Append("Ocurrió un error al generar la factura")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
TieneError = True
|
|
||||||
SbAlert.Append("Ocurrió un error al generar la factura." + ex.ToString())
|
|
||||||
GuardaLog(ex.ToString())
|
|
||||||
Finally
|
|
||||||
If TieneError Then
|
|
||||||
ObjTransporte.RollBack()
|
|
||||||
ObjTransporte.Dispose()
|
|
||||||
Else
|
|
||||||
SbAlert.Append("El boleto se genero correctamente")
|
|
||||||
ObjTransporte.Commit()
|
|
||||||
ObjTransporte.Dispose()
|
|
||||||
|
|
||||||
DdlPartida.SelectedValueExist("-1")
|
|
||||||
DdlDestino.SelectedValueExist("-1")
|
|
||||||
AsientoSeleccionado = ""
|
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Alert(SbAlert.ToString(), If(TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion), ShowCloseButton:=False)
|
|
||||||
|
|
||||||
UpPanel.Update()
|
|
||||||
End Try
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
|
|
||||||
Protected Sub DdlPartida_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPartida.SelectedIndexChanged
|
|
||||||
CotizarTarifa()
|
|
||||||
UpPanel.Update()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Protected Sub DdlDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDestino.SelectedIndexChanged
|
|
||||||
CotizarTarifa()
|
|
||||||
UpPanel.Update()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Protected Sub BtnNumPasajeros_Click(sender As Object, e As EventArgs)
|
|
||||||
' GeneraPasajeros(TxtNumPasajeros.Text.ToEntero)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub GeneraPasajeros(Cantidad As Integer)
|
|
||||||
DtPasajeros.Clear()
|
|
||||||
For i As Integer = 1 To Cantidad
|
|
||||||
Dim Dr1 As DataRow = DtPasajeros.NewRow
|
|
||||||
Dr1("Numero") = i
|
|
||||||
'asiento
|
|
||||||
DtPasajeros.Rows.Add(Dr1)
|
|
||||||
Next
|
|
||||||
GvB.DataSource = DtPasajeros
|
|
||||||
GvB.DataBind()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs)
|
|
||||||
|
|
||||||
If AsientoSeleccionado = "" Then
|
|
||||||
Alert("No se ha seleccionado el asiento.")
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Me.Importe <= 0 Then
|
|
||||||
Alert("No hay un importe asignado.")
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim Dr1 As DataRow = DtPasajeros.NewRow
|
|
||||||
Dr1("Asiento") = AsientoSeleccionado.Replace("A", "")
|
|
||||||
Dr1("Nombre") = TxtNombre.Text.Trim
|
|
||||||
Dr1("Visa") = TxtVisa.Text.Trim
|
|
||||||
Dr1("Importe") = Me.Importe
|
|
||||||
'asiento
|
|
||||||
DtPasajeros.Rows.Add(Dr1)
|
|
||||||
AsientoSeleccionado = ""
|
|
||||||
|
|
||||||
GvB.DataSource = DtPasajeros
|
|
||||||
GvB.DataBind()
|
|
||||||
|
|
||||||
'identifico los asientos seleccionados para la venta
|
|
||||||
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
|
|
||||||
For Each dr As DataRow In DtPasajeros.Rows
|
|
||||||
Dim lnk As LinkButton = CType(cph.FindControl($"A{dr("Asiento")}"), LinkButton)
|
|
||||||
If lnk IsNot Nothing Then
|
|
||||||
lnk.Enabled = False
|
|
||||||
lnk.CssClass = "seleccionado"
|
|
||||||
lnk.ToolTip = dr("Nombre").ToString
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
UpPanel.Update()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Function CrearRemision(ByRef objTrans As ClsTransportes) As Modelos.Factura.MMensajeFactura
|
|
||||||
Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
|
|
||||||
|
|
||||||
Dim CveCliente As Integer = 1154164
|
|
||||||
Dim CveMoneda As Integer = 2
|
|
||||||
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero()
|
|
||||||
|
|
||||||
If CveCliente <= 0 Then
|
|
||||||
Retorno.Mensajes.Add("No se pudo cargar el cliente")
|
|
||||||
Return Retorno
|
|
||||||
End If
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
If CveSubProyecto <= 0 Then
|
Private Sub CargaDatos()
|
||||||
Retorno.Mensajes.Add("No se pudo cargar el subproyecto")
|
Dim ObjContratos As New ClsContratos
|
||||||
Return Retorno
|
Dim ObjViaje As New ClsTransportes
|
||||||
End If
|
|
||||||
|
|
||||||
Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyecto, CveCliente, CveMoneda, "Rem")
|
If ObjContratos.GetContratos(CveViaje, UsuarioActual.CveEmpresa) Then
|
||||||
|
Contrato = ObjContratos.DtResultados
|
||||||
|
If ObjContratos.DtResultados IsNot Nothing AndAlso ObjContratos.DtResultados.Rows.Count > 0 Then
|
||||||
|
TxtRuta.Text = Contrato.Rows(0)("Ruta").ToString
|
||||||
|
TxtFecha.Text = Contrato.Rows(0)("FechaInicial").ToString.ToDate.ToShortDateString
|
||||||
|
DtPasajeros = New DataTable
|
||||||
|
DtPasajeros.Columns.Add("Numero", GetType(Integer))
|
||||||
|
DtPasajeros.Columns.Add("Nombre", GetType(String))
|
||||||
|
DtPasajeros.Columns.Add("Visa", GetType(String))
|
||||||
|
DtPasajeros.Columns.Add("Asiento", GetType(String))
|
||||||
|
DtPasajeros.Columns.Add("Celular", GetType(String))
|
||||||
|
DtPasajeros.Columns.Add("Importe", GetType(Decimal))
|
||||||
|
DtPasajeros.Columns.Add("Observaciones", GetType(String))
|
||||||
|
|
||||||
Dim CvePSBoleto As Integer = 912720
|
InicializaCombos()
|
||||||
|
|
||||||
For Each Dr As DataRow In DtPasajeros.Rows
|
'Boletos Vendidos
|
||||||
Dim Obs = Dr("Nombre").ToString
|
Dim dt As DataTable
|
||||||
Dim Importe = Dr("Importe").ToString.ToDecimal()
|
If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=1) Then 'Poner párametro para estatus y cancelado de viajes
|
||||||
If Importe <= 0 Then
|
dt = ObjViaje.DtResultados
|
||||||
Retorno.Mensajes.Add("El importe debe ser mayor a 0")
|
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
|
||||||
Return Retorno
|
For Each dr As DataRow In dt.Rows
|
||||||
|
Dim lnk As LinkButton = CType(cph.FindControl($"A{dr("Asiento")}"), LinkButton)
|
||||||
|
If lnk IsNot Nothing Then
|
||||||
|
lnk.Enabled = False
|
||||||
|
lnk.CssClass = "nodisponible"
|
||||||
|
lnk.ToolTip = dr("Nombre").ToString
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjFactura.AgregarPS(CvePSBoleto, 1, Importe, 0, Obs, CveSubProyecto:=CveSubProyecto, PorcentajeIVA:=0)
|
Else
|
||||||
Next
|
ObjContratos.Dispose()
|
||||||
|
ObjViaje.Dispose()
|
||||||
|
|
||||||
ObjFactura.CalculaTotales()
|
Response.Redirect($"~/Transportes/RepContratos.aspx")
|
||||||
|
|
||||||
Try
|
|
||||||
Retorno = ObjFactura.EmitirFactura(False, Transac:=objTrans.IniciaTransacSQL())
|
|
||||||
Catch ex As Exception
|
|
||||||
Retorno = Nothing
|
|
||||||
GuardaLog(ex.ToString())
|
|
||||||
End Try
|
|
||||||
|
|
||||||
If ObjFactura IsNot Nothing Then
|
|
||||||
ObjFactura.Dispose()
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return Retorno
|
ObjContratos.Dispose()
|
||||||
End Function
|
ObjViaje.Dispose()
|
||||||
End Class
|
|
||||||
|
'Boletos Vendidos
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub InicializaCombos()
|
||||||
|
Dim CveRuta As Integer = Contrato.Rows(0)("CveRuta").ToString.ToEntero
|
||||||
|
|
||||||
|
'Lista Destinos''carga específicos
|
||||||
|
Dim ObjDestinos As New ClsTransportes()
|
||||||
|
If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then
|
||||||
|
If ObjDestinos.DtResultados.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
DdlPartida.DataSource = ObjDestinos.DtResultados
|
||||||
|
DdlPartida.DataBind()
|
||||||
|
DdlPartida.Items.Insert(0, New ListItem("Seleccione Partida", "-1"))
|
||||||
|
|
||||||
|
DdlDestino.DataSource = ObjDestinos.DtResultados
|
||||||
|
DdlDestino.DataBind()
|
||||||
|
DdlDestino.Items.Insert(0, New ListItem("Seleccione Destino", "-1"))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjDestinos.Dispose()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub CotizarTarifa()
|
||||||
|
If DdlDestino.SelectedValue <> "-1" And DdlPartida.SelectedValue <> "-1" Then
|
||||||
|
Dim ImporteR As Decimal = 0
|
||||||
|
Dim ObjDestinos As New ClsTransportes()
|
||||||
|
|
||||||
|
Try
|
||||||
|
If ObjDestinos.GetDestinosTarifas(DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero) Then
|
||||||
|
ImporteR = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL
|
||||||
|
End If
|
||||||
|
If ImporteR > 0 Then
|
||||||
|
ViewState("Importe") = ImporteR
|
||||||
|
LbCostos.Text = $"El precio de su boleto es ${ImporteR.FormatoNumero}"
|
||||||
|
LbCostos.Visible = True
|
||||||
|
BtnAgregarPasajero.Visible = True
|
||||||
|
Else
|
||||||
|
ViewState("Importe") = 0
|
||||||
|
BtnAgregarPasajero.Visible = False
|
||||||
|
LbCostos.Visible = False
|
||||||
|
Alert("No se encontro una tarifa para esta ruta", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Alert("No se encontro una tarifa para esta ruta", TipoMensaje.MsgAdvertencia)
|
||||||
|
ObjDestinos.RollBack()
|
||||||
|
Finally
|
||||||
|
ObjDestinos.Dispose()
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs)
|
||||||
|
'quitamos la selección anterior, en caso de existir.
|
||||||
|
If AsientoSeleccionado <> "" Then
|
||||||
|
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
|
||||||
|
Dim lnk As LinkButton = CType(cph.FindControl(AsientoSeleccionado), LinkButton)
|
||||||
|
lnk.CssClass = "disponible"
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim linkButton As LinkButton = DirectCast(sender, LinkButton)
|
||||||
|
Dim buttonID As String = linkButton.ID
|
||||||
|
linkButton.CssClass += " activo"
|
||||||
|
AsientoSeleccionado = buttonID
|
||||||
|
|
||||||
|
UpPanel.Update()
|
||||||
|
End Sub
|
||||||
|
'Protected Sub FinalizarVenta(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
' Dim SbAlert As New StringBuilder()
|
||||||
|
' Dim Retorno As New Modelos.Factura.MMensajeFactura()
|
||||||
|
|
||||||
|
' Dim ObjTransporte As New ClsTransportes()
|
||||||
|
' ObjTransporte.IniciaTransacSQL()
|
||||||
|
|
||||||
|
' Dim TieneError As Boolean = False
|
||||||
|
|
||||||
|
' Try
|
||||||
|
' For Each dr As DataRow In DtPasajeros.Rows 'gvr As GridViewRow In GvB.Rows
|
||||||
|
' Dim Nombre, Visa, Celular, Obs, Asiento As String
|
||||||
|
' Dim Sexo As Boolean = False
|
||||||
|
' Dim Importe As Decimal = 0
|
||||||
|
|
||||||
|
' Nombre = dr("Nombre").ToString
|
||||||
|
' Visa = dr("Visa").ToString
|
||||||
|
' Celular = dr("Celular").ToString
|
||||||
|
' Obs = dr("Observaciones").ToString
|
||||||
|
' Asiento = dr("Asiento").ToString
|
||||||
|
' Importe = dr("Importe").ToString.ToDecimal
|
||||||
|
|
||||||
|
' '.Text, TxtVisa.Text, TxtCelular.Text, CBool(RblSexo.SelectedValue), TxtObservaciones.Text
|
||||||
|
' If Not ObjTransporte.AddViajesPasajeros(CveViaje, DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero, Importe, Asiento.ToEntero, Nombre, Visa, Celular, Sexo, Obs, UsuarioActual.CveUsuario, UsuarioActual.CveVendedor) > 1 Then
|
||||||
|
' TieneError = True
|
||||||
|
' SbAlert.Append("Ocurrió un error al generar el viaje")
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
|
||||||
|
' If Not TieneError Then
|
||||||
|
' Retorno = CrearRemision(ObjTransporte)
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' If Retorno IsNot Nothing Then
|
||||||
|
' TieneError = Retorno.TieneError
|
||||||
|
|
||||||
|
' If Not TieneError Then
|
||||||
|
' If Retorno.CveVenta > 0 AndAlso Not Retorno.TieneError Then
|
||||||
|
' SbAlert.AppendFormat("{0}", Retorno.Mensajes(Retorno.Mensajes.Count - 1))
|
||||||
|
' Else
|
||||||
|
' TieneError = True
|
||||||
|
' SbAlert.Append("Ocurrió un error al generar la factura")
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' If Retorno.Mensajes IsNot Nothing AndAlso Retorno.Mensajes.Count > 0 Then
|
||||||
|
' For Each Mensaje As String In Retorno.Mensajes
|
||||||
|
' SbAlert.AppendFormat("{0} <br/>", Mensaje)
|
||||||
|
' Next
|
||||||
|
' Else
|
||||||
|
' TieneError = True
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' Else
|
||||||
|
' TieneError = True
|
||||||
|
' SbAlert.Append("Ocurrió un error al generar la factura")
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' If SbAlert.Length = 0 Then
|
||||||
|
' SbAlert.Append("Ocurrió un error al generar la factura")
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' Catch ex As Exception
|
||||||
|
' TieneError = True
|
||||||
|
' SbAlert.Append("Ocurrió un error al generar la factura." + ex.ToString())
|
||||||
|
' GuardaLog(ex.ToString())
|
||||||
|
' Finally
|
||||||
|
' If TieneError Then
|
||||||
|
' ObjTransporte.RollBack()
|
||||||
|
' ObjTransporte.Dispose()
|
||||||
|
' Else
|
||||||
|
' SbAlert.Append("El boleto se genero correctamente")
|
||||||
|
' ObjTransporte.Commit()
|
||||||
|
' ObjTransporte.Dispose()
|
||||||
|
|
||||||
|
' DdlPartida.SelectedValueExist("-1")
|
||||||
|
' DdlDestino.SelectedValueExist("-1")
|
||||||
|
' AsientoSeleccionado = ""
|
||||||
|
' CargaDatos()
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' Alert(SbAlert.ToString(), If(TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion), ShowCloseButton:=False)
|
||||||
|
|
||||||
|
' UpPanel.Update()
|
||||||
|
' End Try
|
||||||
|
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub DdlPartida_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPartida.SelectedIndexChanged
|
||||||
|
CotizarTarifa()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub DdlDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDestino.SelectedIndexChanged
|
||||||
|
CotizarTarifa()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnNumPasajeros_Click(sender As Object, e As EventArgs)
|
||||||
|
' GeneraPasajeros(TxtNumPasajeros.Text.ToEntero)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub GeneraPasajeros(Cantidad As Integer)
|
||||||
|
DtPasajeros.Clear()
|
||||||
|
For i As Integer = 1 To Cantidad
|
||||||
|
Dim Dr1 As DataRow = DtPasajeros.NewRow
|
||||||
|
Dr1("Numero") = i
|
||||||
|
'asiento
|
||||||
|
DtPasajeros.Rows.Add(Dr1)
|
||||||
|
Next
|
||||||
|
GvB.DataSource = DtPasajeros
|
||||||
|
GvB.DataBind()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub AgregarPasajero(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
If AsientoSeleccionado = "" Then
|
||||||
|
Alert("No se ha seleccionado el asiento.")
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Me.Importe <= 0 Then
|
||||||
|
Alert("No hay un importe asignado.")
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim Dr1 As DataRow = DtPasajeros.NewRow
|
||||||
|
Dr1("Asiento") = AsientoSeleccionado.Replace("A", "")
|
||||||
|
Dr1("Nombre") = TxtNombre.Text.Trim
|
||||||
|
Dr1("Visa") = TxtVisa.Text.Trim
|
||||||
|
Dr1("Importe") = Me.Importe
|
||||||
|
'asiento
|
||||||
|
DtPasajeros.Rows.Add(Dr1)
|
||||||
|
AsientoSeleccionado = ""
|
||||||
|
|
||||||
|
GvB.DataSource = DtPasajeros
|
||||||
|
GvB.DataBind()
|
||||||
|
|
||||||
|
'identifico los asientos seleccionados para la venta
|
||||||
|
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
|
||||||
|
For Each dr As DataRow In DtPasajeros.Rows
|
||||||
|
Dim lnk As LinkButton = CType(cph.FindControl($"A{dr("Asiento")}"), LinkButton)
|
||||||
|
If lnk IsNot Nothing Then
|
||||||
|
lnk.Enabled = False
|
||||||
|
lnk.CssClass = "seleccionado"
|
||||||
|
lnk.ToolTip = dr("Nombre").ToString
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
UpPanel.Update()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'Private Function CrearRemision(ByRef objTrans As ClsTransportes) As Modelos.Factura.MMensajeFactura
|
||||||
|
' Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
|
||||||
|
|
||||||
|
' Dim CveCliente As Integer = 1154164
|
||||||
|
' Dim CveMoneda As Integer = 2
|
||||||
|
' Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero()
|
||||||
|
|
||||||
|
' If CveCliente <= 0 Then
|
||||||
|
' Retorno.Mensajes.Add("No se pudo cargar el cliente")
|
||||||
|
' Return Retorno
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' If CveSubProyecto <= 0 Then
|
||||||
|
' Retorno.Mensajes.Add("No se pudo cargar el subproyecto")
|
||||||
|
' Return Retorno
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyecto, CveCliente, CveMoneda, "Rem")
|
||||||
|
|
||||||
|
' Dim CvePSBoleto As Integer = 912720
|
||||||
|
|
||||||
|
' For Each Dr As DataRow In DtPasajeros.Rows
|
||||||
|
' Dim Obs = Dr("Nombre").ToString
|
||||||
|
' Dim Importe = Dr("Importe").ToString.ToDecimal()
|
||||||
|
' If Importe <= 0 Then
|
||||||
|
' Retorno.Mensajes.Add("El importe debe ser mayor a 0")
|
||||||
|
' Return Retorno
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' ObjFactura.AgregarPS(CvePSBoleto, 1, Importe, 0, Obs, CveSubProyecto:=CveSubProyecto, PorcentajeIVA:=0)
|
||||||
|
' Next
|
||||||
|
|
||||||
|
' ObjFactura.CalculaTotales()
|
||||||
|
|
||||||
|
' Try
|
||||||
|
' Retorno = ObjFactura.EmitirFactura(False, Transac:=objTrans.IniciaTransacSQL())
|
||||||
|
' Catch ex As Exception
|
||||||
|
' Retorno = Nothing
|
||||||
|
' GuardaLog(ex.ToString())
|
||||||
|
' End Try
|
||||||
|
|
||||||
|
' If ObjFactura IsNot Nothing Then
|
||||||
|
' ObjFactura.Dispose()
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' Return Retorno
|
||||||
|
'End Function
|
||||||
|
End Class
|
||||||
|
|||||||
@@ -190,7 +190,7 @@
|
|||||||
<asp:Literal ID="LtlFechaFinal" runat="server" Text='<%# Eval("FechaFinal", "{0:d}") %>'></asp:Literal>
|
<asp:Literal ID="LtlFechaFinal" runat="server" Text='<%# Eval("FechaFinal", "{0:d}") %>'></asp:Literal>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
<%-- Columnas Ocultas --%>
|
<%-- Columnas Ocultas --%>
|
||||||
<asp:TemplateField HeaderText="Chofer 1" Visible="false">
|
<asp:TemplateField HeaderText="Chofer 1" Visible="false">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
@@ -200,13 +200,13 @@
|
|||||||
|
|
||||||
<asp:TemplateField HeaderText="Chofer 2" Visible="false">
|
<asp:TemplateField HeaderText="Chofer 2" Visible="false">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="LtChofer2" runat="server" Text='<%# Eval("NombreChofer2") %>'></asp:Literal>
|
<asp:Literal ID="LtChofer2" runat="server" Text='<%# Eval("NombreChofer2") %>'></asp:Literal>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:TemplateField HeaderText="Unidad" Visible="false">
|
<asp:TemplateField HeaderText="Unidad" Visible="false">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="LtUnidad" runat="server" Text='<%# Eval("NombreAF") %>'></asp:Literal>
|
<asp:Literal ID="LtUnidad" runat="server" Text='<%# Eval("NombreAF") %>'></asp:Literal>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
@@ -364,11 +364,29 @@
|
|||||||
<div class="row my-1">
|
<div class="row my-1">
|
||||||
<label class="col-md-4">Anticipo</label>
|
<label class="col-md-4">Anticipo</label>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<asp:TextBox ID="TxtAnticipo" CssStyle=" form-control" Width="95%" runat="server"
|
<asp:TextBox ID="TxtAnticipo" CssStyle="form-control" Width="95%" runat="server"
|
||||||
type="decimal"></asp:TextBox>
|
type="decimal"></asp:TextBox>
|
||||||
<span class="fa fa-percent"></span>
|
<span class="fa fa-percent"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-md-4">Moneda</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:DropDownList ID="DdlMoneda" AppendDataBoundItems="true" DataTextField="Moneda"
|
||||||
|
DataValueField="CveMoneda"
|
||||||
|
Class="table-group-action-input form-control input-inline select2me"
|
||||||
|
Width="100%" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVMoneda" runat="server" ControlToValidate="DdlMoneda"
|
||||||
|
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Moneda''</b> es necesario, por favor ingréselo."
|
||||||
|
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEMoneda" runat="server" HighlightCssClass="vco"
|
||||||
|
TargetControlID="RFVMoneda" Width="400px">
|
||||||
|
</ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ Partial Class ListadoContratos
|
|||||||
DdlChofer.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
DdlChofer.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
||||||
DdlChofer.DataBind()
|
DdlChofer.DataBind()
|
||||||
DdlChofer.Items.Insert(0, New ListItem("-", ""))
|
DdlChofer.Items.Insert(0, New ListItem("-", ""))
|
||||||
|
'Lista de Monedas
|
||||||
|
DdlMoneda.DataSource = GlobalDTMonedas
|
||||||
|
DdlMoneda.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
@@ -90,7 +93,7 @@ Partial Class ListadoContratos
|
|||||||
'Agregamos Contrato
|
'Agregamos Contrato
|
||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
ObjContratos.IniciaTransacSQL()
|
ObjContratos.IniciaTransacSQL()
|
||||||
If ObjContratos.AddContratos(LbFolio.Text, 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, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text) > 0 Then
|
If ObjContratos.AddContratos(LbFolio.Text, 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, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=34, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text) > 0 Then
|
||||||
ObjContratos.Commit()
|
ObjContratos.Commit()
|
||||||
Alert("Agregado Correctamente.")
|
Alert("Agregado Correctamente.")
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||||
<div class="portlet-title portlet-filterT smalltitle">
|
<div class="portlet-title portlet-filterT smalltitle">
|
||||||
<div class="tools">
|
<div class="tools">
|
||||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
<asp:Button runat="server" Text="Consultar" class="btn btn-primary" OnClick="Consultar" />
|
||||||
<a href="javascript:;" class="expand"></a>
|
<a href="javascript:;" class="expand"></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="titlefiltros caption">
|
<div class="titlefiltros caption">
|
||||||
@@ -86,7 +86,6 @@
|
|||||||
<%--Contratos Tab--%>
|
<%--Contratos Tab--%>
|
||||||
<ajax:TabPanel ID="TabPanel1" runat="server" HeaderText="Contratos">
|
<ajax:TabPanel ID="TabPanel1" runat="server" HeaderText="Contratos">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<%-- Filtros --%>
|
|
||||||
<%-- Filtros --%>
|
<%-- Filtros --%>
|
||||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
@@ -94,62 +93,69 @@
|
|||||||
<%-- Filtro Visible - Consulta --%>
|
<%-- Filtro Visible - Consulta --%>
|
||||||
<div class="portlet-title portlet-filterT smalltitle">
|
<div class="portlet-title portlet-filterT smalltitle">
|
||||||
<div class="tools">
|
<div class="tools">
|
||||||
<asp:Button ID="BtnConsultarListado" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultarListado_Click" />
|
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||||
<a href="javascript:;" class="expand"></a>
|
<a href="javascript:;" class="expand"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="titlefiltros caption">
|
<div class="titlefiltros caption">
|
||||||
<div class="row">
|
<div class="row" style="height: 32px;">
|
||||||
|
<%-- Fecha Inicial --%>
|
||||||
<div class="col-md-1 truncate">
|
<label class="col-md-1 truncate">Fecha Inicial</label>
|
||||||
Fecha Inicio:
|
<div class="col-md-1" style="min-width: 115px">
|
||||||
</div>
|
<div class="input-group input-sm input-small date date-picker "
|
||||||
<div class="col-md-1" style="min-width: 115px">
|
data-date-format="dd/mm/yyyy"
|
||||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
style="width: 100px !important; padding: 0px;">
|
||||||
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control"
|
||||||
<span class="input-group-btn ">
|
MaxLength="10"></asp:TextBox>
|
||||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
<span class="input-group-btn ">
|
||||||
</span>
|
<asp:LinkButton ID="imgCalendario" class="btn default" Text="<i class='fa fa-calendar'></i>"
|
||||||
</div>
|
runat="server"></asp:LinkButton>
|
||||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
</span>
|
||||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
</div>
|
||||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI"
|
||||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left">
|
||||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
</ajax:MaskedEditExtender>
|
||||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI"
|
||||||
</div>
|
PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
<div class="col-md-1 truncate">
|
|
||||||
Fecha Fin:
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="col-md-1" style="min-width: 115px">
|
|
||||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
|
||||||
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
|
||||||
<span class="input-group-btn ">
|
|
||||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
|
||||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
|
||||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
|
||||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
|
||||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
|
||||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<label class="col-md-1 ">Cliente:</label>
|
|
||||||
<div class="col-md-2">
|
|
||||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientesFiltro" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
|
||||||
</div>
|
|
||||||
<label class="col-md-1 ">Estatus:</label>
|
|
||||||
<div class="col-md-2">
|
|
||||||
<asp:DropDownList ID="DdlEstatusConsulta" runat="server" Class="table-group-action-input form-control input-inline select2me"
|
|
||||||
DataTextField="ContratoEstatus" DataValueField="CveContratoEstatus"
|
|
||||||
AppendDataBoundItems="true" Width="200px">
|
|
||||||
</asp:DropDownList>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<%-- Fecha Final --%>
|
||||||
|
<label class="col-md-1 truncate">Fecha Fin</label>
|
||||||
|
<div class="col-md-1" style="min-width: 115px">
|
||||||
|
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy"
|
||||||
|
style="width: 100px !important; padding: 0px;">
|
||||||
|
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control"
|
||||||
|
MaxLength="10"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton ID="imgCalendarioF" class="btn default "
|
||||||
|
Text="<i class='fa fa-calendar'></i>"
|
||||||
|
runat="server"></asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF"
|
||||||
|
Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left">
|
||||||
|
</ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF"
|
||||||
|
PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
</div>
|
||||||
|
<%-- Cliente --%>
|
||||||
|
<label class="col-md-1">Cliente</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlCliente" Width="86%"
|
||||||
|
data-metodo="getcliente"
|
||||||
|
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente"
|
||||||
|
CssStyle="width: 86%;"
|
||||||
|
UsaWebService="true" Enabled="false"></ADS:Dropdownlost>
|
||||||
|
</div>
|
||||||
|
<%-- Estatus --%>
|
||||||
|
<label class="col-md-1 ">Estatus:</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:DropDownList ID="DdlEstatusConsulta" data-text="Todos" AppendDataBoundItems="true"
|
||||||
|
DataTextField="ContratoEstatus"
|
||||||
|
DataValueField="CveContratoEstatus" CssClass="form-control ddlFiltros input-sm select2me Widthall"
|
||||||
|
Style="width: 100%;" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%-- Filtro Oculto --%>
|
<%-- Filtro Oculto --%>
|
||||||
@@ -173,7 +179,7 @@
|
|||||||
<%-- Chofer --%>
|
<%-- Chofer --%>
|
||||||
<label class="col-md-1 ">Chofer:</label>
|
<label class="col-md-1 ">Chofer:</label>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<asp:DropDownList ID="DdlChoferConsulta" data-text="Todos" AppendDataBoundItems="true"
|
<asp:DropDownList ID="DdlChoferFiltro" data-text="Todos" AppendDataBoundItems="true"
|
||||||
DataTextField="NombreCompleto" DataValueField="CvePersonal" CssClass="form-control ddlFiltros input-sm select2me Widthall"
|
DataTextField="NombreCompleto" DataValueField="CvePersonal" CssClass="form-control ddlFiltros input-sm select2me Widthall"
|
||||||
Style="width: 100%;" runat="server">
|
Style="width: 100%;" runat="server">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
@@ -192,7 +198,7 @@
|
|||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField HeaderText="Contrato">
|
<asp:TemplateField HeaderText="Contrato">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:HyperLink runat="server" NavigateUrl='<%# "~/Transportes/RepContratoDetalle.aspx?CveContrato=" + If(Eval("CveContrato") IsNot DBNull.Value, Eval("CveContrato").ToString(), String.Empty) %>'
|
<asp:HyperLink ForeColor="White" runat="server" NavigateUrl='<%# "~/Transportes/RepContratoDetalle.aspx?CveContrato=" + If(Eval("CveContrato") IsNot DBNull.Value, Eval("CveContrato").ToString(), String.Empty) %>'
|
||||||
Text='<%# Eval("NumeroContrato") %>'></asp:HyperLink>
|
Text='<%# Eval("NumeroContrato") %>'></asp:HyperLink>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
@@ -256,7 +262,8 @@
|
|||||||
|
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar" OnClick="UpdateModal" CssClass="btn btn-circle btn-xs green" Text="<i class='fa fa-pencil'></i>" />
|
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar" OnClick="UpdateModal"
|
||||||
|
CssClass="btn btn-circle btn-xs green" Text="<i class='fa fa-pencil'></i>" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
@@ -319,7 +326,6 @@
|
|||||||
<asp:TextBox ID="TxtObservaciones" runat="server" Width="100%" TextMode="MultiLine"
|
<asp:TextBox ID="TxtObservaciones" runat="server" Width="100%" TextMode="MultiLine"
|
||||||
Rows="2"
|
Rows="2"
|
||||||
ReadOnly="true"></asp:TextBox>
|
ReadOnly="true"></asp:TextBox>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -333,7 +339,6 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<label class="col-md-4">Fecha Salida:</label>
|
<label class="col-md-4">Fecha Salida:</label>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
|
|
||||||
<asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control"
|
<asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control"
|
||||||
ReadOnly="true" Width="100%"></asp:TextBox>
|
ReadOnly="true" Width="100%"></asp:TextBox>
|
||||||
|
|
||||||
@@ -343,12 +348,18 @@
|
|||||||
<div class="row my-1">
|
<div class="row my-1">
|
||||||
<label class="col-md-4">Fecha Regreso:</label>
|
<label class="col-md-4">Fecha Regreso:</label>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
|
|
||||||
<asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control"
|
<asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control"
|
||||||
ReadOnly="true" Width="100%"></asp:TextBox>
|
ReadOnly="true" Width="100%"></asp:TextBox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row my-1">
|
||||||
|
<label class="col-md-4">Moneda:</label>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:TextBox ID="TxtMoneda" runat="server" ReadOnly="true" Width="100%"></asp:TextBox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row my-1">
|
<div class="row my-1">
|
||||||
<label class="col-md-4">Tipo Unidad</label>
|
<label class="col-md-4">Tipo Unidad</label>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
@@ -356,7 +367,6 @@
|
|||||||
DataTextField="TipoActivoFijo" Class="form-control input-inline"
|
DataTextField="TipoActivoFijo" Class="form-control input-inline"
|
||||||
Width="100%" runat="server" Enabled="false">
|
Width="100%" runat="server" Enabled="false">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -366,7 +376,7 @@
|
|||||||
<asp:DropDownList ID="DdlAF" DataValueField="CveActivoFijo"
|
<asp:DropDownList ID="DdlAF" DataValueField="CveActivoFijo"
|
||||||
DataTextField="Descripcion" Class="table-group-action-input form-control input-inline select2me"
|
DataTextField="Descripcion" Class="table-group-action-input form-control input-inline select2me"
|
||||||
Width="100%" runat="server">
|
Width="100%" runat="server">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -376,16 +386,17 @@
|
|||||||
<asp:DropDownList ID="DdlChofer" AppendDataBoundItems="true" DataValueField="CvePersonal"
|
<asp:DropDownList ID="DdlChofer" AppendDataBoundItems="true" DataValueField="CvePersonal"
|
||||||
DataTextField="NombreCompleto" Class="table-group-action-input form-control input-inline select2me"
|
DataTextField="NombreCompleto" Class="table-group-action-input form-control input-inline select2me"
|
||||||
Width="100%" runat="server">
|
Width="100%" runat="server">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row my-1">
|
<div class="row my-1">
|
||||||
<label class="col-md-4">Chofer 2</label>
|
<label class="col-md-4">Chofer 2</label>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<asp:DropDownList ID="DdlChofer2" AppendDataBoundItems="true" DataValueField="CvePersonal"
|
<asp:DropDownList ID="DdlChofer2" AppendDataBoundItems="true" DataValueField="CvePersonal"
|
||||||
DataTextField="NombreCompleto" Class="table-group-action-input form-control input-inline select2me"
|
DataTextField="NombreCompleto" Class="table-group-action-input form-control input-inline select2me"
|
||||||
Width="100%" runat="server">
|
Width="100%" runat="server">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -42,11 +42,12 @@ Partial Class RepContratosCalendario
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
' GvContratos.HeaderStyle.ForeColor = Drawing.Color.Black
|
'EL fondo de las líneas es blanco, por eso cambio el color a negro de la cabecera
|
||||||
Dim CveCliente As Integer = DdlClientesFiltro.SelectedValue.ToEntero
|
GvContratos.HeaderStyle.ForeColor = Drawing.Color.Black
|
||||||
|
Dim CveCliente As Integer = DdlCliente.SelectedValue.ToEntero
|
||||||
If CveCliente = 0 Then CveCliente = -1
|
If CveCliente = 0 Then CveCliente = -1
|
||||||
|
|
||||||
If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientesFiltro.SelectedValue.ToEntero, CveEstatus:=DdlEstatusConsulta.SelectedValue.ToEntero, CveTipoContrato:=34) Then
|
If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero, CveEstatus:=DdlEstatusConsulta.SelectedValue.ToEntero, CveTipoContrato:=34) Then
|
||||||
GvContratos.DataSource = ObjContratos.DtResultados
|
GvContratos.DataSource = ObjContratos.DtResultados
|
||||||
GvContratos.DataBind()
|
GvContratos.DataBind()
|
||||||
End If
|
End If
|
||||||
@@ -101,7 +102,7 @@ Partial Class RepContratosCalendario
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, LblSubProyecto)
|
'CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, LblSubProyecto)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -142,6 +143,7 @@ Partial Class RepContratosCalendario
|
|||||||
TxtUbicacion.Text = GvRow.DataKey("Ubicacion")
|
TxtUbicacion.Text = GvRow.DataKey("Ubicacion")
|
||||||
TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy hh:mm tt")
|
TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy hh:mm tt")
|
||||||
TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy hh:mm tt")
|
TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy hh:mm tt")
|
||||||
|
TxtMoneda.Text = GvRow.DataKey("CveMoneda")
|
||||||
'Requeridos
|
'Requeridos
|
||||||
ViewState("Contrato") = GvRow.DataKey("CveContrato")
|
ViewState("Contrato") = GvRow.DataKey("CveContrato")
|
||||||
DdlAF.SelectedValue = GvRow.DataKey("CveAF")
|
DdlAF.SelectedValue = GvRow.DataKey("CveAF")
|
||||||
@@ -153,7 +155,9 @@ Partial Class RepContratosCalendario
|
|||||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub Consultar(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
End Sub
|
||||||
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
||||||
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
|
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Reference in New Issue
Block a user