--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.CveCliente = dr("CveCliente").ToString.ToEntero
|
||||
cevent.NombreAcercamiento = dr("Ubicacion").ToString
|
||||
cevent.CveActivoFijo = dr("CveTipoAF").ToString.ToEntero
|
||||
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
|
||||
cevent.CvePersonal = dr("CveChofer").ToString.ToEntero
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:Panel ID="PnlGeneral" runat="server">
|
||||
<contenttemplate>
|
||||
<%--Calendario Tab--%>
|
||||
<ajax:TabContainer ID="Tab" runat="server" Width="100%" ActiveTabIndex="0">
|
||||
|
||||
@@ -112,11 +111,12 @@
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabContainer>
|
||||
</contenttemplate>
|
||||
</asp:Panel>
|
||||
|
||||
|
||||
<div id="ModalActualizar" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel runat="server" ID="UpModal" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-dialog">
|
||||
<div id="UpAddChofer" class="modal-content rowpadding" tabindex="-1"
|
||||
runat="server">
|
||||
@@ -130,9 +130,11 @@
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="portlet-body">
|
||||
<div class="row my-1" id="TrCliente" runat="server">
|
||||
<label class="col-md-4 bold">
|
||||
<asp:Label ID="Label1" runat="server" Text="Cliente:"></asp:Label></label><div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label>Cliente</label>
|
||||
</div>
|
||||
<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"></ADS:Dropdownlost>
|
||||
@@ -205,8 +207,8 @@
|
||||
<asp:Label runat="server" Text="Transporte:"></asp:Label></label><div
|
||||
class="col-md-8">
|
||||
|
||||
<asp:DropDownList ID="DdlTransporte" AppendDataBoundItems="true" DataTextField="Descripcion"
|
||||
DataValueField="CveTipoActivoFijo" Class="table-group-action-input form-control input-inline text-center"
|
||||
<asp:DropDownList ID="DdlTransporte" AppendDataBoundItems="true" DataValueField="CveActivoFijo"
|
||||
DataTextField="Descripcion" Class="table-group-action-input form-control input-inline text-center"
|
||||
Width="200px" runat="server">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVTransporte" runat="server" ControlToValidate="DdlTransporte"
|
||||
@@ -273,24 +275,24 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnActualizar" OnClick="UpdateContrato" runat="server" CssClass="btn btn-primary"
|
||||
Text="Guardar"
|
||||
Text="Editar"
|
||||
ValidationGroup="GrpGuardar"></asp:Button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</contenttemplate>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div style="display: none">
|
||||
|
||||
<asp:UpdatePanel ID="UpCommando" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button runat="server" ID="BtnModal" OnClick="MostrarModal"></asp:Button>
|
||||
<asp:HiddenField runat="server" ID="CveContrato" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
@@ -327,6 +329,7 @@
|
||||
$('#<%=TxtDolares.ClientID%>').val(event.Dolares);
|
||||
$('#<%=TxtPesos.ClientID%>').val(event.Pesos);
|
||||
$('#<%=TxtAnticipo.ClientID%>').val(event.Anticipo);
|
||||
$('#<%=CveContrato.ClientID%>').val(event.id);
|
||||
|
||||
$('#<%=BtnModal.ClientID%>').click();
|
||||
}
|
||||
@@ -437,7 +440,6 @@
|
||||
eventDrop: eventDropped,
|
||||
eventResize: eventResized
|
||||
});
|
||||
clickSemana();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -7,14 +7,6 @@ Partial Class RepContratosCalendario
|
||||
Inherits ClsPaginas
|
||||
|
||||
#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
|
||||
|
||||
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
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
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()
|
||||
Alert("Actualizado Correctamente.")
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
Alert($"Ocurrió un error {ex}", TipoMensaje.MsgError)
|
||||
Alert("Ocurrió un error al actualizar el contrato", TipoMensaje.MsgError)
|
||||
ObjContratos.RollBack()
|
||||
Finally
|
||||
ObjContratos.Dispose()
|
||||
CargaDatos()
|
||||
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user