522 lines
23 KiB
JavaScript
522 lines
23 KiB
JavaScript
this.getRowIndex = function (TableItems, column_pos, value) {
|
|
//busca en una tabla y compara un valor con el contenido en la columna especifica
|
|
var indexes = null;
|
|
|
|
TableItems.rows().indexes().each(function (idx) {
|
|
var row_id = TableItems.row(idx).data();
|
|
if (row_id[column_pos] == value) {
|
|
indexes = idx;
|
|
}
|
|
});
|
|
return indexes;
|
|
}
|
|
|
|
this.goView = function (url) {
|
|
var hiddenQueryEncripted = $('#hiddenQueryEncripted').val();
|
|
|
|
url = replaceAll("[$querystring]", hiddenQueryEncripted, url);
|
|
window.location.href = url;
|
|
}
|
|
|
|
var JsonCotizacionResponse = {};
|
|
|
|
this.ToMoney = function (value) {
|
|
|
|
return value.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
|
|
|
|
};
|
|
|
|
this.LeerControlesUltimus = function (modelo) {
|
|
//function para leer los controles ocultos de ultimus
|
|
//se lo asignan a la variable de entrada y luego la retorna
|
|
//esto es para centralizar la lectura de los mismos
|
|
|
|
modelo.UltimusTaskId = $("#hiddenTaskId").val();
|
|
modelo.UltimusUserID = $("#hiddenUserID").val();
|
|
modelo.UltimusProcess = $("#hiddenProcess").val();
|
|
modelo.UltimusStep = $("#hiddenStep").val();
|
|
modelo.UltimusIncident = $("#hiddenIncident").val();
|
|
modelo.UltimusIpAdress = $("#hiddenIpAdress").val();
|
|
modelo.UltimusMachineName = $("#hiddenMachineName").val();
|
|
modelo.UltimusActivityType = $("#hiddenActivityType").val();
|
|
modelo.UltimusJobFunction = $("#hiddenJobFunction").val();
|
|
modelo.UltimusUserFullName = $("#hiddenUserFullName").val();
|
|
modelo.UltimusUserEmail = $("#hiddenUserEmail").val();
|
|
modelo.UltimusSupervisor = $("#hiddenSupervisor").val();
|
|
modelo.UltimusSupervisorFullName = $("#hiddenSupervisorFullName").val();
|
|
modelo.Version = $("#hiddenVersion").val();
|
|
modelo.UltimusTaskStatus = $("#hiddenTaskStatus").val();
|
|
modelo.HostResponse = $("#hiddenHostResponse").val();
|
|
|
|
return modelo;
|
|
}
|
|
|
|
function getParameterByName(name, url) {
|
|
if (!url) url = window.location.href;
|
|
name = name.replace(/[\[\]]/g, "\\$&");
|
|
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
|
results = regex.exec(url);
|
|
if (!results) return null;
|
|
if (!results[2]) return '';
|
|
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
|
}
|
|
|
|
$.fn.TableInitSpanish = function (columnOrder, order, bPaginate, bFilter, bInfo, columnDefinition, data) {
|
|
|
|
var ES = {
|
|
"sProcessing": "Procesando...",
|
|
"sLengthMenu": "Mostrar _MENU_ registros",
|
|
"sZeroRecords": "No se encontraron resultados",
|
|
"sEmptyTable": "Ningún dato disponible",
|
|
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
|
|
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
|
|
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
|
|
"sInfoPostFix": "",
|
|
"sSearch": "Buscar:",
|
|
"sUrl": "",
|
|
"sInfoThousands": ",",
|
|
"sLoadingRecords": "Cargando...",
|
|
"oPaginate": {
|
|
"sFirst": "Primero",
|
|
"sLast": "Último",
|
|
"sNext": "Siguiente",
|
|
"sPrevious": "Anterior"
|
|
},
|
|
"oAria": {
|
|
"sSortAscending": ": Activar para ordenar la columna de manera ascendente",
|
|
"sSortDescending": ": Activar para ordenar la columna de manera descendente"
|
|
}
|
|
};
|
|
|
|
var EN = {
|
|
"sProcessing": "Processing...",
|
|
"sLengthMenu": "Show _MENU_ registers",
|
|
"sZeroRecords": "No results found",
|
|
"sEmptyTable": "No data available",
|
|
"sInfo": "Showing registers from _START_ to _END_ of a total of _TOTAL_ registers",
|
|
"sInfoEmpty": "Showing registers from 0 to 0 of a total of 0 registers",
|
|
"sInfoFiltered": "(filtering of a total of _MAX_ registers)",
|
|
"sInfoPostFix": "",
|
|
"sSearch": "Find:",
|
|
"sUrl": "",
|
|
"sInfoThousands": ",",
|
|
"sLoadingRecords": "Loading...",
|
|
"oPaginate": {
|
|
"sFirst": "First",
|
|
"sLast": "Last",
|
|
"sNext": "Next",
|
|
"sPrevious": "Previous"
|
|
},
|
|
"oAria": {
|
|
"sSortAscending": ": Activate to sort the column in ascending order",
|
|
"sSortDescending": ": Activate to sort the column in descending order"
|
|
}
|
|
};
|
|
|
|
this.dataTable({
|
|
"language": ES,
|
|
"order": [[columnOrder, order]],
|
|
"destroy": true,
|
|
"bPaginate": bPaginate,
|
|
"bFilter": bFilter,
|
|
"bInfo": bInfo,
|
|
"data": data,
|
|
"columns": columnDefinition,
|
|
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
|
|
|
|
});
|
|
};
|
|
|
|
this.StartSelectControlRequest = function (_selectId) {
|
|
$(_selectId).empty();
|
|
listItems = "<option value='-1' ><i class=\"fa fa-spinner fa-spin\"></i>Cargando catalogos, Por favor Espere...</option>";
|
|
$(_selectId).append(listItems);
|
|
};
|
|
|
|
this.CleanSelectControl = function (_selectId) {
|
|
$(_selectId).empty();
|
|
listItems = "<option value='' ></option>";
|
|
$(_selectId).append(listItems);
|
|
$(_selectId).val("");
|
|
};
|
|
|
|
this.AddSelectOption = function (_selectId, _optionId, _text) {
|
|
$(_selectId)
|
|
.append($("<option></option>")
|
|
.attr("value", _optionId)
|
|
.text(_text));
|
|
};
|
|
|
|
this.LockDevTools = function () {
|
|
//impide el click derecho y redireciona al abrir la consola
|
|
$("body").attr("oncontextmenu", "return false;");
|
|
|
|
$("body").mousedown(function () {
|
|
RedirecOnDevTools();
|
|
});
|
|
|
|
document.onkeydown = function (e) {
|
|
|
|
if (e.keyCode == 123) {
|
|
return false;
|
|
}
|
|
if (e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) {
|
|
return false;
|
|
}
|
|
if (e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) {
|
|
return false;
|
|
}
|
|
if (e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) {
|
|
return false;
|
|
}
|
|
|
|
RedirecOnDevTools();
|
|
|
|
}//fin keydown
|
|
|
|
}
|
|
|
|
this.RedirecOnDevTools = function () {
|
|
//redirecciona si la consola esta visible
|
|
var element = new Image;
|
|
|
|
|
|
Object.defineProperty(element, 'id', {
|
|
get: function () {
|
|
|
|
var url = window.location.href;
|
|
url = url + "&Advr=1"
|
|
|
|
RedirectToAction("HOME", "ERROR", url);
|
|
return null;
|
|
}
|
|
});
|
|
|
|
try {
|
|
var _0x25ee = ["\x63\x6C\x65\x61\x72", "", "\x6C\x6F\x67", "\x20\x20\x20\x20\x20\x20\x20\x64\x62\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x20\x20\x2C\x61\x64\x38\x38\x38\x38\x62\x61\x2C\x20\x20\x20\x20\x38\x38\x20\x20", "\x20\x20\x20\x20\x20\x20\x64\x38\x38\x62\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x64\x38\x27\x27\x20\x20\x20\x20\x60\x27\x38\x62\x20\x20\x20\x38\x38\x20\x20", "\x20\x20\x20\x20\x20\x64\x38\x27\x60\x38\x62\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x64\x38\x27\x20\x20\x20\x20\x20\x20\x20\x20\x60\x38\x62\x20\x20\x38\x38\x20\x20", "\x20\x20\x20\x20\x64\x38\x27\x20\x20\x60\x38\x62\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x38\x38\x20\x20", "\x20\x20\x20\x64\x38\x59\x61\x61\x61\x61\x59\x38\x62\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x38\x38\x20\x20", "\x20\x20\x64\x38\x27\x27\x27\x27\x27\x27\x27\x27\x38\x62\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x59\x38\x2C\x20\x20\x20\x20\x20\x20\x20\x20\x2C\x38\x50\x20\x20\x27\x27\x20\x20", "\x20\x64\x38\x27\x20\x20\x20\x20\x20\x20\x20\x20\x60\x38\x62\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x59\x38\x61\x2E\x20\x20\x20\x20\x2E\x61\x38\x50\x20\x20\x20\x61\x61\x20\x20", "\x64\x38\x27\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x60\x38\x62\x20\x20\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x60\x27\x59\x38\x38\x38\x38\x59\x27\x27\x20\x20\x20\x20\x38\x38\x20\x20", "\x45\x73\x74\x61\x20\x66\x75\x6E\x63\x69\xF3\x6E\x20\x64\x65\x6C\x20\x6E\x61\x76\x65\x67\x61\x64\x6F\x72\x20\x65\x73\x74\xE1\x20\x70\x65\x6E\x73\x61\x64\x61\x20\x70\x61\x72\x61\x20\x64\x65\x73\x61\x72\x72\x6F\x6C\x6C\x61\x64\x6F\x72\x65\x73\x2E", "\x53\x69\x20\x61\x6C\x67\x75\x69\x65\x6E\x20\x74\x65\x20\x68\x61\x20\x69\x6E\x64\x69\x63\x61\x64\x6F\x20\x71\x75\x65\x20\x63\x6F\x70\x69\x61\x72\x61\x73\x20\x79\x20\x70\x65\x67\x61\x72\x61\x73\x20\x61\x6C\x67\x6F\x20\x61\x71\x75\xED\x20\x70\x61\x72\x61", "\x68\x61\x62\x69\x6C\x69\x74\x61\x72\x20\x75\x6E\x61\x20\x66\x75\x6E\x63\x69\xF3\x6E\x20\x64\x65\x6C\x20\x70\x72\x6F\x63\x65\x73\x6F\x20\x6F\x20\x70\x61\x72\x61\x20\x61\x6C\x74\x65\x72\x61\x72\x20\x6C\x61\x20\x69\x6E\x66\x6F\x72\x6D\x61\x63\x69\xF3\x6E\x2C", "\x73\x65\x20\x74\x72\x61\x74\x61\x20\x64\x65\x20\x75\x6E\x20\x66\x72\x61\x75\x64\x65\x2E\x20\x53\x69\x20\x6C\x6F\x20\x68\x61\x63\x65\x73\x20\x65\x73\x74\x61\x73\x20\x76\x69\x6F\x6C\x61\x6E\x64\x6F\x20\x6C\x61\x20\x6C\x65\x79\x2E", "\x56\x65\x72\x20\x68\x74\x74\x70\x3A\x2F\x2F\x75\x6C\x74\x69\x6D\x75\x73\x2E\x63\x6F\x6D\x20\x70\x61\x72\x61\x20\x6D\xE1\x73\x20\x69\x6E\x66\x6F\x72\x6D\x61\x63\x69\xF3\x6E\x2E"]; console[_0x25ee[0]](); console[_0x25ee[2]](_0x25ee[1]); console[_0x25ee[2]](_0x25ee[3]); console[_0x25ee[2]](_0x25ee[4]); console[_0x25ee[2]](_0x25ee[5]); console[_0x25ee[2]](_0x25ee[6]); console[_0x25ee[2]](_0x25ee[7]); console[_0x25ee[2]](_0x25ee[8]); console[_0x25ee[2]](_0x25ee[9]); console[_0x25ee[2]](_0x25ee[10]); console[_0x25ee[2]](_0x25ee[1]); console[_0x25ee[2]](_0x25ee[11]); console[_0x25ee[2]](_0x25ee[12]); console[_0x25ee[2]](_0x25ee[13]); console[_0x25ee[2]](_0x25ee[14]); console[_0x25ee[2]](_0x25ee[1]); console[_0x25ee[2]](_0x25ee[15]); console[_0x25ee[2]](_0x25ee[1]); console[_0x25ee[2]](_0x25ee[1])
|
|
|
|
console.log(element);
|
|
}
|
|
catch (e) {
|
|
|
|
}
|
|
}
|
|
|
|
//#region IDENTIFICACION
|
|
function ShowDiv(id, code) {
|
|
|
|
|
|
$(format("#ddtipo_{0} option", id)).each(function () {
|
|
|
|
codeInt = $(this).val();
|
|
|
|
var div = $(format("#div_{0}_{1}", codeInt, id));
|
|
if (div != null) {
|
|
div.hide();
|
|
}
|
|
});
|
|
|
|
if (code === 'undefined' || code == null || code == '')
|
|
code = $(format("#ddtipo_{0}", id)).val();
|
|
|
|
//var code = $(format("#ddtipo_{0}", id)).val();
|
|
var div = $(format("#div_{0}_{1}", code, id));
|
|
if (div != null) {
|
|
div.show();
|
|
}
|
|
}
|
|
|
|
function format(fmtstr) {
|
|
var args = Array.prototype.slice.call(arguments, 1);
|
|
return fmtstr.replace(/\{(\d+)\}/g, function (match, index) {
|
|
return args[index];
|
|
});
|
|
}
|
|
|
|
function valida_enteros(evento) {
|
|
var key = evento.keyCode;
|
|
if (key >= 48 && key <= 57)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
function alfanumerico(evento) {
|
|
var key = evento.keyCode;
|
|
if ((key >= 48 && key <= 57) || (key >= 65 && key <= 90) || (key >= 97 && key <= 122)) {
|
|
evento.keyCode = String.fromCharCode(key).toUpperCase().charCodeAt(0)
|
|
return true;
|
|
}
|
|
else
|
|
return false;
|
|
}
|
|
|
|
function pad(str, max) {
|
|
str = str.toString();
|
|
return str.length < max ? pad("0" + str, max) : str;
|
|
}
|
|
|
|
function identificacion(obj) {
|
|
var val = $(obj).val();
|
|
var max = $(obj).attr("maxlength");
|
|
var valpad = pad(val, max);
|
|
$(obj).val(valpad);
|
|
}
|
|
|
|
function limpiar_identificacion(id_control) {
|
|
|
|
for (var i = 1; i <= 11; i++) {
|
|
|
|
switch (i.toString()) {
|
|
case "1":
|
|
impostar_identificacion(id_control, "00-0000-0000", i.toString());
|
|
break;
|
|
case "2":
|
|
impostar_identificacion(id_control, "", i.toString());
|
|
break;
|
|
case "3":
|
|
impostar_identificacion(id_control, "", i.toString());
|
|
break;
|
|
//case "4":
|
|
// impostar_identificacion(id_control, "000000000000", i.toString());
|
|
// break;
|
|
//case "5":
|
|
// impostar_identificacion(id_control, "00000000000000000", i.toString());
|
|
// break;
|
|
//case "6":
|
|
// impostar_identificacion(id_control, "00000", i.toString());
|
|
// break;
|
|
//case "7":
|
|
// impostar_identificacion(id_control, "000000000000000", i.toString());
|
|
// break;
|
|
case "8":
|
|
impostar_identificacion(id_control, "", i.toString());
|
|
break;
|
|
case "9":
|
|
impostar_identificacion(id_control, "0000000000", i.toString());
|
|
break;
|
|
case "10":
|
|
impostar_identificacion(id_control, "0000000000", i.toString());
|
|
break;
|
|
//case "11":
|
|
// impostar_identificacion(id_control, "", i.toString());
|
|
// break;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function obtener_identificacion(id_control) {
|
|
var ret = "";
|
|
|
|
var code = $(format("#ddtipo_{0}", id_control)).val();
|
|
switch (code) {
|
|
case "1":
|
|
var parte1 = $(format("#txt_ced_nac1_{0}", id_control)).val();
|
|
var parte2 = $(format("#txt_ced_nac2_{0}", id_control)).val();
|
|
var parte3 = $(format("#txt_ced_nac3_{0}", id_control)).val();
|
|
if (parseInt(parte1) < 10)
|
|
parte1 = "0" + parte1;
|
|
ret = parte1 + "-" + parte2 + "-" + parte3;
|
|
break;
|
|
case "2":
|
|
//var parte1 = $(format("#txt_ced_resperm1_{0}", id_control)).val();
|
|
//var parte2 = $(format("#txt_ced_resperm2_{0}", id_control)).val();
|
|
//var parte3 = $(format("#txt_ced_resperm3_{0}", id_control)).val();
|
|
//ret = parseInt(parte1) + "-" + parte2 + parte3;
|
|
ret = $(format("#txt_ced_resperm_{0}", id_control)).val();
|
|
break;
|
|
case "3":
|
|
//var parte1 = $(format("#txt_ced_restemp1_{0}", id_control)).val();
|
|
//var parte2 = $(format("#txt_ced_restemp2_{0}", id_control)).val();
|
|
//var parte3 = $(format("#lbl_ced_restemp3_{0}", id_control)).val();
|
|
//var parte4 = $(format("#txt_ced_restemp4_{0}", id_control)).val();
|
|
//ret = parte1 + parte2 + parte3 + parte4;
|
|
ret = $(format("#txt_ced_restemp_{0}", id_control)).val();
|
|
break;
|
|
case "4":
|
|
var parte1 = $(format("#txt_ced_resapol1_{0}", id_control)).val();
|
|
var parte2 = $(format("#lbl_ced_resapol2_{0}", id_control)).val();
|
|
var parte3 = $(format("#txt_ced_resapol3_{0}", id_control)).val();
|
|
var parte4 = $(format("#txt_ced_resapol4_{0}", id_control)).val();
|
|
ret = parte1 + parte2 + parte3 + parte4;
|
|
break;
|
|
case "5":
|
|
var parte1 = $(format("#txt_ced_re1_{0}", id_control)).val();
|
|
var parte2 = $(format("#lbl_ced_re2_{0}", id_control)).val();
|
|
var parte3 = $(format("#txt_ced_re3_{0}", id_control)).val();
|
|
var parte4 = $(format("#txt_ced_re4_{0}", id_control)).val();
|
|
var parte5 = $(format("#txt_ced_re5_{0}", id_control)).val();
|
|
ret = parte1 + parte2 + parte3 + parte4 + parte5;
|
|
break;
|
|
case "6":
|
|
var parte1 = $(format("#txt_ced_ren1_{0}", id_control)).val();
|
|
var parte2 = $(format("#txt_ced_ren2_{0}", id_control)).val();
|
|
ret = parte1 + parte2;
|
|
break;
|
|
case "7":
|
|
var parte1 = $(format("#lbl_ced_ref1_{0}", id_control)).val();
|
|
var parte2 = $(format("#txt_ced_ref2_{0}", id_control)).val();
|
|
var parte3 = $(format("#txt_ced_ref3_{0}", id_control)).val();
|
|
var parte4 = $(format("#txt_ced_ref4_{0}", id_control)).val();
|
|
ret = parte1 + parte2 + parte3 + parte4;
|
|
break;
|
|
case "8":
|
|
ret = $(format("#txt_ced_pas_fisica_{0}", id_control)).val();
|
|
break;
|
|
case "9":
|
|
var parte1 = $(format("#txt_ced_jurnac1_{0}", id_control)).val();
|
|
var parte2 = $(format("#txt_ced_jurnac2_{0}", id_control)).val();
|
|
var parte3 = $(format("#txt_ced_jurnac3_{0}", id_control)).val();
|
|
ret = parte1 + parte2 + parte3;
|
|
break;
|
|
case "10":
|
|
ret = $(format("#txt_ced_pas_jur_{0}", id_control)).val();
|
|
break;
|
|
case "11":
|
|
ret = $(format("#txt_ced_unica_fisica_{0}", id_control)).val();
|
|
break;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
function obtener_tipo_identificacion(id_control) {
|
|
return $(format("#ddtipo_{0}", id_control)).val();
|
|
}
|
|
|
|
function impostar_tipo_identificacion(id_control, code) {
|
|
$(format("#ddtipo_{0}", id_control)).val(code);
|
|
}
|
|
|
|
function impostar_identificacion(id_control, identificacion, code, showddl) {
|
|
|
|
if (code === 'undefined' || code == null || code == '')
|
|
code = $(format("#ddtipo_{0}", id_control)).val();
|
|
|
|
|
|
ShowDiv(id_control, code);
|
|
|
|
switch (code) {
|
|
case "1":
|
|
if (identificacion.length == 12) {
|
|
var parte1 = identificacion.substring(1, 2);
|
|
var parte2 = identificacion.substring(3, 7);
|
|
var parte3 = identificacion.substring(8, 12);
|
|
$(format("#txt_ced_nac1_{0}", id_control)).val(parte1);
|
|
$(format("#txt_ced_nac2_{0}", id_control)).val(parte2);
|
|
$(format("#txt_ced_nac3_{0}", id_control)).val(parte3);
|
|
}
|
|
else
|
|
alert("Se esperaban 12 carácteres para el tipo de indentificación 1");
|
|
break;
|
|
case "2":
|
|
$(format("#txt_ced_resperm_{0}", id_control)).val(identificacion);
|
|
//if (identificacion.length == 18) {
|
|
// var parte1 = identificacion.substring(0, 3);
|
|
// var parte2 = identificacion.substring(4, 11);
|
|
// var parte3 = identificacion.substring(11, 18);
|
|
// $(format("#txt_ced_resperm1_{0}", id_control)).val(parte1);
|
|
// $(format("#txt_ced_resperm2_{0}", id_control)).val(parte2);
|
|
// $(format("#txt_ced_resperm3_{0}", id_control)).val(parte3);
|
|
//}
|
|
//else
|
|
// alert("Se esperaban 18 carácteres para el tipo de indentificación 2");
|
|
break;
|
|
case "3":
|
|
$(format("#txt_ced_restemp_{0}", id_control)).val(identificacion);
|
|
//if (identificacion.length == 19) {
|
|
// var parte1 = identificacion.substring(0, 7);
|
|
// var parte2 = identificacion.substring(7, 10);
|
|
// var parte3 = identificacion.substring(10, 12);
|
|
// var parte4 = identificacion.substring(12, 19);
|
|
// $(format("#txt_ced_restemp1_{0}", id_control)).val(parte1);
|
|
// $(format("#txt_ced_restemp2_{0}", id_control)).val(parte2);
|
|
// $(format("#lbl_ced_restemp3_{0}", id_control)).val(parte3);
|
|
// $(format("#txt_ced_restemp4_{0}", id_control)).val(parte4);
|
|
//}
|
|
//else
|
|
// alert("Se esperaban 19 carácteres para el tipo de indentificación 3");
|
|
break;
|
|
case "4":
|
|
if (identificacion.length == 12) {
|
|
var parte1 = identificacion.substring(0, 2);
|
|
var parte2 = identificacion.substring(2, 3);
|
|
var parte3 = identificacion.substring(3, 9);
|
|
var parte4 = identificacion.substring(9, 12);
|
|
$(format("#txt_ced_resapol1_{0}", id_control)).val(parte1);
|
|
$(format("#lbl_ced_resapol2_{0}", id_control)).val(parte2);
|
|
$(format("#txt_ced_resapol3_{0}", id_control)).val(parte3);
|
|
$(format("#txt_ced_resapol4_{0}", id_control)).val(parte4);
|
|
}
|
|
else
|
|
alert("Se esperaban 12 carácteres para el tipo de indentificación 4");
|
|
break;
|
|
case "5":
|
|
if (identificacion.length == 17) {
|
|
var parte1 = identificacion.substring(0, 3);
|
|
var parte2 = identificacion.substring(3, 5);
|
|
var parte3 = identificacion.substring(5, 11);
|
|
var parte4 = identificacion.substring(11, 13);
|
|
var parte5 = identificacion.substring(13, 17);
|
|
$(format("#txt_ced_re1_{0}", id_control)).val(parte1);
|
|
$(format("#lbl_ced_re2_{0}", id_control)).val(parte2);
|
|
$(format("#txt_ced_re3_{0}", id_control)).val(parte3);
|
|
$(format("#txt_ced_re4_{0}", id_control)).val(parte4);
|
|
$(format("#txt_ced_re5_{0}", id_control)).val(parte5);
|
|
}
|
|
else
|
|
alert("Se esperaban 17 carácteres para el tipo de indentificación 5");
|
|
break;
|
|
case "6":
|
|
if (identificacion.length == 5) {
|
|
var parte1 = identificacion.substring(0, 4);
|
|
var parte2 = identificacion.substring(4, 5);
|
|
$(format("#txt_ced_ren1_{0}", id_control)).val(parte1);
|
|
$(format("#txt_ced_ren2_{0}", id_control)).val(parte2);
|
|
}
|
|
else
|
|
alert("Se esperaban 5 carácteres para el tipo de indentificación 6");
|
|
break;
|
|
case "7":
|
|
if (identificacion.length == 15) {
|
|
var parte1 = identificacion.substring(0, 3);
|
|
var parte2 = identificacion.substring(3, 6);
|
|
var parte3 = identificacion.substring(6, 13);
|
|
var parte4 = identificacion.substring(13, 15);
|
|
$(format("#lbl_ced_ref1_{0}", id_control)).val(parte1);
|
|
$(format("#txt_ced_ref2_{0}", id_control)).val(parte2);
|
|
$(format("#txt_ced_ref3_{0}", id_control)).val(parte3);
|
|
$(format("#txt_ced_ref4_{0}", id_control)).val(parte4);
|
|
}
|
|
else
|
|
alert("Se esperaban 15 carácteres para el tipo de indentificación 7");
|
|
break;
|
|
case "8":
|
|
$(format("#txt_ced_pas_fisica_{0}", id_control)).val(identificacion);
|
|
break;
|
|
case "9":
|
|
if (identificacion.length == 10) {
|
|
var parte1 = identificacion.substring(0, 1);
|
|
var parte2 = identificacion.substring(1, 4);
|
|
var parte3 = identificacion.substring(4, 10);
|
|
$(format("#txt_ced_jurnac1_{0}", id_control)).val(parte1);
|
|
$(format("#txt_ced_jurnac2_{0}", id_control)).val(parte2);
|
|
$(format("#txt_ced_jurnac3_{0}", id_control)).val(parte3);
|
|
}
|
|
else
|
|
alert("Se esperaban 10 carácteres para el tipo de indentificación 10");
|
|
break;
|
|
case "10":
|
|
$(format("#txt_ced_pas_jur_{0}", id_control)).val(identificacion);
|
|
break;
|
|
case "11":
|
|
$(format("#txt_ced_unica_fisica_{0}", id_control)).val(identificacion);
|
|
break;
|
|
}
|
|
}
|
|
//#endregion
|
|
|
|
|
|
|