git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C450
This commit is contained in:
parent
13c0b70b92
commit
08ed5ff404
3 changed files with 61 additions and 3 deletions
|
|
@ -56,8 +56,9 @@ function validarFormulario() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($('#txtContrasena').val().length > 0) {
|
if ($('#txtContrasena').val().length > 0) {
|
||||||
|
var incorrectos = /^[ñÑ\u00E0-\u00FC]+$/;
|
||||||
var password = document.getElementById("txtContrasena").value;
|
var password = document.getElementById("txtContrasena").value;
|
||||||
if (patron.test(password)) {
|
if (incorrectos.test(password)) {
|
||||||
toastr.warning('No se permiten caracteres especiales en la contraseña', Message_Warning);
|
toastr.warning('No se permiten caracteres especiales en la contraseña', Message_Warning);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -76,7 +77,7 @@ function validarFormulario() {
|
||||||
if (Contador >= 6) {
|
if (Contador >= 6) {
|
||||||
enviado = true;
|
enviado = true;
|
||||||
usuario = normalize($('#txtNombre').val().charAt(0).toLowerCase() + $('#txtApellido1').val()).toLowerCase();
|
usuario = normalize($('#txtNombre').val().charAt(0).toLowerCase() + $('#txtApellido1').val()).toLowerCase();
|
||||||
//ObtenerUsuarioAD();
|
BuscarUsuario(usuario);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Los campos son obligatorios', Message_Warning);
|
toastr.warning('Los campos son obligatorios', Message_Warning);
|
||||||
|
|
@ -106,3 +107,12 @@ var normalize = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
this.BuscarUsuario = function (usuario) {
|
||||||
|
|
||||||
|
|
||||||
|
var uri = CatalogosWCF + '/api/BuscarUsuario';
|
||||||
|
model = {
|
||||||
|
codigo: usuario
|
||||||
|
}
|
||||||
|
AjaxPostData(uri, model, false, true, null, null, null);
|
||||||
|
}
|
||||||
|
|
@ -105,6 +105,7 @@
|
||||||
<Compile Include="Sinort\TipoEstadoDAL.cs" />
|
<Compile Include="Sinort\TipoEstadoDAL.cs" />
|
||||||
<Compile Include="Sinort\TipoMatrizDAL.cs" />
|
<Compile Include="Sinort\TipoMatrizDAL.cs" />
|
||||||
<Compile Include="Sinort\UsuarioDAL.cs" />
|
<Compile Include="Sinort\UsuarioDAL.cs" />
|
||||||
|
<Compile Include="Sinort\UsuarioExternoDAL.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Atesa.Utilitarios\Atesa.Utilitarios.csproj">
|
<ProjectReference Include="..\Atesa.Utilitarios\Atesa.Utilitarios.csproj">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
using Atesa.Utilitarios;
|
||||||
|
using AYA.SlnSinortModel.Entidades;
|
||||||
|
using AYA.SlnSinortModel.Sinort;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Data.Entity;
|
||||||
|
using System.Data.Entity.Validation;
|
||||||
|
using AYA.SlnSinortModel.Constantes;
|
||||||
|
|
||||||
|
namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
|
{
|
||||||
|
public class UsuarioExternoDAL
|
||||||
|
{
|
||||||
|
Log log = new Log("UsuarioExternoDAL");
|
||||||
|
|
||||||
|
#region BuscarUsuario
|
||||||
|
public UsuarioExterno BuscarUsuario(CatalogosPostJSON model)
|
||||||
|
{
|
||||||
|
UsuarioExterno usuario = new UsuarioExterno();
|
||||||
|
string filtro = model != null ? model.filtro : null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (SinortContex db = new SinortContex())
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
usuario = db.UsuarioExterno.Where(r => r.Usuario.ToString() == model.codigo).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.Error(ex);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return usuario;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue