--
This commit is contained in:
@@ -4,7 +4,6 @@ Option Explicit On
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports Extensiones
|
||||
Imports Profact.TimbraCFDI40
|
||||
|
||||
Public Class ClsContratos
|
||||
Implements IDisposable
|
||||
@@ -323,7 +322,7 @@ Public Class ClsContratos
|
||||
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
|
||||
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "",
|
||||
Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False, Optional DiaMesFacturacion As Integer = 1, Optional ObservacionesGenerales As String = "",
|
||||
Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional CveAF As Integer = -1) As Integer
|
||||
Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional CveAF As Integer = -1, Optional CantidadPasajeros As Integer = -1) As Integer
|
||||
|
||||
Dim Retorno As Integer = -1
|
||||
DataAdapter("PA_Con_ContratosAdd")
|
||||
@@ -382,6 +381,7 @@ Public Class ClsContratos
|
||||
.Add("@CveTipoAF", SqlDbType.Int).Value = CveTipoAF
|
||||
.Add("@CveChofer", SqlDbType.Int).Value = CveChofer
|
||||
.Add("@CveAF", SqlDbType.Int).Value = CveAF
|
||||
.Add("@CantidadPasajeros", SqlDbType.Int).Value = CantidadPasajeros
|
||||
|
||||
End With
|
||||
|
||||
|
||||
@@ -10812,6 +10812,7 @@ Public Class ClsPaginas
|
||||
|
||||
#Region "Transportes"
|
||||
PaginaDict.Add("/Transportes/RepContratos.aspx".ToUpper(), 598)
|
||||
PaginaDict.Add("/Transportes/RepContratosDetalles.aspx".ToUpper(), 598)
|
||||
PaginaDict.Add("/Transportes/RepViajes.aspx".ToUpper(), 599)
|
||||
PaginaDict.Add("/Transportes/Boletos.aspx".ToUpper(), 600)
|
||||
PaginaDict.Add("/Transportes/RepBoletos.aspx".ToUpper(), 601)
|
||||
|
||||
@@ -457,8 +457,6 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
|
||||
For Each dr As DataRow In ObjContratos.DtResultados.Rows
|
||||
Dim cevent As CalendarEvent = New CalendarEvent()
|
||||
|
||||
Dim estatus As Integer = dr("EstatusContrato").ToString.ToEntero
|
||||
|
||||
cevent.id = dr("CveContrato").ToString.ToEntero
|
||||
cevent.title = dr("DescripcionContrato").ToString
|
||||
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
|
||||
@@ -471,15 +469,8 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
|
||||
cevent.Pesos = dr("ImporteMax").ToString.ToDecimal
|
||||
cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal
|
||||
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
|
||||
cevent.backgroundColor = dr("BackgroundColor").ToString
|
||||
|
||||
Select Case estatus
|
||||
Case 1
|
||||
cevent.backgroundColor = "#00A56A"
|
||||
Case 2
|
||||
cevent.backgroundColor = "#2B4FD6"
|
||||
Case 3
|
||||
cevent.backgroundColor = "#EE602E"
|
||||
End Select
|
||||
|
||||
|
||||
|
||||
|
||||
361
Transportes/RepContratos - Copy.aspx
Normal file
361
Transportes/RepContratos - Copy.aspx
Normal file
@@ -0,0 +1,361 @@
|
||||
<%@ 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">×</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>
|
||||
|
||||
|
||||
159
Transportes/RepContratos - Copy.aspx.vb
Normal file
159
Transportes/RepContratos - Copy.aspx.vb
Normal file
@@ -0,0 +1,159 @@
|
||||
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
|
||||
@@ -13,24 +13,6 @@
|
||||
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;
|
||||
@@ -70,52 +52,49 @@
|
||||
</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>
|
||||
<%-- Filtros --%>
|
||||
<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>
|
||||
<asp:TextBox Width="150px" ID="txtFechaI" runat="server" CssClass="form-control"
|
||||
type="datetime"
|
||||
MaxLength="10"></asp:TextBox>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="consulta_campo">
|
||||
<label>Fecha Inicial:</label>
|
||||
<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>
|
||||
<asp:TextBox Width="150px" ID="txtFechaF" runat="server" CssClass="form-control"
|
||||
type="datetime"
|
||||
MaxLength="10"></asp:TextBox>
|
||||
|
||||
</div>
|
||||
</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>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"
|
||||
AppendDataBoundItems="true"
|
||||
Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:Button ID="BtnConsulta" runat="server" Text="Consultar" class="btn btn-primary"
|
||||
OnClick="Consultar"
|
||||
ValidationGroup="GrpConsulta" />
|
||||
<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>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<asp:Button ID="BtnConsulta" runat="server" Text="Consultar" class="btn btn-primary"
|
||||
OnClick="Consultar" />
|
||||
</div>
|
||||
<%-- Listado de Contratos --%>
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
|
||||
@@ -169,7 +148,7 @@
|
||||
<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) %>'>
|
||||
Text='<%# Eval("ContratoEstatus") %>' Style='<%# "color:" + If(Eval("BackgroundColor") IsNot DBNull.Value, Eval("BackgroundColor").ToString(), String.Empty) %>'>
|
||||
</asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -177,13 +156,12 @@
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%-- Modal --%>
|
||||
<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">×</span>
|
||||
@@ -192,23 +170,26 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:Label runat="server" ID="LbFolio" Text="Folio"></asp:Label>
|
||||
<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%;"
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="86%" data-metodo="getcliente"
|
||||
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 86%;"
|
||||
UsaWebService="true" Enabled="false"></ADS:Dropdownlost>
|
||||
<asp:LinkButton runat="server" CssClass="btn btn-primary fa-add" Width="12%"
|
||||
PostBackUrl="~/Ventas/Clientes.aspx?CveCliente=-1"></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label class="col-md-4">Servicio:</label>
|
||||
<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."
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Servicio''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDescripcion" runat="server" HighlightCssClass="vco"
|
||||
TargetControlID="RFVDescripcion" Width="100%">
|
||||
@@ -217,35 +198,23 @@
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Observaciones:</label>
|
||||
<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>
|
||||
<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>
|
||||
<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%"
|
||||
@@ -260,7 +229,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label class="col-md-4">Fecha Regreso:</label>
|
||||
<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%"
|
||||
@@ -274,78 +243,68 @@
|
||||
</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>
|
||||
<label class="col-md-4">Cantidad de pasajeros</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>
|
||||
|
||||
|
||||
<asp:TextBox ID="TxtCantidadPasajeros" CssStyle="col-md-8 form-control" runat="server"
|
||||
type="number"
|
||||
Width="100%"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCantidadPasajeros" runat="server" ControlToValidate="TxtCantidadPasajeros"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad de pasajeros''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECantidadPasajeros" runat="server" HighlightCssClass="VCOCantidadPasajeros"
|
||||
TargetControlID="RFVCantidadPasajeros" Width="100%">
|
||||
</ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Costo pesos:</label>
|
||||
<label class="col-md-4">Tipo Unidad</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="RFVTipoAF" runat="server" ControlToValidate="DdlTipoAF"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Unidad''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETipoAF" runat="server" HighlightCssClass="vco"
|
||||
TargetControlID="RFVTipoAF" 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>
|
||||
<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"
|
||||
Text="Agregar"
|
||||
ValidationGroup="GrpGuardar"></asp:Button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
|
||||
@@ -7,20 +7,11 @@ 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("yyyy-MM-dd").Replace(" ", "T")
|
||||
txtFechaF.Text = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd").Replace(" ", "T")
|
||||
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
|
||||
@@ -30,41 +21,32 @@ Partial Class ListadoContratos
|
||||
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
|
||||
|
||||
|
||||
Dim ObjFolio As New ClsGralFolios
|
||||
If ObjFolio.GetFolios("Con", UsuarioActual.CveEmpresa, CveSubProyecto:=10) Then
|
||||
If ObjFolio.DtResultados.FiltraParametros($"CveSubProyecto = 10").Rows.Count > 0 Then
|
||||
LbFolio.Text = $"{GlobalDTSubProyectos(-1, 10).FiltroPrimeroValor("Serie")}-{ObjFolio.DtResultados.FiltroPrimeroValor("FActual", $"CveSubProyecto = {10}")}"
|
||||
End If
|
||||
End If
|
||||
GvContratos.DataBind()
|
||||
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()
|
||||
Protected Sub MostrarModal()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
|
||||
End Sub
|
||||
Private Sub LBAgregarContrato_Click(sender As Object, e As EventArgs) Handles LBAgregarContrato.Click
|
||||
@@ -80,22 +62,9 @@ Partial Class ListadoContratos
|
||||
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
|
||||
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, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text) > 0 Then
|
||||
ObjContratos.Commit()
|
||||
Alert("Agregado Correctamente.")
|
||||
End If
|
||||
|
||||
TxtDescripcion.Text = ""
|
||||
@@ -105,13 +74,13 @@ Partial Class ListadoContratos
|
||||
TxtUbicacion.Text = ""
|
||||
DdlClientes.SelectedText = ""
|
||||
DdlTipoAF.SelectedValue = ""
|
||||
DdlChofer.SelectedValue = ""
|
||||
TxtDolares.Text = ""
|
||||
TxtPesos.Text = ""
|
||||
TxtAnticipo.Text = ""
|
||||
BtnGuardar.Text = "Guardar"
|
||||
TxtCantidadPasajeros.Text = ""
|
||||
|
||||
ObjContratos.Dispose()
|
||||
UpModal.Update()
|
||||
CargaDatos()
|
||||
|
||||
End Sub
|
||||
@@ -121,26 +90,26 @@ Partial Class ListadoContratos
|
||||
End Sub
|
||||
|
||||
Protected Sub Consultar(sender As Object, e As EventArgs)
|
||||
Dim fechaInicial As String = txtFechaI.Text
|
||||
Dim fechaFinal As String = txtFechaF.Text
|
||||
|
||||
If DdlClientesConsulta.SelectedValue = "" Then
|
||||
Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
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 cliente As Integer = DdlClientesConsulta.SelectedValue.ToEntero
|
||||
Dim estatus As Integer = DdlEstatusConsulta.SelectedValue.ToEntero
|
||||
Dim fechaInicial As DateTime = txtFechaI.Text.ToDate
|
||||
Dim fechaFinal As DateTime = txtFechaF.Text.ToDate
|
||||
|
||||
Dim query As String = "SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente WHERE C.CveCliente = @Cliente AND EstatusContrato = @Estatus AND 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)
|
||||
command.Parameters.AddWithValue("@Cliente", cliente)
|
||||
command.Parameters.AddWithValue("@Estatus", estatus)
|
||||
command.Parameters.AddWithValue("@FechaInicial", fechaInicial)
|
||||
command.Parameters.AddWithValue("@FechaFinal", fechaFinal)
|
||||
|
||||
connection.Open()
|
||||
Dim reader As SqlDataReader = command.ExecuteReader()
|
||||
GvContratos.DataSource = reader
|
||||
@@ -150,4 +119,5 @@ Partial Class ListadoContratos
|
||||
|
||||
UpTitulos.Update()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar" CssClass="miGrid"
|
||||
OnClick="UpdateModal" Text="Editar" />
|
||||
OnClick="UpdateModal" Text="Actualizar Contrato" />
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -236,7 +236,7 @@
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel" runat="server">Editar Contrato</h4>
|
||||
<h4 class="modal-title" id="myModalLabel" runat="server">Actualizar Contrato</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
@@ -323,7 +323,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Chofer</label>
|
||||
<label class="col-md-4">Chofer 1</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"
|
||||
@@ -338,6 +338,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Chofer 2</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlChofer1" 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="RFVChofer1" runat="server" ControlToValidate="DdlChofer1"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer1''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEChofer1" runat="server" HighlightCssClass="vco"
|
||||
TargetControlID="RFVChofer1" Width="400px">
|
||||
</ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row hidden">
|
||||
<label class="col-md-4">Costo dólares:</label>
|
||||
<div class="col-md-8">
|
||||
@@ -373,7 +389,7 @@
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnGuardar" OnClick="UpdateContrato" runat="server" CssClass="btn btn-primary"
|
||||
Text="Editar"
|
||||
Text="Actualizar"
|
||||
ValidationGroup="GrpGuardar"></asp:Button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
@@ -415,11 +431,12 @@
|
||||
}
|
||||
|
||||
function updateEvent(event, element) {
|
||||
console.log(event)
|
||||
$('#<%=TxtObservaciones.ClientID%>').val(event.title);
|
||||
$('#<%=TxtDescripcion.ClientID%>').val(event.title);
|
||||
$('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento);
|
||||
$('#<%=TxtFechaSalida.ClientID.ToString%>').val(event.start._i);
|
||||
$('#<%=TxtFechaRegreso.ClientID.ToString%>').val(event.end._i);
|
||||
$('#<%=TxtFechaSalida.ClientID%>').val(event.start._i);
|
||||
$('#<%=TxtFechaRegreso.ClientID%>').val(event.end._i);
|
||||
$('#<%=DdlClientes.ClientID%>').val(event.CveCliente);
|
||||
$('#<%=DdlAF.ClientID%>').val(event.CveActivoFijo);
|
||||
$('#<%=DdlChofer.ClientID%>').val(event.CvePersonal);
|
||||
|
||||
@@ -11,8 +11,8 @@ Partial Class RepContratosCalendario
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd").Replace(" ", "T")
|
||||
txtFechaF.Text = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd").Replace(" ", "T")
|
||||
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
|
||||
CargaCombos()
|
||||
@@ -66,6 +66,9 @@ Partial Class RepContratosCalendario
|
||||
DdlChofer.DataSource = GlobalDTRHPersonal(185)
|
||||
DdlChofer.DataBind()
|
||||
DdlChofer.Items.Insert(0, New ListItem("-", ""))
|
||||
DdlChofer1.DataSource = GlobalDTRHPersonal(185)
|
||||
DdlChofer1.DataBind()
|
||||
DdlChofer1.Items.Insert(0, New ListItem("-", ""))
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -80,25 +83,26 @@ Partial Class RepContratosCalendario
|
||||
End Sub
|
||||
|
||||
Protected Sub Consultar(sender As Object, e As EventArgs)
|
||||
If DdlClientesConsulta.SelectedValue = "" Then
|
||||
Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
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 cliente As Integer = DdlClientesConsulta.SelectedValue.ToEntero
|
||||
Dim estatus As Integer = DdlEstatusConsulta.SelectedValue.ToEntero
|
||||
Dim fechaInicial As DateTime = txtFechaI.Text.ToDate
|
||||
Dim fechaFinal As DateTime = txtFechaF.Text.ToDate
|
||||
|
||||
Dim query As String = "SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial, RH.NombreCompleto AS NombreCompleto FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente LEFT JOIN RH_Personal RH with(nolock) ON C.CveChofer = RH.CvePersonal WHERE C.CveCliente = @Cliente AND EstatusContrato = @Estatus AND FechaInicial BETWEEN @FechaInicial AND @FechaFinal"
|
||||
Dim query As String = $"SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreCompleto {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)
|
||||
command.Parameters.AddWithValue("@Cliente", cliente)
|
||||
command.Parameters.AddWithValue("@Estatus", estatus)
|
||||
command.Parameters.AddWithValue("@FechaInicial", fechaInicial)
|
||||
command.Parameters.AddWithValue("@FechaFinal", fechaFinal)
|
||||
|
||||
connection.Open()
|
||||
Dim reader As SqlDataReader = command.ExecuteReader()
|
||||
GvContratos.DataSource = reader
|
||||
@@ -109,11 +113,12 @@ Partial Class RepContratosCalendario
|
||||
UpTitulos.Update()
|
||||
End Sub
|
||||
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
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
|
||||
If ObjContratos.UpdateContratoAF(CveContrato.Value.ToEntero, DdlAF.SelectedValue.ToEntero, DdlChofer.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
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
|
||||
ObjContratos.Commit()
|
||||
Alert("Actualizado Correctamente.")
|
||||
Else
|
||||
@@ -129,8 +134,8 @@ Partial Class RepContratosCalendario
|
||||
TxtObservaciones.Text = GvRow.DataKey("Observaciones")
|
||||
TxtDescripcion.Text = GvRow.DataKey("DescripcionContrato")
|
||||
TxtUbicacion.Text = GvRow.DataKey("Ubicacion")
|
||||
TxtFechaSalida.Text = GvRow.DataKey("FechaInicial").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||
TxtFechaRegreso.Text = GvRow.DataKey("FechaFinal").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
|
||||
TxtFechaSalida.Text = GvRow.DataKey("FechaInicial").ToDateTime.ToString("MM/dd/yyyy")
|
||||
TxtFechaRegreso.Text = GvRow.DataKey("FechaFinal").ToDateTime.ToString("MM/dd/yyyy")
|
||||
DdlClientes.SelectedValue = GvRow.DataKey("CveCliente")
|
||||
DdlAF.SelectedValue = GvRow.DataKey("CveAF")
|
||||
DdlChofer.SelectedValue = GvRow.DataKey("CveChofer")
|
||||
|
||||
Reference in New Issue
Block a user