110 lines
4.3 KiB
Plaintext
110 lines
4.3 KiB
Plaintext
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.master" CodeBehind="gestionDepartamentoEmp.aspx.vb" Inherits="WebIntranet.gestionDepartamentoEmp" %>
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="server">
|
|
|
|
<div class="row pag">
|
|
|
|
<div class="col">
|
|
<p class="tituloMobile">Gestion de departamento de personal</p>
|
|
<div class="migasDePan">
|
|
<ul>
|
|
<li class="migaActiva">/ Gestion de departamento de personal</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="secPicada d-flex justify-content-center align-items-center">
|
|
|
|
<div class="d-flex flex-column justify-content-center mt-3" class="cajaIntPicada" style="min-width:400px">
|
|
<div class="incidencias">
|
|
<p style="margin-right: 15px; font-family: 'Satoshi';">Persona:</p>
|
|
<div id="DivSelPer" runat="server"> </div>
|
|
<%-- <dx:ASPxComboBox CssClass="selectIn" Width="100%" TextField="Nombre" ValueField="Dni" ID="cbPersonas" runat="server">
|
|
</dx:ASPxComboBox>--%>
|
|
</div>
|
|
<div class="incidencias" style="margin-bottom: 45px">
|
|
<p style="margin-right: 15px; font-family: 'Satoshi';">Departamento:</p>
|
|
<div id="DivSelDep" runat="server"></div>
|
|
<%-- <dx:ASPxComboBox CssClass="selectIn" Width="100%" TextField="Descripcion" ValueField="idDep" ID="selDep" runat="server">
|
|
</dx:ASPxComboBox>--%>
|
|
</div>
|
|
|
|
<div class="d-flex justify-content-center">
|
|
<input type="button" style="width: 30%; margin-top: 50px;" class="btnAzul" onclick="GuardarCambio()" value="GUARDAR" />
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div id="mensajeResultado" runat="server">
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$(document).ready(function () { setSelDep() });
|
|
function setSelDep() {
|
|
var idPer = $("#selPer").val()
|
|
|
|
$.ajax({
|
|
type: "post",
|
|
contentType: "application/json",
|
|
url: "/gestionDepartamentoEmp.aspx/getDep",
|
|
data: '{"usu":"' + idPer + '"}',
|
|
dataType: "json",
|
|
success: function (result) {
|
|
if (result.d.includes("ERROR--")) {
|
|
compEr(result.d)
|
|
return
|
|
}
|
|
|
|
var id = parseInt(result.d)
|
|
$("#selDep").val(id)
|
|
|
|
|
|
},
|
|
error: function (result) {
|
|
alert('error occured');
|
|
alert(result.responseText);
|
|
},
|
|
|
|
});
|
|
}
|
|
function GuardarCambio() {
|
|
var usuario = $("#selPer").val()
|
|
var departamento = $("#selDep").val()
|
|
|
|
$.ajax({
|
|
type: "post",
|
|
contentType: "application/json",
|
|
url: "/gestionDepartamentoEmp.aspx/CambiarDep",
|
|
data: '{"usu":"' + usuario.toString() + '", "dep":"'+departamento.toString() +'"}',
|
|
dataType: "json",
|
|
success: function (result) {
|
|
//if (result.d.includes("ERROR--")) {
|
|
// compEr(result.d)
|
|
// return
|
|
//}
|
|
|
|
var resultado = JSON.parse(result.d.Result)
|
|
if (resultado.Resultado == 0) {
|
|
$("#mensajeResultado").html("<p style='color:green; font-weight:bold; text-align:center'>" + resultado.Mensaje + "<p>")
|
|
}
|
|
else {
|
|
$("#mensajeResultado").html("<p style='color:red; font-weight:bold; text-align:center'>" + resultado.Mensaje + "<p>")
|
|
}
|
|
|
|
},
|
|
error: function (result) {
|
|
alert('error occured');
|
|
alert(result.responseText);
|
|
},
|
|
|
|
});
|
|
|
|
|
|
}
|
|
</script>
|
|
|
|
</asp:Content>
|