<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - Mi aplicación ASP.NET</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" title="more options">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@Html.ActionLink("Nombre de la aplicación", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
</div>
@{ using (ElterTitan.Models.APPWEB_BITACORAELECTRICAEntities db = new ElterTitan.Models.APPWEB_BITACORAELECTRICAEntities())
{
var usr = getUsuerID(@User.Identity.Name);
var lst = from u in db.Usuario
where u.idUsuario==usr
select u;
var rolcito = lst.First();
var rolfijo = rolcito.idRol;
<div class="navbar-collapse collapse">
@if (rolfijo == "SP")
{
<ul class="nav navbar-nav">
<li>@Html.ActionLink("Inicio", "Index", "Home")</li>
<li>@Html.ActionLink("Acerca de", "About", "Home")</li>
<li>@Html.ActionLink("Contacto", "Contact", "Home")</li>
</ul>
}
<p class="nav navbar-text navbar-right">¡Hola, @User.Identity.Name!</p>
</div>
}
string getUsuerID(string userID)
{
var usuarioID = @User.Identity.Name;
usuarioID = usuarioID.Replace("EPPEC\\", "").ToString();
usuarioID = usuarioID.Replace("PETROAMAZONAS\\", "").ToString();
return usuarioID;
}
}
}
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>© @DateTime.Now.Year - Mi aplicación ASP.NET</p>
</footer>
</div>
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
</body>
</html>