public ActionResult MainNavigation() { bool showAll = false; var model = new MainNavigation() { LoggedIn = false, ShortMenuFormat = false, ShowGuildMenu = true, BossFightDifficultyRecords = _bossFightRepository.GetBossFightsAndDifficultySettings() }; if (Request.IsAuthenticated) { if (User.IsInRole(UserGroups.Admin)) { showAll = true; } var user = _authRepository.GetUserAccount(User.Identity.GetUserId()); if (user != null) { model.LoggedIn = true; model.ShortMenuFormat = user.ShortMenuFormat; model.ShowGuildMenu = user.ShowGuildMenu; } } var guilds = showAll ? _guildRepository.GetAll() : _guildRepository.GetVisibleGuilds(User.Identity.GetUserId()); foreach (var guild in guilds) { guild.Name = guild.Name.Substring(0, 1).ToUpper() + guild.Name.Substring(1); } model.Guilds = guilds.OrderBy(g => g.Name).ToList(); return(PartialView("_MainNavigation", model)); }
public IActionResult Get() { try { return(Ok(_guildRepository.GetAll())); //var resp = true; //if (resp == true) //{ // return Ok(_guildRepository.GetAll()); //} //else //{ // return BadRequest(""); //} } catch (Exception ex) { return(BadRequest(ex.ToString())); } }
public IEnumerable <Guild> GetList() { return(_guildRepository.GetAll()); }
// GET: Guild public ActionResult Index() { var guildsDTO = _guildRepository.GetAll(); return(View("~/Views/Principal/Guild.cshtml", guildsDTO)); }