public IActionResult ClubInfo(string id) { MyClubModel ClubModel = new MyClubModel(); ApplicationUser UserModel = _clubAccess.GetMyClub(id); Edit EditTemp = _clubAccess.GetDescrById(id); List <UserGoing> TempEventList = new List <UserGoing>(); var TempEvent = _clubAccess.GetEventsById(id); foreach (var item in TempEvent) { TempEventList.Add(new UserGoing { EventName = item.EventName, Id = item.Id, IsGoing = _GuestAccess.Followgoingcheck(item.Id, User.FindFirstValue(ClaimTypes.NameIdentifier)) } ); } ClubModel.ClubName = UserModel.ClubName; ClubModel.Location = UserModel.Location; ClubModel.NumberOfFollowers = UserModel.NumberOfFollowers; ClubModel.Description = EditTemp.Description; ClubModel.UserId = id; ClubModel.UserGoings = TempEventList; ClubModel.ImagePath = EditTemp.ImagePath; ClubModel.IsFollowed = _GuestAccess.Followpaircheck(id, User.FindFirstValue(ClaimTypes.NameIdentifier)); return(View(ClubModel)); }
public async Task <IActionResult> MyClub(string id, MyClubModel ToEdit) { if (ModelState.IsValid) { await _clubAccess.EditModelAsync(_mapper.Map <MyClubModelDTO>(ToEdit)); return(RedirectToAction("MyClub", new { id = id })); } return(View(ToEdit)); }
public IActionResult MyClub(string id) { MyClubModel ClubModel = new MyClubModel(); ApplicationUser UserModel = _clubAccess.GetMyClub(id); Edit EditTemp = _clubAccess.GetDescrById(id); List <Event> TempEventList = _clubAccess.GetEventsById(id); ClubModel.ClubName = UserModel.ClubName; ClubModel.Location = UserModel.Location; if (EditTemp != null) { ClubModel.Description = EditTemp.Description; ClubModel.ImagePath = EditTemp.ImagePath; } ClubModel.UserId = id; ClubModel.Events = TempEventList; return(View(ClubModel)); }