I wrote the code in .cshtml to display the My cases label based on role
@using Tbg.Taxback.Crm.Models
@using Tbg.Taxback.Crm.Web.Infrastructure.Identity
@if (User.GetUserRoleEnum() == AppUserRole.TeamLeader)
{
My Team Cases (0)
}
else
{
My Cases (0)
}
with using key word we can get the model classes and can check the condtion based on requirement.
But there is another place(sample.js) to apply the same logic for $("#worklists-header-text").text("My Cases");
am confussed to do this , in view we can call the model class and can write the logic but the same way how can I call the same model classes with in sample.js file to apply the same logic?
Can anyone help me to do this??
I want to write a logic like
if (User.GetUserRoleEnum() == AppUserRole.TeamLeader))
$("#worklists-header-text").text("My Team Cases");
else
$("#worklists-header-text").text("My Cases"); by calling the models in sample.js
can anyone help me do resolve this ASAP??
Jenith ThakkarPosted Jul 27, 2018, 1:27 AM