3
Guys, I need some help from you
if (usr.Excluido = 0)
{
ModelState.AddModelError("", "Usuário bloqueado.");
return View(model);
}
The deleted variable is as bool on my system, I am doing a login check if Excluded = 0 the user has access to the system if it is Excluded = 1 it falls inside this if
if (usr.Excluido = 0)
{
ModelState.AddModelError("", "Usuário bloqueado.");
return View(model);
}
I had already done it and gives the same mistake
– Leonardo Macedo
posted another photo on the theme
– Leonardo Macedo
It should work as an example: http://rextester.com/RLBL96990
– Luiz Santos
Yes, but my variable is either bool or true or false, only I’m not able to do the validation with true or false
– Leonardo Macedo
So just use true false, no need for numeric comparison
– Luiz Santos
@Reno responded the correct way for your accomplishment
– Luiz Santos
So the problem is that with true or false I am not entering if that would be Modelstate.Addmodelerror("", "User locked.");
– Leonardo Macedo
It doesn’t make sense, I’d have to go in
– Luiz Santos
Let’s go continue this discussion in chat.
– Luiz Santos