public async Task <IActionResult> Edit(Guid id, [Bind("MatchSessionId,ConnectedUserId,DateTime,Lat,Lng")] MatchSession matchSession) { if (id != matchSession.MatchSessionId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(matchSession); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MatchSessionExists(matchSession.MatchSessionId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ConnectedUserId"] = new SelectList(_context.ConnectedUsers, "ConnectedUserId", "ConnectedUserId", matchSession.ConnectedUserId); return(View(matchSession)); }
public async Task <IActionResult> Edit(int id, [Bind("RejectedRestaurantId,DateTime,SwipeListId,UserId")] RejectedRestaurant rejectedRestaurant) { if (id != rejectedRestaurant.RejectedRestaurantId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(rejectedRestaurant); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RejectedRestaurantExists(rejectedRestaurant.RejectedRestaurantId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SwipeListId"] = new SelectList(_context.SwipeLists, "SwipeListId", "RestaurantId", rejectedRestaurant.SwipeListId); return(View(rejectedRestaurant)); }
public async Task <IActionResult> Edit(Guid id, [Bind("FavoriteRestaurantId,RestaurantId,UserId")] FavoriteRestaurant favoriteRestaurant) { if (id != favoriteRestaurant.FavoriteRestaurantId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(favoriteRestaurant); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FavoriteRestaurantExists(favoriteRestaurant.FavoriteRestaurantId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["RestaurantId"] = new SelectList(_context.Restaurants, "RestaurantId", "RestaurantId", favoriteRestaurant.RestaurantId); ViewData["UserId"] = new SelectList(_context.Users, "UserId", "Email", favoriteRestaurant.UserId); return(View(favoriteRestaurant)); }
public async Task <IActionResult> Edit(Guid id, [Bind("MatchRestaurantId,DateTime,AcceptedRestaurantId")] MatchedRestaurant matchedRestaurant) { if (id != matchedRestaurant.MatchRestaurantId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(matchedRestaurant); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MatchedRestaurantExists(matchedRestaurant.MatchRestaurantId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AcceptedRestaurantId"] = new SelectList(_context.AcceptedRestaurants, "AcceptedRestaurantId", "UserId", matchedRestaurant.AcceptedRestaurantId); return(View(matchedRestaurant)); }
public async Task <IActionResult> Edit(Guid id, [Bind("UserSettingsId,SettingsId,UserId")] UserSetting userSetting) { if (id != userSetting.UserSettingsId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userSetting); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserSettingExists(userSetting.UserSettingsId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SettingsId"] = new SelectList(_context.Settings, "SettingsId", "Name", userSetting.SettingsId); ViewData["UserId"] = new SelectList(_context.Users, "UserId", "Email", userSetting.UserId); return(View(userSetting)); }
public async Task <IActionResult> Edit(int id, [Bind("SwipeListId,RestaurantId,MatchSessionId")] SwipeList swipeList) { if (id != swipeList.SwipeListId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(swipeList); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SwipeListExists(swipeList.SwipeListId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MatchSessionId"] = new SelectList(_context.MatchSessions, "MatchSessionId", "MatchSessionId", swipeList.MatchSessionId); ViewData["RestaurantId"] = new SelectList(_context.Restaurants, "RestaurantId", "RestaurantId", swipeList.RestaurantId); return(View(swipeList)); }
public async Task <IActionResult> Edit(Guid id, [Bind("BlockUserId,BaseUserId,BlockedUserId")] BlockedUser blockedUser) { if (id != blockedUser.BlockUserId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(blockedUser); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BlockedUserExists(blockedUser.BlockUserId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BaseUserId"] = new SelectList(_context.Users, "UserId", "Email", blockedUser.BaseUserId); ViewData["BlockedUserId"] = new SelectList(_context.Users, "UserId", "Email", blockedUser.BlockedUserId); return(View(blockedUser)); }
public async Task <IActionResult> Edit(Guid id, [Bind("UserId,Username,Name,Bio,Gender,Email,Phone,Password,Lat,Lng,Facebook,Twitter,Instagram,Website,ProfilePicture,Street,City,State,ZipCode,Salt")] User user) { if (id != user.UserId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.UserId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Edit(int id, [Bind("SettingsId,Name,Enabled")] Setting setting) { if (id != setting.SettingsId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(setting); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SettingExists(setting.SettingsId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(setting)); }
public async Task <IActionResult> Edit(int id, [Bind("RestaurantId,Name,Street,Phone,City,State,Lat,Lng,OpenNow,Website,Rating,ZipCode,Photo")] Restaurant restaurant) { if (id != restaurant.RestaurantId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(restaurant); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RestaurantExists(restaurant.RestaurantId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(restaurant)); }