public ActionResult Index() { IUser currentUser = Authorization.GetAuthroizedUser(); if ( currentUser == null ) return Redirect( "/" ); try { if ( currentUser.IsSuperuser() ) { AgentModel model = new AgentModel(); List<AgentModel> tariffList = model.SelectAll().ConvertAll( x => ( AgentModel ) x ); ViewData[ "agentList" ] = tariffList; return View(); } } catch { ViewData[ "agentList" ] = new List<AgentModel>(); return View(); } return Redirect( "/" ); }