I would like in my Crud ASP.NET system to make an image in padlock form disabled when a certain user profile logs into the system, the name of this controller below is called KeepFinalityController
Myideaisasfollows,totakeandsaveinSessiontheinformationthatisintheControllerLogginController.csandcallintheKeepFinalityController,howeverIhaveassembledthefirstpartoftheaccesstotheattributeoftheclassthatcomesemptyandwantedtoknowhowtogetit,la,belowthecodeofKeepFinalityController:
publicJsonResult_ListarFinalities() { Listpurposes=newList();
using(varws=newVREWebServiceClient()){ObterFinalidadeResponseobj=newObterFinalidadeResponse();/*Eu*/BSegurancaBSeguranca=newBSeguranca();Usuariousuario=newUsuario();intRecebe_NMUsuario=usuario.NUsuario;obj=ws.ObterFinalidade(false);boolhistorico;stringacaoHistorico=string.Empty;varobjHistorico=obj.Finalidade.Where(w=>w.DatVigncAte!=null);foreach(variteminobj.Finalidade){historico=false;stringacaoVisualizarFinalidade=String.Format("<a href=\"/ManterFinalidade/VisualizarFinalidade?codigo={0}\" title=\"Dados da Finalidade\"><img src=\"/Content/images/detalhes.png\" style=\"cursor: pointer;\" width=\"16px\" border=\"0\"></a>", item.CodFinld);
string acaoAssociarDeclaracaoFinalidade = String.Format("<a href=\"/ManterFinalidade/AssociarDeclaracaoFinalidade?codigo={0}\" title=\"Associar Declaração - Finalidade\"><img src=\"/Content/images/associar.png\" style=\"cursor: pointer;\" width=\"16px\" border=\"0\"></a>", item.NumFinld);
foreach (var x in objHistorico)
{
if (x.CodFinld == item.CodFinld)
historico = true;
}
if (historico)
acaoHistorico = "<img src=\"/Content/images/historico.png\" style=\"cursor: pointer;\" title=\"Visualizar Histórico\" width=\"16px\" border=\"0\" class=\"accordion\">";
else
acaoHistorico = "<img src=\"/Content/images/historico_off.png\" title=\"Visualizar Histórico\" width=\"16px\" border=\"0\">";
if (item.DatVigncAte == null)
{
finalidades.Add(new EFinalidadeGrid()
{
CodFinld = item.CodFinld,
DesFinld = item.DesFinld,
DatVigncDe = item.DatVigncDe,
DatVigncAte = item.DatVigncAte,
HtmlAcoes = String.Format("{0} {1} {2}", acaoHistorico, acaoVisualizarFinalidade, acaoAssociarDeclaracaoFinalidade)
});
}
}
}
return Json(new
{
Retorno = finalidades
}, JsonRequestBehavior.AllowGet);
}
In the next image, I want to capture the value of the NUsuario attribute that is equal to 16783 for technical profile and compare with line 60 if it is technical profile, it shows the disabled image, otherwise it will enable if it is another profile:
Can anyone help me, what is missing to bring the data filled in image 2?
Thank you guys