-- permiso para cancelación de contratos

This commit is contained in:
2024-07-06 09:43:24 -07:00
parent 3280d0e04e
commit 1982ec4aa6
2 changed files with 21 additions and 13 deletions

View File

@@ -447,7 +447,7 @@
<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"
<asp:DropDownList ID="DdlEstatusContrato" Enabled="false" runat="server" Class="table-group-action-input form-control input-inline select2me"
AppendDataBoundItems="true" DataValueField="CveContratoEstatus"
DataTextField="ContratoEstatus"
Width="100%">
@@ -494,7 +494,7 @@
<asp:UpdatePanel ID="UpCommando" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button runat="server" ID="BtnModal" OnClick="MostrarModal"></asp:Button>
<asp:HiddenField runat="server" ID="CveContrato" Value="-1" ClientIDMode="Static" />
<asp:HiddenField runat="server" ID="HdnCveContrato" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
@@ -726,7 +726,7 @@
$('#<%=TxtDolares.ClientID%>').val(event.Dolares);
$('#<%=TxtPesos.ClientID%>').val(event.Pesos);
$('#<%=TxtAnticipo.ClientID%>').val(event.Anticipo);
$('#<%=CveContrato.ClientID%>').val(event.id);
$('#<%=HdnCveContrato.ClientID%>').val(event.id);
if (event.NombreComercial !== null) {

View File

@@ -28,6 +28,16 @@ Partial Class RepContratosCalendario
ViewState("Contrato") = value
End Set
End Property
Public Property CveContrato As Integer
Get
Return IfNull(ViewState("CveContrato"), "").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveContrato") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -53,6 +63,8 @@ Partial Class RepContratosCalendario
End If
GvContratos.DataSource = DtAvance
DdlEstatusContrato.Enabled = UsuarioActual.TienePermisoProceso(173)
ObjContratos.Dispose()
GvContratos.DataBind()
UpTitulos.Update()
@@ -77,7 +89,8 @@ Partial Class RepContratosCalendario
'DATOS
Dim strAF As New StringBuilder
For Each Row As DataRow In DtAvance.FiltraParametros("CodigoAF <> ''").Rows
'se quitan los estatus cancelados
For Each Row As DataRow In DtAvance.FiltraParametros("CodigoAF <> '' AND TipoEstatus <> 3").Rows
Dim obj As New JObject(
New JProperty("category", Row("CodigoAF")),
New JProperty("fromDate", Row("FechaInicial").ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm").ToDateTime()),
@@ -171,7 +184,6 @@ Partial Class RepContratosCalendario
End Sub
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
If HidModClienteNombre.Value = "" Then
HidModClienteNombre.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, HidModCveCliente.Value.ToEntero).FiltroPrimeroValor("NombreComercial")
End If
@@ -182,8 +194,6 @@ Partial Class RepContratosCalendario
DdlClientes.txtText.Value = HidModClienteNombre.Value
DdlClientes.txtValue.Value = HidModCveCliente.Value
UpModal.Update()
RegistraScript("$('#ModalActualizar').modal('show');")
@@ -192,11 +202,9 @@ Partial Class RepContratosCalendario
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL()
Contrato = CveContrato.Value
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.IniciaTransacSQL()
If ObjContratos.UpdateContratos(CveContrato, 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()
Alert("Actualizado Correctamente.")
Else
@@ -221,7 +229,7 @@ Partial Class RepContratosCalendario
TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy hh:mm tt")
TxtMoneda.Text = GvRow.DataKey("CveMoneda")
'Requeridos
ViewState("Contrato") = GvRow.DataKey("CveContrato")
ViewState("CveContrato") = GvRow.DataKey("CveContrato")
DdlAF.SelectedValue = GvRow.DataKey("CveAF")
DdlChofer.SelectedValueExist(GvRow.DataKey("CveChofer"))
DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2"))