moved all functions from row based to grid based using datatables

This commit is contained in:
2020-02-10 23:13:59 +01:00
parent 796c5516f9
commit 4c0cd9d6f0
5 changed files with 238 additions and 247 deletions

View File

@@ -29,7 +29,6 @@ namespace Tv7Playlist.Controllers
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(Guid id, PlaylistEntry updatedEntry)
//[Bind("PlaylistEntry.Id,PlaylistEntry.Position,PlaylistEntry.TrackNumberOverride,PlaylistEntry.NameOverride,PlaylistEntry.IsEnabled")]
{
if (updatedEntry == null) return NotFound();
@@ -54,47 +53,5 @@ namespace Tv7Playlist.Controllers
return View(updatedEntry);
}
[HttpGet]
public async Task<IActionResult> ToggleEnabled(Guid? id)
{
var entry = await _playlistContext.PlaylistEntries.FindAsync(id);
if (entry == null) return NotFound();
entry.IsEnabled = !entry.IsEnabled;
await _playlistContext.SaveChangesAsync();
return RedirectToAction("Index", "Home");
}
[HttpGet]
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public async Task<IActionResult> Delete(Guid? id)
{
if (id == null) return NotFound();
var entry = await _playlistContext.PlaylistEntries.FindAsync(id);
if (entry == null) return NotFound();
return View(entry);
}
[HttpPost]
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(Guid? id)
{
if (id == null) return NotFound();
var entry = await _playlistContext.PlaylistEntries.FindAsync(id);
if (entry == null) return NotFound();
_playlistContext.PlaylistEntries.Remove(entry);
await _playlistContext.SaveChangesAsync();
return RedirectToAction("Index", "Home");
}
}
}