214 lines
10 KiB
Plaintext
214 lines
10 KiB
Plaintext
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.master" CodeBehind="datosPersonales.aspx.vb" Inherits="WebIntranet.datosPersonales" %>
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="server">
|
|
<div id="divCambiarIBAN" style="display:none;">
|
|
<div id="divIBAN">
|
|
<p>nuevo IBAN:</p>
|
|
<div style="display:flex; flex-direction:column; gap:5px;">
|
|
<label for="inpBIC" class="lblGeneral">Código SWIFT / BIC</label>
|
|
<input type="text" id="inpBIC" runat="server" />
|
|
<label for="inpDescBIC" class="lblGeneral">Descripción BIC</label>
|
|
<input type="text" id="inpDescBIC" runat="server"/>
|
|
<label for="inpEnt" class="lblGeneral">Entidad</label>
|
|
<input type="text" id="inpEnt" runat="server" />
|
|
<label for="inpIBAN" class="lblGeneral">Código IBAN</label>
|
|
<input type="text" id="inpIBAN" runat="server" />
|
|
</div>
|
|
<p id="mensaje" style="color:red;font-weight:bold; text-align:center;width:100%;"></p>
|
|
<div style="margin-top:10px">
|
|
<input type="button" class="btnGris" value="Cancelar" onclick="$('#divCambiarIBAN').css('display','none')" />
|
|
<input type="button" class="btnAzul" value="Confirmar" onclick="solicitudCambioIBAN()" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row pag">
|
|
|
|
|
|
<div id="datosPersonales" class="col">
|
|
|
|
|
|
<div class="row p-0">
|
|
<p class="tituloMobile">Datos personales</p>
|
|
<div class="col-3"></div>
|
|
<div class="migasDePan col">
|
|
<ul>
|
|
<li onclick="MostrarPagina('datosPersonales')" class="migaActiva">/ Datos personales</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<%-- <div class="DesgIncAtras" style="position: fixed; top: 125px; z-index: 10">
|
|
<input type='button' value='Atrás' style='width: 100%;' onclick="history.back()" class='btnAtras' />
|
|
</div>--%>
|
|
|
|
|
|
<%--<h2 class="titularOpcControlHorario">Datos parsonales</h2>--%>
|
|
|
|
<div class="row" style="justify-content: center">
|
|
<div class="col-md-6">
|
|
<label style="margin: 0;">Dirección: </label>
|
|
<input type="text" class="inptxt inpDP" onchange="$(this).css('background-color','lightgray')" style="width: 100%; text-align: start; margin-bottom: 20px" id="txtDireccionDP" runat="server" />
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label style="margin: 0;">Código postal: </label>
|
|
<input type="text" class="inptxt inpDP" onchange="$(this).css('background-color','lightgray')" style="width: 100%; text-align: start; margin-bottom: 20px" id="txtCPDP" maxlength="5" runat="server" />
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label style="margin: 0;">Población: </label>
|
|
<input type="text" class="inptxt inpDP" onchange="$(this).css('background-color','lightgray')" style="width: 100%; text-align: start; margin-bottom: 20px" id="txtPoblacionDP" runat="server" />
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label style="margin: 0;">Provincia: </label>
|
|
<input type="text" class="inptxt inpDP" onchange="$(this).css('background-color','lightgray')" style="width: 100%; text-align: start; margin-bottom: 20px" id="txtProvinciaDP" runat="server" />
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label style="margin: 0;">Teléfono: </label>
|
|
<input type="text" class="inptxt inpDP" onchange="$(this).css('background-color','lightgray')" style="width: 100%; text-align: start; margin-bottom: 20px" id="txtTelefono1DP" runat="server" />
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label style="margin: 0;">Movil: </label>
|
|
<input type="text" class="inptxt inpDP" onchange="$(this).css('background-color','lightgray')" style="width: 100%; text-align: start; margin-bottom: 20px" id="txtTelefono2DP" runat="server" />
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label style="margin: 0;">IBAN: </label>
|
|
<input type="text" class="inptxt inpDP" onchange="$(this).css('background-color','lightgray')" style="width: 100%; text-align: start; margin-bottom: 20px; background-color:lightgray" readonly="true" id="txtIbanDP" runat="server" />
|
|
</div>
|
|
<div style="display: flex; gap: 15px; margin-top: 20px; justify-content: center">
|
|
<input style="margin-top: 20px" class="btnAzul" onclick="$('#divCambiarIBAN').css('display','flex')" type="button" value="SOLICITUD MODIFICAR IBAN" />
|
|
<input style="margin-top: 20px" class="btnAzul" onclick="ActualizarDatosPersonales()" type="button" id="btnActualizarDP" value="ACTUALIZAR" runat="server" />
|
|
</div>
|
|
<p style="margin-top: 30px; text-align: center; width: 100%; font-weight: bold;" id="MensajeErrorDP"></p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<script>
|
|
$(document).ready(function () {
|
|
$.ajax({
|
|
type: "post",
|
|
contentType: "application/json",
|
|
url: "/datosPersonales.aspx/cargarDatosPersonales",
|
|
dataType: "json",
|
|
success: function (result) {
|
|
if (result.d != "") {
|
|
var resultado = JSON.parse(result.d.Result)
|
|
$("#txtDireccionDP").val(resultado.direccion)
|
|
$("#txtCPDP").val(resultado.CPDP)
|
|
$("#txtPoblacionDP").val(resultado.poblacion)
|
|
$("#txtProvinciaDP").val(resultado.provincia)
|
|
$("#txtTelefono1DP").val(resultado.telefono1)
|
|
$("#txtTelefono2DP").val(resultado.telefono2)
|
|
$("#txtIbanDP").val(resultado.iban)
|
|
}
|
|
},
|
|
error: function () { },
|
|
})
|
|
})
|
|
function ActualizarDatosPersonales() {
|
|
|
|
var domicilio = $("#txtDireccionDP").val()
|
|
var provincia = $("#txtProvinciaDP").val()
|
|
var poblacion = $("#txtPoblacionDP").val()
|
|
var telefono = $("#txtTelefono1DP").val()
|
|
var movil = $("#txtTelefono2DP").val()
|
|
var iban = $("#txtIbanDP").val()
|
|
var codigopostal = $("#txtCPDP").val()
|
|
|
|
$.ajax({
|
|
|
|
type: "post",
|
|
url: "/datosPersonales.aspx/actualizarDatosPersonales",
|
|
data: '{"direccion":"' + domicilio + '","codigopostal":"' + codigopostal + '","provincia":"' + provincia + '","poblacion":"' + poblacion + '","telefono":"' + telefono + '","movil":"' + movil + '","iban":"' + iban + '"}',
|
|
contentType: "application/json; charset=utf-8",
|
|
dataType: "json",
|
|
async: true,
|
|
success: function (result) {
|
|
if (result.d != "") {
|
|
var nuevosDatos = JSON.parse(result.d.Result)
|
|
if (nuevosDatos.Resultado == 0) {
|
|
$("#MensajeErrorDP").css("color", "green")
|
|
$("#MensajeErrorDP").text("Datos actualizados correctamente")
|
|
var inpDP = $(".inpDP")
|
|
for (var i = 0; i < inpDP.length; i++) {
|
|
if (inpDP[i].style.backgroundColor == "lightgray") {
|
|
inpDP[i].style.backgroundColor = "white"
|
|
}
|
|
}
|
|
$("#txtDireccionDP").val(nuevosDatos.DatosPersonales.Direccion)
|
|
$("#txtProvinciaDP").val(nuevosDatos.DatosPersonales.Provincia)
|
|
$("#txtPoblacionDP").val(nuevosDatos.DatosPersonales.Poblacion)
|
|
$("#txtTelefono1DP").val(nuevosDatos.DatosPersonales.Telefono)
|
|
$("#txtTelefono2DP").val(nuevosDatos.DatosPersonales.Movil)
|
|
$("#txtIbanDP").css("background-color","lightgray")
|
|
$("#txtCPDP").val(nuevosDatos.DatosPersonales.CodigoPostal)
|
|
}
|
|
else {
|
|
$("#MensajeErrorDP").css("color", "red")
|
|
$("#MensajeErrorDP").text(nuevosDatos.Mensaje)
|
|
}
|
|
|
|
}
|
|
},
|
|
error: function (result) {
|
|
alert('error occured');
|
|
alert(result.responseText);
|
|
$("#iconLoading").css("display", "none")
|
|
},
|
|
});
|
|
}
|
|
|
|
|
|
function solicitudCambioIBAN() {
|
|
|
|
var swift = $("#inpBIC").val()
|
|
var bic = $("#inpDescBIC").val()
|
|
var entidad = $("#inpEnt").val()
|
|
var IBAN = $("#inpIBAN").val()
|
|
|
|
$.ajax({
|
|
type: "post",
|
|
contentType: "application/json",
|
|
url: "/datosPersonales.aspx/SolicitudCambioIBAN",
|
|
data: '{"SWIFT":"' + swift + '","BIC":"' + bic + '","Ent":"'+entidad+'","IBAN":"'+IBAN+'"}',
|
|
dataType: "json",
|
|
success: function (result) {
|
|
if (result.d != "") {
|
|
var resultado = JSON.parse(result.d.Result)
|
|
if (resultado.Resultado == "0") {
|
|
|
|
var uri = 'data:application/octet-stream;base64,' + resultado.FicheroForaTer;
|
|
var downloadLink = document.createElement("a");
|
|
downloadLink.href = uri;
|
|
downloadLink.download = "SolicitudCambioIBAN.pdf";
|
|
|
|
document.body.appendChild(downloadLink);
|
|
downloadLink.click();
|
|
document.body.removeChild(downloadLink);
|
|
|
|
$('#divCambiarIBAN').css('display', 'none')
|
|
|
|
$("#inpBIC").val("")
|
|
$("#inpDescBIC").val("")
|
|
$("#inpEnt").val("")
|
|
$("#inpIBAN").val("")
|
|
$("#mensaje").text("")
|
|
}
|
|
else {
|
|
$("#mensaje").text(resultado.Mensaje)
|
|
}
|
|
|
|
}
|
|
},
|
|
error: function () { },
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</asp:Content>
|