Vya Repviajes unidad, choferes
This commit is contained in:
@@ -102,7 +102,7 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div c lass="col-md-4">
|
||||
<asp:UpdatePanel runat="server" ID="UpTimer" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Label ID="lblTiempo" runat="server" Text=""></asp:Label>
|
||||
@@ -114,7 +114,7 @@
|
||||
|
||||
<div class="portlet-body form">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconrigh">
|
||||
<asp:TextBox ID="TxtNombre" CssClass="form-control" runat="server" MaxLength="50"
|
||||
ClientIDMode="Static"></asp:TextBox>
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<%-- <div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtINE" runat="server" Width="100%" CssClass="form-control" MaxLength="15"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVINE" runat="server" ControlToValidate="TxtINE"
|
||||
@@ -134,9 +134,9 @@
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label>INE:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtFechaNacimiento" runat="server" type="date" Width="100%" CssClass="form-control x"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento"
|
||||
@@ -148,7 +148,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="RblSexo" CssClass="form-control input-sm select2me" runat="server">
|
||||
<asp:ListItem Text="Masculino" Value="1" Selected="True" />
|
||||
@@ -159,7 +159,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtVisa" runat="server" Width="100%" CssClass="form-control"
|
||||
type="text" MaxLength="15"></asp:TextBox>
|
||||
@@ -170,7 +170,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<%--<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtVisaVigencia" runat="server" Width="100%" CssClass="form-control"
|
||||
type="date" MaxLength="10"></asp:TextBox>
|
||||
@@ -179,21 +179,13 @@
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label>Vigencia:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright ">
|
||||
<asp:TextBox ID="TxtCelular" CssClass="form-control" runat="server" MaxLength="15"
|
||||
ClientIDMode="Static"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCelular" runat="server" ControlToValidate="TxtCelular"
|
||||
CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Celular''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label>Celular</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright ">
|
||||
<asp:TextBox ID="TxtObservaciones" CssClass="form-control" runat="server" MaxLength="200"
|
||||
ClientIDMode="Static"></asp:TextBox>
|
||||
@@ -201,6 +193,18 @@
|
||||
<label>Observaciones</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright ">
|
||||
<asp:TextBox ID="TxtCelular" CssClass="form-control" runat="server" MaxLength="15"
|
||||
ClientIDMode="Static"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCelular" runat="server" ControlToValidate="TxtCelular"
|
||||
CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Celular''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label>Celular</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -325,8 +329,8 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:LinkButton OnClick="OnLinkButtonClick" CssClass="disponible"
|
||||
runat="server" ID="A1" Text="<i class='fa fa-user my-1'><br/>1</i>" />
|
||||
<asp:LinkButton OnClick="OnLinkButtonClick" CssClass="disponible" ID="A1" runat="server"
|
||||
Text="<i class='fa fa-user my-1'><br/>1</i>" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:LinkButton OnClick="OnLinkButtonClick" CssClass="disponible" ID="A2" runat="server"
|
||||
|
||||
@@ -57,11 +57,30 @@ Partial Class Boletos
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property EsAgencia As Boolean
|
||||
Get
|
||||
If ViewState("EsAgencia") Is Nothing Then
|
||||
ViewState("EsAgencia") = False
|
||||
End If
|
||||
|
||||
Return Boolean.Parse(ViewState("EsAgencia").ToString())
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("EsAgencia") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
#Region "Carga Página"
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
If Not IsPostBack Then
|
||||
|
||||
If UsuarioActual.CveRol = 1583 Then
|
||||
EsAgencia = True
|
||||
End If
|
||||
|
||||
If Request.QueryString("CveViaje") Is Nothing And UsuarioActual.CveVendedor <> Nothing And UsuarioActual.CveVendedor <> -1 Then
|
||||
Response.Redirect("/Transportes/RepViajes.aspx")
|
||||
End If
|
||||
@@ -115,7 +134,8 @@ Partial Class Boletos
|
||||
If lnk IsNot Nothing Then
|
||||
lnk.Enabled = False
|
||||
lnk.CssClass = "nodisponible"
|
||||
lnk.ToolTip = dr("Nombre").ToString
|
||||
Dim Sexo As String = If(Boolean.Parse(dr("Sexo").ToString), "Masculino", "Femenino")
|
||||
lnk.ToolTip = If(EsAgencia, Sexo, dr("Nombre").ToString)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
@@ -166,13 +186,14 @@ Partial Class Boletos
|
||||
|
||||
' Calcular la diferencia en años entre la fecha actual y la fecha de nacimiento
|
||||
edad = CInt(DateDiff(DateInterval.Year, fechaNacimiento, fechaHoy))
|
||||
If edad < 8 Or edad > 65 Then
|
||||
If edad <= 4 Or edad >= 60 Then
|
||||
ImporteR = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL - 20
|
||||
Else
|
||||
ImporteR = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
If ImporteR > 0 Then
|
||||
ViewState("Importe") = ImporteR
|
||||
LbCostos.Text = $"El precio de su boleto es ${ImporteR.FormatoNumero}"
|
||||
@@ -219,7 +240,7 @@ Partial Class Boletos
|
||||
For Each dr As DataRow In DtPasajeros.Rows
|
||||
|
||||
|
||||
Dim CveViajePasajero As Integer = ObjTransporte.AddViajesPasajeros(CveViaje, dr("CveDestinoOrigen").ToString.ToEntero, dr("CveDestinoFinal").ToString.ToEntero, UsuarioActual.CveVendedor, dr("Importe").ToString.ToDecimal, dr("Asiento").ToString.ToEntero, dr("Nombre").ToString, dr("INE").ToString, dr("FechaNacimiento").ToString.ToDate, dr("CveSexo").ToString.ToBool, dr("Visa").ToString, dr("VisaVigencia").ToString.ToDate, dr("Celular").ToString, dr("Observaciones").ToString, UsuarioActual.CveUsuario)
|
||||
Dim CveViajePasajero As Integer = ObjTransporte.AddViajesPasajeros(CveViaje, dr("CveDestinoOrigen").ToString.ToEntero, dr("CveDestinoFinal").ToString.ToEntero, UsuarioActual.CveVendedor, dr("Importe").ToString.ToDecimal, dr("Asiento").ToString.ToEntero, dr("Nombre").ToString, dr("FechaNacimiento").ToString.ToDate, dr("CveSexo").ToString.ToBool, dr("Visa").ToString, dr("Celular").ToString, dr("Observaciones").ToString, UsuarioActual.CveUsuario)
|
||||
|
||||
If CveViajePasajero < 1 Then
|
||||
TieneError = True
|
||||
@@ -354,12 +375,12 @@ Partial Class Boletos
|
||||
Dr1("Importe") = Me.Importe
|
||||
Dr1("Asiento") = AsientoSeleccionado.Replace("A", "")
|
||||
Dr1("Nombre") = TxtNombre.Text.Trim
|
||||
Dr1("INE") = TxtINE.Text.Trim
|
||||
'Dr1("INE") = TxtINE.Text.Trim
|
||||
Dr1("FechaNacimiento") = TxtFechaNacimiento.Text.Trim
|
||||
Dr1("Sexo") = RblSexo.SelectedItem
|
||||
Dr1("CveSexo") = RblSexo.SelectedValue.ToBool
|
||||
Dr1("Visa") = TxtVisa.Text.Trim
|
||||
Dr1("VisaVigencia") = TxtVisaVigencia.Text.Trim
|
||||
'Dr1("VisaVigencia") = TxtVisaVigencia.Text.Trim
|
||||
Dr1("Celular") = TxtCelular.Text.Trim
|
||||
Dr1("Observaciones") = TxtObservaciones.Text.Trim
|
||||
|
||||
@@ -367,10 +388,10 @@ Partial Class Boletos
|
||||
DtPasajeros.Rows.Add(Dr1)
|
||||
AsientoSeleccionado = ""
|
||||
TxtNombre.Text = ""
|
||||
TxtINE.Text = ""
|
||||
'TxtINE.Text = ""
|
||||
TxtFechaNacimiento.Text = ""
|
||||
TxtVisa.Text = ""
|
||||
TxtVisaVigencia.Text = ""
|
||||
'TxtVisaVigencia.Text = ""
|
||||
TxtCelular.Text = ""
|
||||
TxtObservaciones.Text = ""
|
||||
GvB.DataSource = DtPasajeros
|
||||
@@ -378,6 +399,7 @@ Partial Class Boletos
|
||||
|
||||
'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
|
||||
@@ -386,6 +408,7 @@ Partial Class Boletos
|
||||
lnk.ToolTip = dr("Nombre").ToString
|
||||
End If
|
||||
Next
|
||||
|
||||
BtnGuardar.Visible = True
|
||||
UpPanel.Update()
|
||||
End Sub
|
||||
|
||||
@@ -217,7 +217,18 @@ Partial Class RepContratoDetalle
|
||||
|
||||
|
||||
|
||||
Private Property EsAgencia As Boolean
|
||||
Get
|
||||
If ViewState("EsAgencia") Is Nothing Then
|
||||
ViewState("EsAgencia") = False
|
||||
End If
|
||||
|
||||
Return Boolean.Parse(ViewState("EsAgencia").ToString())
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("EsAgencia") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
@@ -227,14 +238,18 @@ Partial Class RepContratoDetalle
|
||||
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
|
||||
|
||||
If Request("CveContrato") Is Nothing Then
|
||||
Response.Redirect($"~/Transportes/RepContratos.aspx")
|
||||
End If
|
||||
|
||||
CveContrato = Request("CveContrato").ToEntero
|
||||
|
||||
If UsuarioActual.CveRol = 1583 Then
|
||||
EsAgencia = True
|
||||
End If
|
||||
|
||||
InicializaCombos()
|
||||
CargaDatos()
|
||||
CargaAuxiliarClienteCxC(DdlClientes.SelectedValue.ToEntero, CveVentaRemision)
|
||||
@@ -910,10 +925,18 @@ Partial Class RepContratoDetalle
|
||||
}
|
||||
|
||||
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Boleto.mrt", dtResult, params, NombreArchivo:="Boleto")
|
||||
|
||||
End Sub
|
||||
Protected Sub GvViajesPasajeros_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If EsAgencia Then
|
||||
e.Row.FCLinkButton("BtnCancelar").Visible = False
|
||||
End If
|
||||
|
||||
|
||||
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("BtnImprimir"))
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub EditarBoleto(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -25,9 +25,14 @@
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
||||
<contenttemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LBAgregarViaje" runat="server"><i class='fa fa-plus'></i>Agregar viaje</asp:LinkButton>
|
||||
</li>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LBAgregarViaje" runat="server"><i class='fa fa-plus'></i>Agregar viaje</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</contenttemplate>
|
||||
|
||||
</asp:Content>
|
||||
@@ -92,10 +97,16 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<%-- Modal --%>
|
||||
<div id="ModalAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div id="ModalAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel runat="server" ID="UpModal" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="UpAddChofer" class="modal-content rowpadding" tabindex="-1"
|
||||
runat="server">
|
||||
|
||||
@@ -177,6 +188,50 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Tipo Unidad</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlTipoAF" DataValueField="CveTipoActivoFijo"
|
||||
DataTextField="TipoActivoFijo" Class="form-control input-inline"
|
||||
Width="100%" runat="server" Enabled="true"
|
||||
AutoPostBack="true"
|
||||
OnSelectedIndexChanged="DdlTipoAF_SelectedIndexChanged">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-1" id="DivAF" runat="server">
|
||||
<label class="col-md-4">Unidad</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlAF" DataValueField="CveActivoFijo"
|
||||
DataTextField="CodDesc" Class="form-control select2me"
|
||||
Width="100%" runat="server" AutoPostBack="true">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Chofer 1</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlChofer" AppendDataBoundItems="true" DataValueField="CvePersonal" AutoPostBack="true" OnSelectedIndexChanged="DdlChofer_SelectedIndexChanged"
|
||||
DataTextField="NombreCompleto" Class="table-group-action-input form-control input-inline select2me"
|
||||
Width="100%" runat="server">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Chofer 2</label>
|
||||
<div class="col-md-8" runat="server" id="DVChofer2">
|
||||
<asp:DropDownList ID="DdlChofer2" AppendDataBoundItems="true" DataValueField="CvePersonal"
|
||||
DataTextField="NombreCompleto" Class="table-group-action-input form-control input-inline select2me"
|
||||
Width="100%" runat="server">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row my-1">
|
||||
<asp:CheckBox CssClass="col-md-4" ID="IsMasivo" runat="server" Text="Generar Viajes Masivo"
|
||||
Visible="true"
|
||||
@@ -205,12 +260,17 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ Option Strict On
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Extensiones.ModExtensiones
|
||||
Imports Microsoft.EntityFrameworkCore
|
||||
Partial Class ListadoViajes
|
||||
Inherits ClsPaginas
|
||||
|
||||
@@ -55,6 +56,10 @@ Partial Class ListadoViajes
|
||||
End If
|
||||
ObjRutas.Dispose()
|
||||
|
||||
|
||||
CargaUnidades()
|
||||
CargaChoferes()
|
||||
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
'Carga Viajes
|
||||
@@ -81,6 +86,7 @@ Partial Class ListadoViajes
|
||||
End If
|
||||
End If
|
||||
|
||||
DdlRutas.SelectedValueExist(-1)
|
||||
IsMasivo.Visible = True
|
||||
TxtFechaViaje.Text = ""
|
||||
DdlPartida.Text = ""
|
||||
@@ -88,11 +94,21 @@ Partial Class ListadoViajes
|
||||
BtnGuardar.Text = "Agregar"
|
||||
ModalLabel.InnerHtml = "Agregar Nuevo Viaje"
|
||||
|
||||
DdlTipoAF.SelectedValueExist(-1)
|
||||
DdlAF.SelectedValueExist(-1)
|
||||
DdlChofer.SelectedValueExist(-1)
|
||||
DdlChofer2.SelectedValueExist(-1)
|
||||
|
||||
UpModal.Update()
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub AddViaje(sender As Object, e As EventArgs)
|
||||
'Generador de Viajes Masivos
|
||||
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
|
||||
|
||||
If IsMasivo.Checked = True Then
|
||||
If TxtFechaInicial.Text = "" Or TxtFrecuencia.Text = "" Then
|
||||
Alert("Es necesario agregar la fecha inicial y la frecuencia", TipoMensaje.MsgAdvertencia)
|
||||
@@ -107,10 +123,15 @@ Partial Class ListadoViajes
|
||||
fechasGeneradas.Add(fechaInicial)
|
||||
fechaInicial = fechaInicial.AddDays(TxtFrecuencia.Text.ToEntero)
|
||||
End While
|
||||
|
||||
|
||||
Dim ObjContratos As New ClsContratos()
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
Dim ObjFolio As New ClsGralFolios(ObjContratos.IniciaTransacSQL())
|
||||
Dim ErrorProceso As Boolean = False
|
||||
|
||||
Try
|
||||
For Each fecha As DateTime In fechasGeneradas
|
||||
Dim ObjFolio As New ClsGralFolios
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
'Generamos folio
|
||||
If ObjFolio.GetFolios("Con", UsuarioActual.CveEmpresa, CveSubProyecto:=CveSubProyecto) Then
|
||||
@@ -121,69 +142,112 @@ Partial Class ListadoViajes
|
||||
End If
|
||||
'Agregamos contrato
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
If ObjContratos.AddContratos(LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, fecha, fecha, "", "", DdlRutas.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1, -1, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero, CveMasivo:=CveMasivo, CveVendedor:=UsuarioActual.CveVendedor) > 0 Then
|
||||
ObjContratos.Commit()
|
||||
If Not ObjContratos.AddContratos(LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, fecha, fecha, "", "", DdlRutas.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1,
|
||||
-1, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero, CveMasivo:=CveMasivo, CveVendedor:=UsuarioActual.CveVendedor,
|
||||
CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero) > 0 Then
|
||||
'ObjContratos.Commit()
|
||||
ErrorProceso = True
|
||||
Exit For
|
||||
End If
|
||||
'Actualizamos Folio
|
||||
ObjFolio.IniciaTransacSQL()
|
||||
If ObjFolio.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then
|
||||
ObjFolio.Commit()
|
||||
If Not ObjFolio.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then
|
||||
'ObjFolio.Commit()
|
||||
ErrorProceso = True
|
||||
Exit For
|
||||
End If
|
||||
ObjFolio.Dispose()
|
||||
'ObjFolio.Dispose()
|
||||
Next
|
||||
Alert("Viajes Masivos generados correctamente.")
|
||||
|
||||
Catch ex As Exception
|
||||
Dim ObjContratos As New ClsContratos
|
||||
ObjContratos.RollBack()
|
||||
Alert("Ocurrió un error al generar viajes masivo", TipoMensaje.MsgError)
|
||||
ErrorProceso = True
|
||||
Finally
|
||||
|
||||
TxtFechaViaje.Text = ""
|
||||
DdlPartida.Text = ""
|
||||
DdlDestino.SelectedValue = ""
|
||||
If ErrorProceso Then
|
||||
ObjContratos.RollBack()
|
||||
Alert("Ocurrió un error al generar viajes masivo", TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjContratos.Commit()
|
||||
TxtFechaViaje.Text = ""
|
||||
DdlPartida.Text = ""
|
||||
DdlDestino.SelectedValue = ""
|
||||
Alert("Viajes Masivos generados correctamente.")
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalAgregar"))
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
|
||||
If Not ErrorProceso Then
|
||||
CargaDatos()
|
||||
End If
|
||||
|
||||
CargaDatos()
|
||||
End Try
|
||||
Else
|
||||
Dim ObjContratos As New ClsContratos
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
Dim ObjFolios As New ClsGralFolios(ObjContratos.IniciaTransacSQL())
|
||||
Dim ErrorProceso As Boolean = False
|
||||
|
||||
Try
|
||||
'Agregamos Viaje
|
||||
If BtnGuardar.Text = "Agregar" Then
|
||||
If ObjContratos.AddContratos(LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, TxtFechaViaje.Text.ToDate, TxtFechaViaje.Text.ToDate, "", "", DdlRutas.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, 0, 0, 0, 2, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero) > 0 Then
|
||||
ObjContratos.Commit()
|
||||
Alert("Viaje agregado correctamente.")
|
||||
If Not ObjContratos.AddContratos(LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, TxtFechaViaje.Text.ToDate, TxtFechaViaje.Text.ToDate, "", "", DdlRutas.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1,
|
||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, 0, 0, 0, 2, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero,
|
||||
CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero) > 0 Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
Else
|
||||
'Actualizamos Viaje
|
||||
If ObjContratos.UpdateContratos(CveContrato.ToEntero, LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, TxtFechaInicial.Text.ToDate, TxtFechaInicial.Text.ToDate, "", "", DdlRutas.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1, 2, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero) = True Then
|
||||
ObjContratos.Commit()
|
||||
Alert("El viaje se actualizó correctamente.")
|
||||
If Not ObjContratos.UpdateContratos(CveContrato.ToEntero, LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, TxtFechaInicial.Text.ToDate, TxtFechaInicial.Text.ToDate, "", "", DdlRutas.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1,
|
||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1, 2, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero,
|
||||
CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero) = True Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrió un error al generar viaje", TipoMensaje.MsgError)
|
||||
ObjContratos.RollBack()
|
||||
Finally
|
||||
'Reiniciamos modal
|
||||
TxtFechaViaje.Text = ""
|
||||
'Actualizamos Folio
|
||||
Dim ObjFolios As New ClsGralFolios
|
||||
ObjFolios.IniciaTransacSQL()
|
||||
If ObjFolios.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then
|
||||
ObjFolios.Commit()
|
||||
End If
|
||||
ObjFolios.Dispose()
|
||||
|
||||
ObjContratos.Dispose()
|
||||
CargaDatos()
|
||||
If Not ErrorProceso Then
|
||||
If Not ObjFolios.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
ErrorProceso = True
|
||||
End Try
|
||||
|
||||
If ErrorProceso Then
|
||||
ObjContratos.RollBack()
|
||||
Alert("Ocurrió un error al guardar el viaje", TipoMensaje.MsgError)
|
||||
Else
|
||||
|
||||
ObjContratos.Commit()
|
||||
|
||||
TxtFechaViaje.Text = ""
|
||||
|
||||
If BtnGuardar.Text = "Agregar" Then
|
||||
Alert("Viaje agregado correctamente.")
|
||||
Else
|
||||
Alert("El viaje se actualizó correctamente.")
|
||||
End If
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalAgregar"))
|
||||
|
||||
End If
|
||||
|
||||
ObjContratos.Dispose()
|
||||
|
||||
If Not ErrorProceso Then
|
||||
CargaDatos()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub ToggleMasivo(sender As Object, e As EventArgs)
|
||||
DivFechaMasivo.Visible = IsMasivo.Checked
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
Protected Sub GoContratoDetalle(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
@@ -195,4 +259,90 @@ Partial Class ListadoViajes
|
||||
Dim Ruta As String = GvRow.DataKey("Ruta")
|
||||
Response.Redirect(String.Format("~/Transportes/RepBoletos.aspx?CveViaje={0}&Ruta={1}", CveViaje, Ruta))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaUnidades()
|
||||
|
||||
Dim dttipoaf As DataTable = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("MedidaVehicularClave IN (2,3)")
|
||||
DdlTipoAF.DataSource = dttipoaf
|
||||
DdlTipoAF.DataBind()
|
||||
DdlTipoAF.Items.Insert(0, New ListItem("-", "-1"))
|
||||
|
||||
'DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros(" EstadoActivoFijo= 'Activo' ")
|
||||
'DdlAF.DataBind()
|
||||
'DdlAF.Items.Insert(0, New ListItem("-", "-1"))
|
||||
'UpDatos.Update()
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
Private Sub CargaChoferes()
|
||||
|
||||
Dim dtchofer As DataTable = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltraParametros("CvePuesto = 702 and CveEstatusPersonal = 1", "NombreCompleto")
|
||||
DdlChofer.DataSource = dtchofer
|
||||
DdlChofer.DataBind()
|
||||
DdlChofer.Items.Insert(0, New ListItem("-", "-1"))
|
||||
DdlChofer.SelectedValueExist(-1)
|
||||
|
||||
DdlChofer2.DataSource = dtchofer
|
||||
DdlChofer2.DataBind()
|
||||
DdlChofer2.Items.Insert(0, New ListItem("-", "-1"))
|
||||
DdlChofer2.SelectedValueExist(-1)
|
||||
|
||||
UpModal.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlChofer_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
If DdlChofer.SelectedValue.ToEntero <= 0 Then
|
||||
DdlChofer2.SelectedValueExist(-1)
|
||||
UpModal.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlTipoAF_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
'Dim FechaInicio As Date = TxtFechaViaje.Text.ToDate
|
||||
'If FechaInicio <= MinFecha Then
|
||||
' Alert("Debe seleccionar Fecha de viaje.", TipoMensaje.MsgAdvertencia)
|
||||
' DdlTipoAF.SelectedValueExist(-1)
|
||||
' UpModal.Update()
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
CargaAFDdl(DdlTipoAF.SelectedValue.ToEntero)
|
||||
|
||||
End Sub
|
||||
|
||||
'FIXME OIC REVISAR SI SE VA USAR
|
||||
Private Sub CargaAFDdl(CveTipoAF As Integer)
|
||||
'Lista de Activos fijos
|
||||
|
||||
'DdlAF.ClearSelection()
|
||||
'DdlAF.SelectedValue = Nothing
|
||||
'DdlAF.Items.Clear()
|
||||
|
||||
'Dim FechaInicio As Date = TxtFechaViaje.Text.ToDate
|
||||
'Dim FinDeAnio As Date = New Date(FechaInicio.Year, 12, 31)
|
||||
|
||||
'Dim ObjContratos As New ClsContratos
|
||||
'If ObjContratos.GetContratosValUnidadesAgendadas(DdlAF.SelectedValue.ToEntero, TxtFechaViaje.Text.ToDate, FinDeAnio, UsuarioActual.CveEmpresa, -1, 2) Then
|
||||
|
||||
' If CveTipoAF > 0 Then
|
||||
' DdlAF.DataSource = ObjContratos.DtResultados.FiltraParametros($" CveTipoActivoFijo = {CveTipoAF} ")
|
||||
' Else
|
||||
' DdlAF.DataSource = ObjContratos.DtResultados
|
||||
' End If
|
||||
'End If
|
||||
'ObjContratos.Dispose()
|
||||
|
||||
|
||||
|
||||
'Lista de Activos fijos
|
||||
DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros($" EstadoActivoFijo= 'Activo' AND CveTipoActivoFijo = {CveTipoAF} ")
|
||||
DdlAF.DataBind()
|
||||
DdlAF.Items.Insert(0, New ListItem("-", "-1"))
|
||||
UpModal.Update()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user