This commit is contained in:
jmoya 2018-09-05 23:04:40 +00:00
parent 08ed5ff404
commit f5b3917ef1
2 changed files with 16 additions and 11 deletions

View file

@ -9,6 +9,7 @@ var LinkPropuesta = "http://localhost/AYA.SlnSinort/PropuestaNormativa/DetallePr
//aya-vsrv-apptt:2525
var server = window.location.protocol + "//" + "localhost" + "/" + (window.location.pathname.split('/')[1]) + "/";
var SinorLoginWCF = "http://localhost/AYA.SlnSinort.WCF/Sinort.svc";
var SinorSignupWCF = "http://localhost/AYA.SlnSinort.WCF/SinortCatalogos.svc";
var string_empty = "";
var Atesa = {};
var StarterTemplateVisible = true;

View file

@ -24,16 +24,18 @@ function validarFormulario() {
var Contador = 0;
var patron = /^[a-zñA-ZÑ\u00E0-\u00FC]+$/;
var nombre;
var apellido1;
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++;
}
}
if ($('#txtApellido1').val().length > 0) {
var apellido1 = document.getElementById("txtApellido1").value;
apellido1 = document.getElementById("txtApellido1").value;
if (patron.test(apellido1)) {
Contador++;
}
@ -76,8 +78,13 @@ function validarFormulario() {
if (Contador >= 6) {
enviado = true;
usuario = normalize($('#txtNombre').val().charAt(0).toLowerCase() + $('#txtApellido1').val()).toLowerCase();
BuscarUsuario(usuario);
nombre = normalize(nombre).toLowerCase();
apellido1 = normalize(apellido1).toLowerCase();
model = {
codigo: nombre,
filtro: apellido1
}
BuscarUsuario(model);
} else {
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';
model = {
codigo: usuario
}
AjaxPostData(uri, model, false, true, null, null, null);
var uri = SinorSignupWCF + '/api/BuscarUsuario';
AjaxPostData(uri, model, false, false, null, null, null);
}