--Se pasa calendarios y repcontratos a sólo la clase de ClsContratos

This commit is contained in:
AbrahamCastilloV
2024-02-13 13:39:16 -07:00
parent 4dddf169d6
commit cc3a64d18e
12 changed files with 141 additions and 588 deletions

View File

@@ -34,22 +34,19 @@ Public Class CalendarEvent
Public Property NomprePersonal As String Public Property NomprePersonal As String
Public Property NombreAcercamiento As String Public Property NombreAcercamiento As String
Public Property CvePersonal As Integer Public Property CvePersonal As Integer
Public Property CvePersonal2 As Integer
Public Property CveCliente As Integer Public Property CveCliente As Integer
Public Property CveProveedor As Integer Public Property CveProveedor As Integer
Public Property CveOS As Integer Public Property CveOS As Integer
Public Property CveOSDetalle As Integer Public Property CveOSDetalle As Integer
Public Property CveUsuarioAtendio As Integer Public Property CveUsuarioAtendio As Integer
Public Property CveSubProyectoUsuarioAtendio As Integer Public Property CveSubProyectoUsuarioAtendio As Integer
Public Property CveCompra As Integer Public Property CveCompra As Integer
Public Property SerieFolioCompra As String Public Property SerieFolioCompra As String
Public Property CveVenta As Integer Public Property CveVenta As Integer
Public Property SerieFolioVenta As String Public Property SerieFolioVenta As String
Public Property CveActivoFijo As Integer Public Property CveActivoFijo As Integer
Public Property AFCodigo As String Public Property AFCodigo As String
Public Property CveMovimiento As Integer Public Property CveMovimiento As Integer
Public Property MovimientoFolio As String Public Property MovimientoFolio As String
Public Property CveIE As Integer Public Property CveIE As Integer
@@ -57,7 +54,7 @@ Public Class CalendarEvent
Public Property Pesos As Double Public Property Pesos As Double
Public Property Dolares As Double Public Property Dolares As Double
Public Property Anticipo As Double Public Property Anticipo As Double
Public Property CantidadPasajeros As String
Public Property NumeroContrato As String
End Class End Class

View File

@@ -10812,7 +10812,7 @@ Public Class ClsPaginas
#Region "Transportes" #Region "Transportes"
PaginaDict.Add("/Transportes/RepContratos.aspx".ToUpper(), 598) PaginaDict.Add("/Transportes/RepContratos.aspx".ToUpper(), 598)
PaginaDict.Add("/Transportes/RepContratosDetalles.aspx".ToUpper(), 598) PaginaDict.Add("/Transportes/RepContratoDetalle.aspx".ToUpper(), 598)
PaginaDict.Add("/Transportes/RepViajes.aspx".ToUpper(), 599) PaginaDict.Add("/Transportes/RepViajes.aspx".ToUpper(), 599)
PaginaDict.Add("/Transportes/Boletos.aspx".ToUpper(), 600) PaginaDict.Add("/Transportes/Boletos.aspx".ToUpper(), 600)
PaginaDict.Add("/Transportes/RepBoletos.aspx".ToUpper(), 601) PaginaDict.Add("/Transportes/RepBoletos.aspx".ToUpper(), 601)

View File

@@ -449,7 +449,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
If ObjContratos.GetContratos(-1, usuarioActual_.CveEmpresa, TipoContrato:=2) Then If ObjContratos.GetContratos(-1, usuarioActual_.CveEmpresa, TipoContrato:=34) Then
If ObjContratos.DtResultados.Rows.Count > 0 Then If ObjContratos.DtResultados.Rows.Count > 0 Then
@@ -465,14 +465,15 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.NombreAcercamiento = dr("Ubicacion").ToString cevent.NombreAcercamiento = dr("Ubicacion").ToString
cevent.CveCliente = dr("CveCliente").ToString.ToEntero cevent.CveCliente = dr("CveCliente").ToString.ToEntero
cevent.CvePersonal = dr("CveChofer").ToString.ToEntero cevent.CvePersonal = dr("CveChofer").ToString.ToEntero
cevent.CvePersonal2 = dr("CveChofer2").ToString.ToEntero
cevent.CveEventoEstatus = dr("CveContratosEstatus").ToString.ToEntero
cevent.Dolares = dr("Importe").ToString.ToDecimal cevent.Dolares = dr("Importe").ToString.ToDecimal
cevent.Pesos = dr("ImporteMax").ToString.ToDecimal cevent.Pesos = dr("ImporteMax").ToString.ToDecimal
cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.backgroundColor = dr("BackgroundColor").ToString cevent.backgroundColor = dr("BackgroundColor").ToString
cevent.CantidadPasajeros = dr("CantidadPasajeros").ToString
cevent.NumeroContrato = dr("NumeroContrato").ToString
If Not cevent.recurrenciatipo > 0 Then If Not cevent.recurrenciatipo > 0 Then

View File

@@ -0,0 +1,24 @@
<%@ Page Language="VB" AutoEventWireup="true" Title="Transportes V&A - Detalles del Contrato"
MasterPageFile="~/Site.master"
CodeFile="RepContratoDetalle.aspx.vb"
Inherits="RepContratoDetalle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="E" runat="Server">
Detalles del Contratos
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="C" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,9 @@
Option Explicit On
Option Strict On
Partial Class RepContratoDetalle
Inherits ClsPaginas
End Class

View File

@@ -1,361 +0,0 @@
<%@ Page Language="VB" AutoEventWireup="true" Title="Transportes V&A - Contratos"
MasterPageFile="~/Site.master"
CodeFile="RepContratos - Copy.aspx.vb"
Inherits="ListadoContratos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="E" runat="Server">
Listado de Contratos
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.my-1 {
margin-block: 1rem;
}
.dataTables_scrollHead {
background-color: #DDD;
color: white;
}
.table-scrollable {
margin-top: 0px !important;
margin-bottom: 0px !important;
}
.Texto {
text-align: left !important
}
.boton {
background: red;
}
.consulta {
padding: 1rem 2rem;
background-color: #95A5A6;
display: flex;
justify-content: space-around;
align-items: center;
margin-bottom: 1rem;
}
.consulta_campo {
display: flex;
gap: 1rem;
align-items: center;
width: 100%;
}
.consulta_campo label {
color: white;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UPPAcciones" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<li>
<asp:LinkButton ID="LBAgregarContrato" runat="server"><i class='fa fa-plus'></i>Agregar Contrato</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LBExcel" runat="server"><i class="fa fa-file-excel-o"></i>Generar Excel</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LBExcel" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="consulta">
<div class="consulta_campo">
<label>Fecha Inicial:</label>
<asp:TextBox Width="150px" ID="txtFechaI" runat="server" CssClass="form-control"
type="datetime"
MaxLength="10"></asp:TextBox>
</div>
<div class="consulta_campo">
<label>Fecha Inicial:</label>
<asp:TextBox Width="150px" ID="txtFechaF" runat="server" CssClass="form-control"
type="datetime"
MaxLength="10"></asp:TextBox>
</div>
<div class="consulta_campo">
<label>Cliente</label>
<ADS:Dropdownlost ID="DdlClientesConsulta" data-metodo="getcliente"
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 200px"
CssClassDdl="pxlect2me"
UsaWebService="true"></ADS:Dropdownlost>
</div>
<div class="consulta_campo">
<label>Estatus:</label>
<div class="col-md-8">
<asp:DropDownList ID="DdlEstatusConsulta" runat="server" Class="table-group-action-input form-control input-inline select2me"
DataTextField="ContratoEstatus" DataValueField="CveContratoEstatus"
AppendDataBoundItems="true"
Width="100%">
</asp:DropDownList>
</div>
</div>
<asp:Button ID="BtnConsulta" runat="server" Text="Consultar" class="btn btn-primary"
OnClick="Consultar" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
data-sort="true" DataKeyNames="CveContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente, CveTipoAF, Importe, ImporteMin, ImporteMax,CveChofer, Observaciones, CveContratosEstatus, CveAF">
<Columns>
<asp:TemplateField HeaderText="Folio">
<ItemTemplate>
<asp:Literal ID="LtlCveContrato" runat="server" Text='<%# Eval("CveContrato") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="100px">
<HeaderTemplate>
Fecha<br />
Salida
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaI" runat="server" Text='<%# Eval("FechaInicial", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Viaje">
<ItemTemplate>
<asp:Literal ID="LtlDescripcionContrato" runat="server" Text='<%# Eval("DescripcionContrato") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cliente">
<ItemTemplate>
<asp:Literal ID="LtNombreComercial" runat="server" Text='<%# Eval("NombreComercial") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Lugar Salida">
<ItemTemplate>
<asp:Literal ID="LtUbicacion" runat="server" Text='<%# Eval("Ubicacion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Final" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<HeaderTemplate>
Fecha<br />
Regreso
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaFinal" runat="server" Text='<%# Eval("FechaFinal", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-CssClass="bold">
<ItemTemplate>
<asp:Label ID="LtlEstatus" runat="server"
Text='<%# Eval("ContratoEstatus1") %>' Style='<%# "color:" + If(Eval("BackgroundColor") IsNot DBNull.Value, Eval("BackgroundColor").ToString(), String.Empty) %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalAgregar" class="modal ADS fade" role="dialog">
<asp:UpdatePanel runat="server" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-dialog rowpadding">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel" runat="server">Agregar Contrato</h4>
</div>
<div class="modal-body">
<div class="row my-1">
<label class="col-md-4">Cliente</label>
<div class="col-md-8">
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente"
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"
UsaWebService="true" Enabled="false"></ADS:Dropdownlost>
</div>
</div>
<div class="row">
<label class="col-md-4">Servicio:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtDescripcion" runat="server" MaxLength="70" Width="100%"
TextMode="MultiLine"
Rows="2"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" ControlToValidate="TxtDescripcion"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripcion''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEDescripcion" runat="server" HighlightCssClass="vco"
TargetControlID="RFVDescripcion" Width="100%">
</ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row my-1">
<label class="col-md-4">Observaciones:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtObservaciones" runat="server" MaxLength="70" Width="100%"
TextMode="MultiLine"
Rows="2"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVObservaciones" runat="server" ControlToValidate="TxtObservaciones"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripcion''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEObservaciones" runat="server" HighlightCssClass="vco"
TargetControlID="RFVObservaciones" Width="100%">
</ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-4">Lugar de Salida:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtUbicacion" runat="server" MaxLength="70" Width="100%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVUbicacion" runat="server" ControlToValidate="TxtUbicacion"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Ubicación''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEUbicacion" runat="server" HighlightCssClass="vco"
TargetControlID="RFVUbicacion" Width="100%">
</ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row my-1">
<label class="col-md-4">Fecha Salida:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control" CausesValidation="True"
Width="100%"
type="datetime-local"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtFechaSalida" runat="server" ControlToValidate="TxtFechaSalida"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Salida''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtFechaSalida" runat="server" HighlightCssClass="vco"
TargetControlID="RFVTxtFechaSalida" Width="100%">
</ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-4">Fecha Regreso:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control" CausesValidation="True"
Width="100%"
type="datetime-local"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtFechaRegreso" runat="server" ControlToValidate="TxtFechaRegreso"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Regreso''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco"
TargetControlID="RFVTxtFechaRegreso" Width="100%">
</ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row my-1">
<label class="col-md-4">
<asp:Label runat="server" Text="Tipo Unidad:"></asp:Label></label><div
class="col-md-8">
<asp:DropDownList ID="DdlTipoAF" AppendDataBoundItems="true" DataTextField="TipoActivoFijo"
DataValueField="CveTipoActivoFijo" Class="table-group-action-input form-control input-inline select2me"
Width="100%" runat="server">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTransporte" runat="server" ControlToValidate="DdlTipoAF"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Transporte''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETransporte" runat="server" HighlightCssClass="vco"
TargetControlID="RFVTransporte" Width="400px">
</ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row my-1">
<label class="col-md-4">
<asp:Label runat="server" Text="Chofer:"></asp:Label></label><div
class="col-md-8">
<asp:DropDownList ID="DdlChofer" AppendDataBoundItems="true" DataValueField="CvePersonal"
DataTextField="NombreCompleto" Class="table-group-action-input form-control input-inline select2me"
Width="100%" runat="server">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVChofer" runat="server" ControlToValidate="DdlChofer"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEChofer" runat="server" HighlightCssClass="vco"
TargetControlID="RFVChofer" Width="400px">
</ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-4">Costo dólares:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtDolares" CssStyle=" form-control" runat="server" type="number"
Width="95%"></asp:TextBox>
<span class="fa fa-dollar"></span>
</div>
</div>
<div class="row my-1">
<label class="col-md-4">Costo pesos:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtPesos" CssStyle=" form-control" runat="server" type="number"
Width="95%"></asp:TextBox>
<span class="fa fa-dollar"></span>
</div>
</div>
<div class="row">
<label class="col-md-4">Anticipo:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtAnticipo" CssStyle=" form-control" Width="95%" runat="server"
type="decimal"></asp:TextBox>
<span class="fa fa-percent"></span>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnGuardar" OnClick="AddContrato" runat="server" CssClass="btn btn-primary"
Text="Guardar"
ValidationGroup="GrpGuardar"></asp:Button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>

View File

@@ -1,159 +0,0 @@
Option Explicit On
Option Strict On
Imports System.Data.SqlClient
Imports Extensiones
Imports Extensiones.ModExtensiones
Partial Class ListadoContratos
Inherits ClsPaginas
Private Property CveContrato As Integer
Get
Return ViewState("CveContrato").ToString().ToEntero
End Get
Set(value As Integer)
ViewState("CveContrato") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToString("MM/dd/yyyy").Replace(" ", "T")
txtFechaF.Text = DateTime.Now.AddDays(7).ToString("MM/dd/yyyy").Replace(" ", "T")
If Not IsPostBack Then
ViewState("CveContrato") = 0
InicializaCombos()
CargaDatos()
End If
End Sub
Private Sub InicializaCombos()
'Lista Tipo AF
DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
DdlTipoAF.DataBind()
DdlTipoAF.Items.Insert(0, New ListItem("-", ""))
'Lista Chofer'
DdlChofer.DataSource = GlobalDTRHPersonal(185)
DdlChofer.DataBind()
DdlChofer.Items.Insert(0, New ListItem("-", ""))
UpModal.Update()
End Sub
Private Sub CargaDatos()
Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then
GvContratos.DataSource = ObjContratos.DtResultados
GvContratos.DataBind()
End If
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
DdlEstatusConsulta.DataSource = ObjContratos.DtResultados
DdlEstatusConsulta.DataBind()
DdlEstatusConsulta.Items.Insert(0, New ListItem("-", ""))
End If
UpTitulos.Update()
End Sub
Protected Sub MostrarModal(Optional Descripcion As String = "", Optional FechaSalida As String = "", Optional FechaRegreso As String = "", Optional Observaciones As String = "", Optional Ubicacion As String = "", Optional Transporte As String = "", Optional CveCliente As Integer = 0, Optional Dolares As String = "", Optional Pesos As String = "", Optional Anticipo As String = "", Optional Boton As String = "Guardar", Optional Chofer As String = "")
'DdlClientes.SelectedText = Cliente
TxtDescripcion.Text = Descripcion
TxtUbicacion.Text = Ubicacion
TxtFechaSalida.Text = FechaSalida
TxtFechaRegreso.Text = FechaRegreso
TxtObservaciones.Text = Observaciones
TxtUbicacion.Text = Ubicacion
DdlTipoAF.SelectedValue = Transporte
DdlClientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial")
DdlClientes.SelectedValue = CveCliente.ToString
DdlChofer.SelectedValue = Chofer
TxtObservaciones.Text = Observaciones
TxtDolares.Text = Math.Round(Dolares.ToDecimal, 2).ToString
TxtPesos.Text = Math.Round(Pesos.ToDecimal, 2).ToString
TxtAnticipo.Text = Math.Round(Anticipo.ToDecimal * 100, 2).ToString
BtnGuardar.Text = Boton
myModalLabel.InnerHtml = $"{Boton} Contrato"
UpModal.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
End Sub
Private Sub LBAgregarContrato_Click(sender As Object, e As EventArgs) Handles LBAgregarContrato.Click
MostrarModal()
End Sub
Protected Sub AddContrato(sender As Object, e As EventArgs)
If DdlClientes.SelectedValue = "" Then
Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL()
'Agregar contrato
If BtnGuardar.Text = "Guardar" Then
If ObjContratos.AddContratos("", TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero) > 0 Then
ObjContratos.Commit()
Alert("Agregado Correctamente.")
End If
End If
'Actualizar contrato
If BtnGuardar.Text = "Editar" Then
If ObjContratos.UpdateContratos(CveContrato, "", TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=2, CveContratosEstatus:=1, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero) Then
ObjContratos.Commit()
Alert("Actualizado Correctamente.")
End If
End If
TxtDescripcion.Text = ""
TxtFechaSalida.Text = ""
TxtFechaRegreso.Text = ""
TxtObservaciones.Text = ""
TxtUbicacion.Text = ""
DdlClientes.SelectedText = ""
DdlTipoAF.SelectedValue = ""
DdlChofer.SelectedValue = ""
TxtDolares.Text = ""
TxtPesos.Text = ""
TxtAnticipo.Text = ""
BtnGuardar.Text = "Guardar"
ObjContratos.Dispose()
CargaDatos()
End Sub
Protected Sub LBExcel_Click(sender As Object, e As EventArgs) Handles LBExcel.Click
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
End Sub
Protected Sub Consultar(sender As Object, e As EventArgs)
Dim fechaInicial As String = txtFechaI.Text
Dim fechaFinal As String = txtFechaF.Text
Dim cliente As String = If(DdlClientesConsulta.SelectedValue = "", "", $"C.CveCliente = {DdlClientesConsulta.SelectedValue} AND")
Dim estatus As String = ""
Dim nombreEstatus As String = ""
Dim innerEstatus As String = ""
If (DdlEstatusConsulta.SelectedValue <> "") Then
estatus = $"C.CveContratosEstatus = {DdlEstatusConsulta.SelectedValue} AND"
nombreEstatus = ", CE.ContratoEstatus As ContratoEstatus1"
innerEstatus = "INNER JOIN Con_ContratosEstatus CE with(nolock) ON CE.CveContratoEstatus = C.CveContratosEstatus
"
End If
Dim intervalo As String = If(DdlEstatusConsulta.SelectedValue = "" And DdlClientesConsulta.SelectedValue = "", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'", $"FechaInicial BETWEEN '{fechaInicial}' AND '{fechaFinal}'")
Dim query As String = $"SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial {nombreEstatus} FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente {innerEstatus} WHERE {cliente} {estatus} {intervalo}"
Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
Using command As New SqlCommand(query, connection)
connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
GvContratos.DataSource = reader
GvContratos.DataBind()
End Using
End Using
UpTitulos.Update()
End Sub
End Class

View File

@@ -149,7 +149,7 @@
<Columns> <Columns>
<asp:TemplateField HeaderText="Contrato"> <asp:TemplateField HeaderText="Contrato">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlCveContrato" runat="server" Text='<%# Eval("NumeroContrato") %>'></asp:Literal> <asp:LinkButton runat="server" Text='<%# Eval("NumeroContrato") %>' OnClick="GoContratoDetalle"></asp:LinkButton>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>

View File

@@ -81,14 +81,23 @@ Partial Class ListadoContratos
Exit Sub Exit Sub
End If End If
'Aumentamos Folio
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
Dim ObjFolios As New ClsGralFolios
If ObjFolios.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then
ObjFolios.Dispose()
End If
'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, -1, 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
ObjContratos.Dispose()
'Reiniciamos modal
TxtDescripcion.Text = "" TxtDescripcion.Text = ""
TxtFechaSalida.Text = "" TxtFechaSalida.Text = ""
TxtFechaRegreso.Text = "" TxtFechaRegreso.Text = ""
@@ -101,7 +110,6 @@ Partial Class ListadoContratos
TxtAnticipo.Text = "" TxtAnticipo.Text = ""
TxtCantidadPasajeros.Text = "" TxtCantidadPasajeros.Text = ""
ObjContratos.Dispose()
UpModal.Update() UpModal.Update()
CargaDatos() CargaDatos()
@@ -192,4 +200,10 @@ Partial Class ListadoContratos
End If End If
End Sub End Sub
Protected Sub GoContratoDetalle(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveContrato As String = GvRow.DataKey("CveContrato")
Response.Redirect(String.Format("~/Transportes/RepContratoDetalle.aspx?CveContrato={0}", CveContrato))
End Sub
End Class End Class

View File

@@ -151,6 +151,7 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
<div class="consulta_campo"> <div class="consulta_campo">
<asp:Button ID="BtnConsulta" runat="server" Text="Consultar" class="btn btn-primary" <asp:Button ID="BtnConsulta" runat="server" Text="Consultar" class="btn btn-primary"
OnClick="Consultar" /> OnClick="Consultar" />
@@ -198,20 +199,20 @@
</div> </div>
</asp:Panel> </asp:Panel>
</div> </div>
<%-- Contratos --%>
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado" <asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn miGrid" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn miGrid"
GridLines="None" GridLines="None"
data-sort="true" DataKeyNames="CveContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente,NombreComercial, CveTipoAF, Importe, ImporteMin, ImporteMax, Observaciones, CveAF, CveChofer, CveChofer2, CveContratosEstatus"> data-sort="true" DataKeyNames="CveContrato, NumeroContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente,NombreComercial, CveTipoAF, Importe, ImporteMin, ImporteMax, Observaciones, CveAF, CveChofer, CveChofer2, CveContratosEstatus, CantidadPasajeros">
<Columns> <Columns>
<asp:TemplateField HeaderText="Contrato"> <asp:TemplateField HeaderText="Contrato">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlCveContrato" runat="server" Text='<%# Eval("NumeroContrato") %>'></asp:Literal> <asp:LinkButton ForeColor="White" Font-Bold="true" runat="server" Text='<%# Eval("NumeroContrato") %>' OnClick="GoContratoDetalle"></asp:LinkButton>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="120px"> <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="120px">
<HeaderTemplate> <HeaderTemplate>
Fecha<br /> Fecha<br />
@@ -221,6 +222,7 @@
<asp:Literal ID="LtlFechaI" runat="server" Text='<%# Eval("FechaInicial", "{0:dd/MM/yyyy HH:mm}") %>'></asp:Literal> <asp:Literal ID="LtlFechaI" runat="server" Text='<%# Eval("FechaInicial", "{0:dd/MM/yyyy HH:mm}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Viaje"> <asp:TemplateField HeaderText="Viaje">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlDescripcionContrato" runat="server" Text='<%# Eval("DescripcionContrato") %>'></asp:Literal> <asp:Literal ID="LtlDescripcionContrato" runat="server" Text='<%# Eval("DescripcionContrato") %>'></asp:Literal>
@@ -235,11 +237,10 @@
<asp:TemplateField HeaderText="Chofer"> <asp:TemplateField HeaderText="Chofer">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlChofer" runat="server" Text='<%# Eval("NombreChofer") %>'></asp:Literal> <asp:Literal ID="LtlChofer" runat="server" Text='<%# Eval("NombreChofer") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Chofer2"> <asp:TemplateField HeaderText="Chofer2">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlChofer2" runat="server" Text='<%# Eval("NombreChofer2") %>'></asp:Literal> <asp:Literal ID="LtlChofer2" runat="server" Text='<%# Eval("NombreChofer2") %>'></asp:Literal>
@@ -248,9 +249,10 @@
<asp:TemplateField HeaderText="Unidad"> <asp:TemplateField HeaderText="Unidad">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlAF" runat="server" Text='<%# Eval("CveAF") %>'></asp:Literal> <asp:Literal ID="LtlAF" runat="server" Text='<%# Eval("NombreAF") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Final" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px"> <asp:TemplateField HeaderText="Fecha Final" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<HeaderTemplate> <HeaderTemplate>
Fecha<br /> Fecha<br />
@@ -275,7 +277,6 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</ContentTemplate> </ContentTemplate>
@@ -284,13 +285,12 @@
</ajax:TabPanel> </ajax:TabPanel>
</ajax:TabContainer> </ajax:TabContainer>
</asp:Panel> </asp:Panel>
<%-- Modal --%>
<div id="ModalActualizar" class="modal ADS fade" role="dialog"> <div id="ModalActualizar" class="modal ADS fade" role="dialog">
<asp:UpdatePanel runat="server" ID="UpModal" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="modal-dialog rowpadding"> <div class="modal-dialog rowpadding">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
@@ -299,6 +299,20 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row my-1">
<label class="col-md-4 bold text-primary">Folio:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtFolio" runat="server" ReadOnly="true" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row my-1">
<label class="col-md-4 bold text-primary">Numero de Pasajeros:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtCantidadPasajeros" 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">Cliente</label> <label class="col-md-4">Cliente</label>
<div class="col-md-8"> <div class="col-md-8">
@@ -330,8 +344,7 @@
<div class="row my-1"> <div class="row my-1">
<label class="col-md-4">Lugar de Salida:</label> <label class="col-md-4">Lugar de Salida:</label>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TxtUbicacion" runat="server" Width="100%" ReadOnly="true"></asp:TextBox> <asp:TextBox ID="TxtUbicacion" runat="server" ReadOnly="true" Width="100%"></asp:TextBox>
</div> </div>
</div> </div>
@@ -350,7 +363,7 @@
<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>
@@ -369,7 +382,7 @@
<label class="col-md-4">Unidad</label> <label class="col-md-4">Unidad</label>
<div class="col-md-8"> <div class="col-md-8">
<asp:DropDownList ID="DdlAF" DataValueField="CveActivoFijo" <asp:DropDownList ID="DdlAF" DataValueField="CveActivoFijo"
DataTextField="CodigoDescripcion" 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>
<asp:RequiredFieldValidator ID="RFVAF" runat="server" ControlToValidate="DdlAF" <asp:RequiredFieldValidator ID="RFVAF" runat="server" ControlToValidate="DdlAF"
@@ -400,19 +413,30 @@
<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="DdlChofer1" 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>
<asp:RequiredFieldValidator ID="RFVChofer1" runat="server" ControlToValidate="DdlChofer1" <asp:RequiredFieldValidator ID="RFVChofer2" runat="server" ControlToValidate="DdlChofer2"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer1''</b> es necesario, por favor ingréselo." Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer 2''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEChofer1" runat="server" HighlightCssClass="vco" <ajax:ValidatorCalloutExtender ID="VCEChofer2" runat="server" HighlightCssClass="vco"
TargetControlID="RFVChofer1" Width="400px"> TargetControlID="RFVChofer2" Width="400px">
</ajax:ValidatorCalloutExtender> </ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="row">
<asp:Label ID="LbEstatus" runat="server" class="col-md-4">Estatus:</asp:Label>
<div class="col-md-8">
<asp:DropDownList ID="DdlEstatusContrato" runat="server" Class="table-group-action-input form-control input-inline select2me"
AppendDataBoundItems="true" DataValueField="CveContratoEstatus"
DataTextField="ContratoEstatus"
Width="100%">
</asp:DropDownList>
</div>
</div>
<div class="row hidden"> <div class="row hidden">
<label class="col-md-4">Costo dólares:</label> <label class="col-md-4">Costo dólares:</label>
<div class="col-md-8"> <div class="col-md-8">
@@ -433,17 +457,6 @@
<asp:TextBox ID="TxtAnticipo" CssStyle=" form-control" runat="server" type="decimal"></asp:TextBox> <asp:TextBox ID="TxtAnticipo" CssStyle=" form-control" runat="server" type="decimal"></asp:TextBox>
</div> </div>
</div> </div>
<div class="row">
<asp:Label ID="LbEstatus" runat="server" class="col-md-4">Estatus:</asp:Label>
<div class="col-md-8">
<asp:DropDownList ID="DdlEstatusContrato" runat="server" Class="table-group-action-input form-control input-inline select2me"
AppendDataBoundItems="true" DataValueField="CveContratoEstatus"
DataTextField="ContratoEstatus"
Width="100%">
</asp:DropDownList>
</div>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@@ -452,7 +465,6 @@
ValidationGroup="GrpGuardar"></asp:Button> ValidationGroup="GrpGuardar"></asp:Button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div> </div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -490,7 +502,8 @@
} }
function updateEvent(event, element) { function updateEvent(event, element) {
console.log(event) $('#<%=TxtCantidadPasajeros.ClientID%>').val(event.CantidadPasajeros);
$('#<%=TxtFolio.ClientID%>').val(event.NumeroContrato);
$('#<%=TxtObservaciones.ClientID%>').val(event.title); $('#<%=TxtObservaciones.ClientID%>').val(event.title);
$('#<%=TxtDescripcion.ClientID%>').val(event.title); $('#<%=TxtDescripcion.ClientID%>').val(event.title);
$('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento); $('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento);
@@ -499,6 +512,8 @@
$('#<%=DdlClientes.ClientID%>').val(event.CveCliente); $('#<%=DdlClientes.ClientID%>').val(event.CveCliente);
$('#<%=DdlAF.ClientID%>').val(event.CveActivoFijo); $('#<%=DdlAF.ClientID%>').val(event.CveActivoFijo);
$('#<%=DdlChofer.ClientID%>').val(event.CvePersonal); $('#<%=DdlChofer.ClientID%>').val(event.CvePersonal);
$('#<%=DdlChofer2.ClientID%>').val(event.CvePersonal2);
$('#<%=DdlEstatusContrato.ClientID%>').val(event.CveEventoEstatus);
$('#<%=TxtDolares.ClientID%>').val(event.Dolares); $('#<%=TxtDolares.ClientID%>').val(event.Dolares);
$('#<%=TxtPesos.ClientID%>').val(event.Pesos); $('#<%=TxtPesos.ClientID%>').val(event.Pesos);
$('#<%=TxtAnticipo.ClientID%>').val(event.Anticipo); $('#<%=TxtAnticipo.ClientID%>').val(event.Anticipo);
@@ -512,8 +527,6 @@
} }
function updateEventOnDropResize(event, allDay) { function updateEventOnDropResize(event, allDay) {
//alert("allday: " + allDay);
var eventToUpdate = { var eventToUpdate = {
id: event.id, id: event.id,
start: event.start start: event.start
@@ -525,8 +538,6 @@
else { else {
eventToUpdate.end = event.end; eventToUpdate.end = event.end;
} }
// FullCalendar 2.x
var endDate; var endDate;
if (!event.allDay) { if (!event.allDay) {
endDate = new Date(eventToUpdate.end + 60 * 60000); endDate = new Date(eventToUpdate.end + 60 * 60000);
@@ -578,8 +589,8 @@
}; };
} }
$('#calendar').fullCalendar('destroy'); // destroy the calendar $('#calendar').fullCalendar('destroy');
$('#calendar').fullCalendar({ //re-initialize the calendar $('#calendar').fullCalendar({
header: h, header: h,
monthNames: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], monthNames: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'], monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],

View File

@@ -18,6 +18,15 @@ Partial Class RepContratosCalendario
ViewState("DtAvance") = value ViewState("DtAvance") = value
End Set End Set
End Property End Property
Public Property Contrato As String
Get
Return ViewState("Contrato").ToString()
End Get
Set(value As String)
ViewState("Contrato") = value
End Set
End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -35,13 +44,15 @@ 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
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=34) Then If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=34) Then
GvContratos.DataSource = ObjContratos.DtResultados GvContratos.DataSource = ObjContratos.DtResultados
DtAvance = ObjContratos.DtResultados
GvContratos.DataBind() GvContratos.DataBind()
GvContratos.HeaderStyle.ForeColor = Drawing.Color.Black
End If End If
DtAvance = ObjContratos.DtResultados
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
DdlEstatusConsulta.DataSource = ObjContratos.DtResultados DdlEstatusConsulta.DataSource = ObjContratos.DtResultados
DdlEstatusConsulta.DataBind() DdlEstatusConsulta.DataBind()
@@ -70,15 +81,15 @@ Partial Class RepContratosCalendario
'Lista de Activos fijos 'Lista de Activos fijos
DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa) DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
DdlAF.DataBind() DdlAF.DataBind()
DdlAF.Items.Insert(0, New ListItem("-", "0")) DdlAF.Items.Insert(0, New ListItem("-", ""))
'Lista Chofer' 'Lista Chofer'
DdlChofer.DataSource = GlobalDTRHPersonal(185) DdlChofer.DataSource = GlobalDTRHPersonal(185)
DdlChofer.DataBind() DdlChofer.DataBind()
DdlChofer.Items.Insert(0, New ListItem("-", "0")) DdlChofer.Items.Insert(0, New ListItem("-", ""))
DdlChofer1.DataSource = GlobalDTRHPersonal(185) DdlChofer2.DataSource = GlobalDTRHPersonal(185)
DdlChofer1.DataBind() DdlChofer2.DataBind()
DdlChofer1.Items.Insert(0, New ListItem("-", "0")) DdlChofer2.Items.Insert(0, New ListItem("-", ""))
End Sub End Sub
@@ -94,12 +105,10 @@ Partial Class RepContratosCalendario
Protected Sub UpdateContrato(sender As Object, e As EventArgs) Protected Sub UpdateContrato(sender As Object, e As EventArgs)
Dim fechaS As Date = TxtFechaSalida.Text.ToDate
Dim fechaR As Date = TxtFechaRegreso.Text.ToDate
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL() ObjContratos.IniciaTransacSQL()
If ObjContratos.UpdateContratos(CveContrato.Value.ToEntero, "", TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, fechaS, fechaR, 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:=2, CveContratosEstatus:=1, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlTipoAF.SelectedValue.ToEntero) Then If ObjContratos.UpdateContratos(Contrato.ToEntero, TxtFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, CveContratosEstatus:=DdlEstatusContrato.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero) Then
ObjContratos.Commit() ObjContratos.Commit()
Alert("Actualizado Correctamente.") Alert("Actualizado Correctamente.")
Else Else
@@ -107,21 +116,25 @@ Partial Class RepContratosCalendario
End If End If
ObjContratos.Dispose() ObjContratos.Dispose()
UpTitulos.Update()
CargaDatos() CargaDatos()
End Sub End Sub
Protected Sub UpdateModal(sender As Object, e As EventArgs) Protected Sub UpdateModal(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
TxtFolio.Text = GvRow.DataKey("NumeroContrato")
TxtObservaciones.Text = GvRow.DataKey("Observaciones") TxtCantidadPasajeros.Text = GvRow.DataKey("CantidadPasajeros")
DdlClientes.SelectedValue = GvRow.DataKey("CveCliente")
DdlClientes.SelectedText = GvRow.DataKey("NombreComercial")
TxtDescripcion.Text = GvRow.DataKey("DescripcionContrato") TxtDescripcion.Text = GvRow.DataKey("DescripcionContrato")
TxtObservaciones.Text = GvRow.DataKey("Observaciones")
TxtUbicacion.Text = GvRow.DataKey("Ubicacion") TxtUbicacion.Text = GvRow.DataKey("Ubicacion")
TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy hh:mm:ss tt") TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy hh:mm:ss tt")
TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy hh:mm:ss tt") TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy hh:mm:ss tt")
DdlClientes.SelectedValue = GvRow.DataKey("CveCliente") 'Requeridos
DdlClientes.SelectedText = GvRow.DataKey("NombreComercial") ViewState("Contrato") = GvRow.DataKey("CveContrato")
DdlAF.SelectedValue = GvRow.DataKey("CveAF") DdlAF.SelectedValue = GvRow.DataKey("CveAF")
DdlChofer.SelectedValue = GvRow.DataKey("CveChofer") DdlChofer.SelectedValue = GvRow.DataKey("CveChofer")
DdlChofer.SelectedValue = GvRow.DataKey("CveChofer2") DdlChofer2.SelectedValue = GvRow.DataKey("CveChofer2")
DdlEstatusContrato.SelectedValue = GvRow.DataKey("CveContratosEstatus") DdlEstatusContrato.SelectedValue = GvRow.DataKey("CveContratosEstatus")
UpModal.Update() UpModal.Update()
@@ -213,4 +226,9 @@ Partial Class RepContratosCalendario
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If End If
End Sub End Sub
Protected Sub GoContratoDetalle(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveContrato As String = GvRow.DataKey("CveContrato")
Response.Redirect(String.Format("~/Transportes/RepContratoDetalle.aspx?CveContrato={0}", CveContrato))
End Sub
End Class End Class

View File

@@ -235,6 +235,5 @@ Partial Class ListadoViajes
Dim CveViaje As String = GvRow.DataKey("CveViaje") Dim CveViaje As String = GvRow.DataKey("CveViaje")
Dim Ruta As String = GvRow.DataKey("Ruta") Dim Ruta As String = GvRow.DataKey("Ruta")
Response.Redirect(String.Format("~/Transportes/RepBoletos.aspx?CveViaje={0}&Ruta={1}", CveViaje, Ruta)) Response.Redirect(String.Format("~/Transportes/RepBoletos.aspx?CveViaje={0}&Ruta={1}", CveViaje, Ruta))
End Sub End Sub
End Class End Class