diff --git a/DiscImageChef.Server/Areas/Admin/Controllers/MediaFormatsController.cs b/DiscImageChef.Server/Areas/Admin/Controllers/MediaFormatsController.cs index eda3c39a..412cfcca 100644 --- a/DiscImageChef.Server/Areas/Admin/Controllers/MediaFormatsController.cs +++ b/DiscImageChef.Server/Areas/Admin/Controllers/MediaFormatsController.cs @@ -1,4 +1,3 @@ -using System.Linq; using System.Threading.Tasks; using DiscImageChef.Server.Models; using Microsoft.AspNetCore.Authorization; @@ -17,76 +16,6 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers // GET: Admin/MediaFormats public async Task Index() => View(await _context.MediaFormats.ToListAsync()); - // GET: Admin/MediaFormats/Details/5 - public async Task Details(int? id) - { - if(id == null) - { - return NotFound(); - } - - MediaFormat mediaFormat = await _context.MediaFormats.FirstOrDefaultAsync(m => m.Id == id); - - if(mediaFormat == null) - { - return NotFound(); - } - - return View(mediaFormat); - } - - // GET: Admin/MediaFormats/Edit/5 - public async Task Edit(int? id) - { - if(id == null) - { - return NotFound(); - } - - MediaFormat mediaFormat = await _context.MediaFormats.FindAsync(id); - - if(mediaFormat == null) - { - return NotFound(); - } - - return View(mediaFormat); - } - - // POST: Admin/MediaFormats/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for - // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost, ValidateAntiForgeryToken] - public async Task Edit(int id, [Bind("Id,Name,Count")] MediaFormat mediaFormat) - { - if(id != mediaFormat.Id) - { - return NotFound(); - } - - if(ModelState.IsValid) - { - try - { - _context.Update(mediaFormat); - await _context.SaveChangesAsync(); - } - catch(DbUpdateConcurrencyException) - { - if(!MediaFormatExists(mediaFormat.Id)) - { - return NotFound(); - } - - throw; - } - - return RedirectToAction(nameof(Index)); - } - - return View(mediaFormat); - } - // GET: Admin/MediaFormats/Delete/5 public async Task Delete(int? id) { @@ -115,7 +44,5 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - - bool MediaFormatExists(int id) => _context.MediaFormats.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/MediaFormats/Details.cshtml b/DiscImageChef.Server/Areas/Admin/Views/MediaFormats/Details.cshtml deleted file mode 100644 index 7ff3cac6..00000000 --- a/DiscImageChef.Server/Areas/Admin/Views/MediaFormats/Details.cshtml +++ /dev/null @@ -1,57 +0,0 @@ -@model MediaFormat - -@{ - Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; - ViewBag.Title = "DiscImageChef"; -} -@{ - // /*************************************************************************** - // The Disc Image Chef - // ---------------------------------------------------------------------------- - // - // Filename : Details.cshtml - // Author(s) : Natalia Portillo - // - // Component : DiscImageChef Server. - // - // --[ License ] -------------------------------------------------------------- - // - // This library is free software; you can redistribute it and/or modify - // it under the terms of the GNU Lesser General Public License as - // published by the Free Software Foundation; either version 2.1 of the - // License, or (at your option) any later version. - // - // This library is distributed in the hope that it will be useful, but - // WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - // Lesser General Public License for more details. - // - // You should have received a copy of the GNU Lesser General Public - // License along with this library; if not, see . - // - // ---------------------------------------------------------------------------- - // Copyright © 2011-2019 Natalia Portillo - // ****************************************************************************/ -} -
-

MediaFormat

-
-
-
- @Html.DisplayNameFor(model => model.Name) -
-
- @Html.DisplayFor(model => model.Name) -
-
- @Html.DisplayNameFor(model => model.Count) -
-
- @Html.DisplayFor(model => model.Count) -
-
-
- \ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/MediaFormats/Edit.cshtml b/DiscImageChef.Server/Areas/Admin/Views/MediaFormats/Edit.cshtml deleted file mode 100644 index 26e9e35b..00000000 --- a/DiscImageChef.Server/Areas/Admin/Views/MediaFormats/Edit.cshtml +++ /dev/null @@ -1,59 +0,0 @@ -@model MediaFormat - -@{ - Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; - ViewBag.Title = "DiscImageChef"; -} -@{ - // /*************************************************************************** - // The Disc Image Chef - // ---------------------------------------------------------------------------- - // - // Filename : Edit.cshtml - // Author(s) : Natalia Portillo - // - // Component : DiscImageChef Server. - // - // --[ License ] -------------------------------------------------------------- - // - // This library is free software; you can redistribute it and/or modify - // it under the terms of the GNU Lesser General Public License as - // published by the Free Software Foundation; either version 2.1 of the - // License, or (at your option) any later version. - // - // This library is distributed in the hope that it will be useful, but - // WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - // Lesser General Public License for more details. - // - // You should have received a copy of the GNU Lesser General Public - // License along with this library; if not, see . - // - // ---------------------------------------------------------------------------- - // Copyright © 2011-2019 Natalia Portillo - // ****************************************************************************/ -} -

MediaFormat

-
-
-
-
-
- -
- - - -
-
- - - -
-
- - Back to List -
-
-
-
\ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/MediaFormats/Index.cshtml b/DiscImageChef.Server/Areas/Admin/Views/MediaFormats/Index.cshtml index db717df1..eb083d55 100644 --- a/DiscImageChef.Server/Areas/Admin/Views/MediaFormats/Index.cshtml +++ b/DiscImageChef.Server/Areas/Admin/Views/MediaFormats/Index.cshtml @@ -56,8 +56,6 @@ @Html.DisplayFor(modelItem => item.Count) - Details - Edit Delete