From 30a8776016e458d80ca708f26223bf66eb6fd018 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Tue, 12 Nov 2019 23:57:11 +0000 Subject: [PATCH] Remove edit from MMCs. --- .../Areas/Admin/Controllers/MmcController.cs | 54 ------------------- .../Areas/Admin/Views/Mmc/Details.cshtml | 1 - .../Areas/Admin/Views/Mmc/Edit.cshtml | 54 ------------------- .../Areas/Admin/Views/Mmc/Index.cshtml | 1 - 4 files changed, 110 deletions(-) delete mode 100644 DiscImageChef.Server/Areas/Admin/Views/Mmc/Edit.cshtml diff --git a/DiscImageChef.Server/Areas/Admin/Controllers/MmcController.cs b/DiscImageChef.Server/Areas/Admin/Controllers/MmcController.cs index 542e82f0..b49ba5c4 100644 --- a/DiscImageChef.Server/Areas/Admin/Controllers/MmcController.cs +++ b/DiscImageChef.Server/Areas/Admin/Controllers/MmcController.cs @@ -36,58 +36,6 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers return View(mmc); } - // GET: Admin/Mmc/Edit/5 - public async Task Edit(int? id) - { - if(id == null) - { - return NotFound(); - } - - Mmc mmc = await _context.Mmc.FindAsync(id); - - if(mmc == null) - { - return NotFound(); - } - - return View(mmc); - } - - // POST: Admin/Mmc/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,ModeSense2AData")] Mmc mmc) - { - if(id != mmc.Id) - { - return NotFound(); - } - - if(ModelState.IsValid) - { - try - { - _context.Update(mmc); - await _context.SaveChangesAsync(); - } - catch(DbUpdateConcurrencyException) - { - if(!MmcExists(mmc.Id)) - { - return NotFound(); - } - - throw; - } - - return RedirectToAction(nameof(Index)); - } - - return View(mmc); - } - // GET: Admin/Mmc/Delete/5 public async Task Delete(int? id) { @@ -116,7 +64,5 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - - bool MmcExists(int id) => _context.Mmc.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/Mmc/Details.cshtml b/DiscImageChef.Server/Areas/Admin/Views/Mmc/Details.cshtml index c618fa71..5cd1f29a 100644 --- a/DiscImageChef.Server/Areas/Admin/Views/Mmc/Details.cshtml +++ b/DiscImageChef.Server/Areas/Admin/Views/Mmc/Details.cshtml @@ -46,6 +46,5 @@
- Edit Back to List
\ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/Mmc/Edit.cshtml b/DiscImageChef.Server/Areas/Admin/Views/Mmc/Edit.cshtml deleted file mode 100644 index 2139e885..00000000 --- a/DiscImageChef.Server/Areas/Admin/Views/Mmc/Edit.cshtml +++ /dev/null @@ -1,54 +0,0 @@ -@model DiscImageChef.CommonTypes.Metadata.Mmc - -@{ - 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 - // ****************************************************************************/ -} -

Mmc

-
-
-
-
-
- -
- - - -
-
- - Back to List -
-
-
-
\ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/Mmc/Index.cshtml b/DiscImageChef.Server/Areas/Admin/Views/Mmc/Index.cshtml index a3be369c..ebb603c2 100644 --- a/DiscImageChef.Server/Areas/Admin/Views/Mmc/Index.cshtml +++ b/DiscImageChef.Server/Areas/Admin/Views/Mmc/Index.cshtml @@ -51,7 +51,6 @@ Details - Edit Delete