protected override void Dispose(bool disposing) { if (disposing) { if (_userManager != null) { _userManager.Dispose(); _userManager = null; } if (_clanEventManager != null) { _clanEventManager.Dispose(); _clanEventManager = null; } if (_newsManager != null) { _newsManager.Dispose(); _newsManager = null; } } base.Dispose(disposing); }
public async Task <JsonResult> FullEventDetails(int eventId) { ClanEvent clanEvent = await ClanEventManager.FindByIdAsync(eventId); // Creating the view model EventViewModel model = new EventViewModel { EventName = clanEvent.Title, EventDateAndTime = clanEvent.EventDateAndTime.ToString("dd-MM-yyy HH:mm"), Location = clanEvent.Location, Game = clanEvent.Game, CreatedBy = clanEvent.CreatedBy.UserName, ImageLocation = clanEvent.ImageLocation, Description = clanEvent.Description }; return(Json(new { model }, JsonRequestBehavior.AllowGet)); }
public PartialViewResult Events() { // Getting the data ICollection <EventListingViewModel> model = new List <EventListingViewModel>(); IEnumerable <ClanEvent> clanEvents = ClanEventManager.GetClanEvents(); // Order by date and take the first 6 clanEvents = clanEvents.OrderBy(e => e.EventDateAndTime).Take(6); // Converting them to viewmodels foreach (ClanEvent clanEvent in clanEvents) { model.Add(new EventListingViewModel { Id = clanEvent.Id, EventName = clanEvent.Title, EventDate = clanEvent.EventDateAndTime }); } return(PartialView("EventsAreaPartial", model)); }