public ActionResult Index( ) { Models.Database db = new Models.Database( ); Models.HomeContent h = new Models.HomeContent( ); h.Events = new List <Models.Event>( ); h.Events = db.GetActiveEvents( ); h.User = new Models.User( ); h.User = h.User.GetUserSession( ); if (h.User.IsAuthenticated) { h.User.Likes = db.GetEventLikes(h.User.UID); h.User.Ratings = db.GetEventRatings(h.User.UID); } return(View(h)); }
public ActionResult Event( ) { Models.EventContent ec = new Models.EventContent( ); Models.Database db = new Models.Database( ); ec.User = new Models.User( ); ec.User = ec.User.GetUserSession( ); if (ec.User.IsAuthenticated) { ec.User.Likes = db.GetEventLikes(ec.User.UID); ec.User.Ratings = db.GetEventRatings(ec.User.UID); } long id = Convert.ToInt64(RouteData.Values["id"]); ec.Event = new Models.Event( ); ec.Event = ec.Event.GetEvent(id); return(View(ec)); }