Attempting to call PROC sp_UsuariosVariasTentativasCadastro_Result
, which brings up a list according to the form data. But nothing is happening. Can someone help me ?
NOTE: I created all these "layers" but I do not know if they have the need.
BLL
public class ListUserBLL: BaseBLL
{
public List<Usuario> ListarLogUser(int pagina = 0, int linhas = 0)
{
if (linhas == 0)
linhas = int.MaxValue;
return banco.Usuario
.AsNoTracking()
.Where(x => x.FgAtivo == 0)
.OrderBy(x => x.DsNome)
.Skip(pagina * linhas)
.Take(linhas)
.ToList();
}
}
Controller
public class ListUserController : Controller
{
public ListUserModel db = new ListUserModel();
public ActionResult Index()
{
using (var context = new ListUserModel())
{
// var data = context.Usuario.SqlQuery<>
var data = context.DsNome.SqlQuery<Usuario>("exec sp_UsuariosVariasTentativasCadastro_Result").ToList();
return View(data);
}
}
}
HTML
@model IEnumerable
@{ ViewBag.Title = "ListUser"; Layout = "~/Views/Shared/_Layout.cshtml"; }
<div class="box">
<div class="box-head">
<h3 class="box-title">Cadastros não realizados</h3>
<h6>Lista de usuários que não realizou cadastrado</h6>
<h6>Quantidade de usuários: @(Model != null && Model.logUser != null ? Model.logUser.Count : 0)</h6>
<div class="msg w3-margin-top"></div>
</div>
<div class="box-content table-responsive no-padding">
@if (Model != null)
{
if (Model.logUser.Count > 0)
{
<table class="table table-hover">
<thead>
<tr class="w3-light-grey">
<th>E-mail</th>
<th>Nome</th>
<th>Celular</th>
<th>Endereço</th>
</tr>
</thead>
@foreach (var item in Model.logUser)
{
<tr>
<td>@item.DsEmail</td>
<td>@item.DsNome</td>
<td>@item.DsCelular</td>
<td>@item.DsEnderecoCompleto</td>
</tr>
}
</table>
}
}
</div>
</div>
Model
public class ListUserModel
{
public string DsEmail { get; set; }
public string DsNome { get; set; }
public string DsCelular { get; set; }
public string DsEnderecoCompleto { get; set; }
}
View Model
public class ListUserViewModel
{
public List<sp_UsuariosVariasTentativasCadastro_Result> logUser { get; set; }
}