--Se hace cambio en CargaEventos para acceder a la CveAF. Se hace cambio igual en valores del DdlTransporte , agrega un valor oculto para guardar la clave del contrato para poder editarlo y se guarda el valor al abrir el modal. Se elimina la propiedad CveContrato, ya que se cambia por el valor oculto, se eliminan las partes para guardar un contrato nuevo, ya que no se usan y se simplifica al simple retorno del método UpdateContratos
This commit is contained in:
@@ -528,7 +528,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
|
|||||||
cevent.allDay = False
|
cevent.allDay = False
|
||||||
cevent.CveCliente = dr("CveCliente").ToString.ToEntero
|
cevent.CveCliente = dr("CveCliente").ToString.ToEntero
|
||||||
cevent.NombreAcercamiento = dr("Ubicacion").ToString
|
cevent.NombreAcercamiento = dr("Ubicacion").ToString
|
||||||
cevent.CveActivoFijo = dr("CveTipoAF").ToString.ToEntero
|
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
|
||||||
cevent.CvePersonal = dr("CveChofer").ToString.ToEntero
|
cevent.CvePersonal = dr("CveChofer").ToString.ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
<asp:Content ID="Content4" ContentPlaceHolderID="C" runat="Server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="C" runat="Server">
|
||||||
<asp:Panel ID="PnlGeneral" runat="server">
|
<asp:Panel ID="PnlGeneral" runat="server">
|
||||||
<contenttemplate>
|
|
||||||
<%--Calendario Tab--%>
|
<%--Calendario Tab--%>
|
||||||
<ajax:TabContainer ID="Tab" runat="server" Width="100%" ActiveTabIndex="0">
|
<ajax:TabContainer ID="Tab" runat="server" Width="100%" ActiveTabIndex="0">
|
||||||
|
|
||||||
@@ -112,11 +111,12 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</ajax:TabPanel>
|
</ajax:TabPanel>
|
||||||
</ajax:TabContainer>
|
</ajax:TabContainer>
|
||||||
</contenttemplate>
|
|
||||||
</asp:Panel>
|
</asp:Panel>
|
||||||
|
|
||||||
|
|
||||||
<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">
|
||||||
|
<ContentTemplate>
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div id="UpAddChofer" class="modal-content rowpadding" tabindex="-1"
|
<div id="UpAddChofer" class="modal-content rowpadding" tabindex="-1"
|
||||||
runat="server">
|
runat="server">
|
||||||
@@ -130,9 +130,11 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<div class="row my-1" id="TrCliente" runat="server">
|
<div class="row">
|
||||||
<label class="col-md-4 bold">
|
<div class="col-md-4">
|
||||||
<asp:Label ID="Label1" runat="server" Text="Cliente:"></asp:Label></label><div class="col-md-8">
|
<label>Cliente</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-8">
|
||||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente"
|
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente"
|
||||||
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"
|
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"
|
||||||
UsaWebService="true"></ADS:Dropdownlost>
|
UsaWebService="true"></ADS:Dropdownlost>
|
||||||
@@ -205,8 +207,8 @@
|
|||||||
<asp:Label runat="server" Text="Transporte:"></asp:Label></label><div
|
<asp:Label runat="server" Text="Transporte:"></asp:Label></label><div
|
||||||
class="col-md-8">
|
class="col-md-8">
|
||||||
|
|
||||||
<asp:DropDownList ID="DdlTransporte" AppendDataBoundItems="true" DataTextField="Descripcion"
|
<asp:DropDownList ID="DdlTransporte" AppendDataBoundItems="true" DataValueField="CveActivoFijo"
|
||||||
DataValueField="CveTipoActivoFijo" Class="table-group-action-input form-control input-inline text-center"
|
DataTextField="Descripcion" Class="table-group-action-input form-control input-inline text-center"
|
||||||
Width="200px" runat="server">
|
Width="200px" runat="server">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RFVTransporte" runat="server" ControlToValidate="DdlTransporte"
|
<asp:RequiredFieldValidator ID="RFVTransporte" runat="server" ControlToValidate="DdlTransporte"
|
||||||
@@ -273,24 +275,24 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<asp:Button ID="BtnActualizar" OnClick="UpdateContrato" runat="server" CssClass="btn btn-primary"
|
<asp:Button ID="BtnActualizar" OnClick="UpdateContrato" runat="server" CssClass="btn btn-primary"
|
||||||
Text="Guardar"
|
Text="Editar"
|
||||||
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>
|
||||||
</contenttemplate>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div style="display: none">
|
<div style="display: none">
|
||||||
|
|
||||||
<asp:UpdatePanel ID="UpCommando" runat="server">
|
<asp:UpdatePanel ID="UpCommando" runat="server">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:Button runat="server" ID="BtnModal" OnClick="MostrarModal"></asp:Button>
|
<asp:Button runat="server" ID="BtnModal" OnClick="MostrarModal"></asp:Button>
|
||||||
|
<asp:HiddenField runat="server" ID="CveContrato" Value="-1" ClientIDMode="Static" />
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
@@ -327,6 +329,7 @@
|
|||||||
$('#<%=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);
|
||||||
|
$('#<%=CveContrato.ClientID%>').val(event.id);
|
||||||
|
|
||||||
$('#<%=BtnModal.ClientID%>').click();
|
$('#<%=BtnModal.ClientID%>').click();
|
||||||
}
|
}
|
||||||
@@ -437,7 +440,6 @@
|
|||||||
eventDrop: eventDropped,
|
eventDrop: eventDropped,
|
||||||
eventResize: eventResized
|
eventResize: eventResized
|
||||||
});
|
});
|
||||||
clickSemana();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -7,14 +7,6 @@ Partial Class RepContratosCalendario
|
|||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
|
|
||||||
#Region "PROPIEDADES"
|
#Region "PROPIEDADES"
|
||||||
Private Property CveContrato As Integer
|
|
||||||
Get
|
|
||||||
Return ViewState("CveContrato").ToString().ToEntero
|
|
||||||
End Get
|
|
||||||
Set(value As Integer)
|
|
||||||
ViewState("CveContrato") = 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
|
||||||
@@ -71,33 +63,19 @@ Partial Class RepContratosCalendario
|
|||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
ObjContratos.IniciaTransacSQL()
|
ObjContratos.IniciaTransacSQL()
|
||||||
Try
|
Try
|
||||||
|
If ObjContratos.UpdateContratos(CveContrato.Value.ToEntero, "", 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:=DdlTransporte.SelectedValue.ToEntero) Then
|
||||||
|
|
||||||
Dim CveEstatusInicial As Integer = 10
|
|
||||||
Dim CveContratoHijo As Integer = -1
|
|
||||||
Dim CveContratoTipo As Integer = 2
|
|
||||||
Dim retorno As Boolean = False
|
|
||||||
|
|
||||||
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
|
||||||
CveEstatusInicial = ObjContratos.DtResultados.FiltroPrimeroValor("CveContratoEstatus", "TipoEstatus=1").ToEntero
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Actualizar contrato
|
|
||||||
If BtnActualizar.Text = "Editar" Then
|
|
||||||
retorno = 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)
|
|
||||||
End If
|
|
||||||
|
|
||||||
If retorno Then
|
|
||||||
ObjContratos.Commit()
|
ObjContratos.Commit()
|
||||||
Alert("Actualizado Correctamente.")
|
Alert("Actualizado Correctamente.")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Alert($"Ocurrió un error {ex}", TipoMensaje.MsgError)
|
Alert("Ocurrió un error al actualizar el contrato", TipoMensaje.MsgError)
|
||||||
ObjContratos.RollBack()
|
ObjContratos.RollBack()
|
||||||
Finally
|
Finally
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
|
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Reference in New Issue
Block a user