diff --git a/DiscImageChef.Server/Areas/Admin/Controllers/CompactDiscOffsetsController.cs b/DiscImageChef.Server/Areas/Admin/Controllers/CompactDiscOffsetsController.cs index 757b5bca..e64e6cdc 100644 --- a/DiscImageChef.Server/Areas/Admin/Controllers/CompactDiscOffsetsController.cs +++ b/DiscImageChef.Server/Areas/Admin/Controllers/CompactDiscOffsetsController.cs @@ -20,24 +20,6 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers View(await _context.CdOffsets.OrderBy(o => o.Manufacturer).ThenBy(o => o.Model).ThenBy(o => o.Offset). ToListAsync()); - // GET: Admin/CompactDiscOffsets/Details/5 - public async Task Details(int? id) - { - if(id == null) - { - return NotFound(); - } - - CompactDiscOffset compactDiscOffset = await _context.CdOffsets.FirstOrDefaultAsync(m => m.Id == id); - - if(compactDiscOffset == null) - { - return NotFound(); - } - - return View(compactDiscOffset); - } - // GET: Admin/CompactDiscOffsets/Edit/5 public async Task Edit(int? id) { @@ -69,27 +51,26 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers return NotFound(); } - if(ModelState.IsValid) + if(!ModelState.IsValid) + return View(compactDiscOffset); + + try { - try + _context.Update(compactDiscOffset); + await _context.SaveChangesAsync(); + } + catch(DbUpdateConcurrencyException) + { + if(!CompactDiscOffsetExists(compactDiscOffset.Id)) { - _context.Update(compactDiscOffset); - await _context.SaveChangesAsync(); - } - catch(DbUpdateConcurrencyException) - { - if(!CompactDiscOffsetExists(compactDiscOffset.Id)) - { - return NotFound(); - } - - throw; + return NotFound(); } - return RedirectToAction(nameof(Index)); + throw; } - return View(compactDiscOffset); + return RedirectToAction(nameof(Index)); + } // GET: Admin/CompactDiscOffsets/Delete/5 diff --git a/DiscImageChef.Server/Areas/Admin/Views/CompactDiscOffsets/Details.cshtml b/DiscImageChef.Server/Areas/Admin/Views/CompactDiscOffsets/Details.cshtml deleted file mode 100644 index 6161e4ab..00000000 --- a/DiscImageChef.Server/Areas/Admin/Views/CompactDiscOffsets/Details.cshtml +++ /dev/null @@ -1,87 +0,0 @@ -@model CompactDiscOffset - -@{ - 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 - // ****************************************************************************/ -} -
-

CompactDiscOffset

-
-
-
- @Html.DisplayNameFor(model => model.AddedWhen) -
-
- @Html.DisplayFor(model => model.AddedWhen) -
-
- @Html.DisplayNameFor(model => model.ModifiedWhen) -
-
- @Html.DisplayFor(model => model.ModifiedWhen) -
-
- @Html.DisplayNameFor(model => model.Manufacturer) -
-
- @Html.DisplayFor(model => model.Manufacturer) -
-
- @Html.DisplayNameFor(model => model.Model) -
-
- @Html.DisplayFor(model => model.Model) -
-
- @Html.DisplayNameFor(model => model.Offset) -
-
- @Html.DisplayFor(model => model.Offset) -
-
- @Html.DisplayNameFor(model => model.Submissions) -
-
- @Html.DisplayFor(model => model.Submissions) -
-
- @Html.DisplayNameFor(model => model.Agreement) -
-
- @Html.DisplayFor(model => model.Agreement) -
-
-
-
- Edit - Back to List -
\ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/CompactDiscOffsets/Index.cshtml b/DiscImageChef.Server/Areas/Admin/Views/CompactDiscOffsets/Index.cshtml index a592e06d..11fd8ada 100644 --- a/DiscImageChef.Server/Areas/Admin/Views/CompactDiscOffsets/Index.cshtml +++ b/DiscImageChef.Server/Areas/Admin/Views/CompactDiscOffsets/Index.cshtml @@ -87,7 +87,6 @@ @Html.DisplayFor(modelItem => item.Agreement) - Details Edit Delete