git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C451
This commit is contained in:
parent
08ed5ff404
commit
f5b3917ef1
2 changed files with 16 additions and 11 deletions
|
|
@ -9,6 +9,7 @@ var LinkPropuesta = "http://localhost/AYA.SlnSinort/PropuestaNormativa/DetallePr
|
||||||
//aya-vsrv-apptt:2525
|
//aya-vsrv-apptt:2525
|
||||||
var server = window.location.protocol + "//" + "localhost" + "/" + (window.location.pathname.split('/')[1]) + "/";
|
var server = window.location.protocol + "//" + "localhost" + "/" + (window.location.pathname.split('/')[1]) + "/";
|
||||||
var SinorLoginWCF = "http://localhost/AYA.SlnSinort.WCF/Sinort.svc";
|
var SinorLoginWCF = "http://localhost/AYA.SlnSinort.WCF/Sinort.svc";
|
||||||
|
var SinorSignupWCF = "http://localhost/AYA.SlnSinort.WCF/SinortCatalogos.svc";
|
||||||
var string_empty = "";
|
var string_empty = "";
|
||||||
var Atesa = {};
|
var Atesa = {};
|
||||||
var StarterTemplateVisible = true;
|
var StarterTemplateVisible = true;
|
||||||
|
|
|
||||||
|
|
@ -24,16 +24,18 @@ function validarFormulario() {
|
||||||
|
|
||||||
var Contador = 0;
|
var Contador = 0;
|
||||||
var patron = /^[a-zñA-ZÑ\u00E0-\u00FC]+$/;
|
var patron = /^[a-zñA-ZÑ\u00E0-\u00FC]+$/;
|
||||||
|
var nombre;
|
||||||
|
var apellido1;
|
||||||
|
|
||||||
if ($('#txtNombre').val().length > 0) {
|
if ($('#txtNombre').val().length > 0) {
|
||||||
var usuario = document.getElementById("txtNombre").value;
|
nombre = document.getElementById("txtNombre").value;
|
||||||
|
|
||||||
if (patron.test(usuario)) {
|
if (patron.test(nombre)) {
|
||||||
Contador++;
|
Contador++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($('#txtApellido1').val().length > 0) {
|
if ($('#txtApellido1').val().length > 0) {
|
||||||
var apellido1 = document.getElementById("txtApellido1").value;
|
apellido1 = document.getElementById("txtApellido1").value;
|
||||||
if (patron.test(apellido1)) {
|
if (patron.test(apellido1)) {
|
||||||
Contador++;
|
Contador++;
|
||||||
}
|
}
|
||||||
|
|
@ -76,8 +78,13 @@ function validarFormulario() {
|
||||||
|
|
||||||
if (Contador >= 6) {
|
if (Contador >= 6) {
|
||||||
enviado = true;
|
enviado = true;
|
||||||
usuario = normalize($('#txtNombre').val().charAt(0).toLowerCase() + $('#txtApellido1').val()).toLowerCase();
|
nombre = normalize(nombre).toLowerCase();
|
||||||
BuscarUsuario(usuario);
|
apellido1 = normalize(apellido1).toLowerCase();
|
||||||
|
model = {
|
||||||
|
codigo: nombre,
|
||||||
|
filtro: apellido1
|
||||||
|
}
|
||||||
|
BuscarUsuario(model);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Los campos son obligatorios', Message_Warning);
|
toastr.warning('Los campos son obligatorios', Message_Warning);
|
||||||
|
|
@ -107,12 +114,9 @@ var normalize = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
this.BuscarUsuario = function (usuario) {
|
this.BuscarUsuario = function (model) {
|
||||||
|
|
||||||
|
|
||||||
var uri = CatalogosWCF + '/api/BuscarUsuario';
|
var uri = SinorSignupWCF + '/api/BuscarUsuario';
|
||||||
model = {
|
AjaxPostData(uri, model, false, false, null, null, null);
|
||||||
codigo: usuario
|
|
||||||
}
|
|
||||||
AjaxPostData(uri, model, false, true, null, null, null);
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue