public ActionResult Index(string Filter = "") { ModelView.User user = new ModelView.User(); if ( WebSecurity.IsAuthenticated == true) { int id= WebSecurity.CurrentUserId; var userinfo = api.GetUserInfo(id); //get user's info user = new ModelView.User { Id = userinfo.Id, Email = userinfo.Email, Name = userinfo.Name, Image = userinfo.Image, RemainingProposals = userinfo.RemainingProposals, RemainingVotes = userinfo.RemainingVotes }; } ViewBag.Filter = Filter; //viewbag for filtering return View(user); }
LastFM lastfm = new LastFM(Settings.Settings.LastFMKey, "http://ws.audioscrobbler.com/2.0/"); //setting up last fm public ActionResult Index(string Filter = "") { ModelView.User user = new ModelView.User(); if (WebSecurity.IsAuthenticated == true) { int id = WebSecurity.CurrentUserId; var userinfo = api.GetUserInfo(id); //get user's info user = new ModelView.User { Id = userinfo.Id, Email = userinfo.Email, Name = userinfo.Name, Image = userinfo.Image, RemainingProposals = userinfo.RemainingProposals, RemainingVotes = userinfo.RemainingVotes }; } ViewBag.Filter = Filter; //viewbag for filtering return(View(user)); }