From b2d964d4550515d1f906ffed68a32cfe5552193e Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 17 Nov 2019 22:08:22 +0000 Subject: [PATCH] Remove details, edit and delete from USB products. --- .../Controllers/UsbProductsController.cs | 108 ------------------ .../Admin/Views/UsbProducts/Delete.cshtml | 77 ------------- .../Admin/Views/UsbProducts/Details.cshtml | 75 ------------ .../Areas/Admin/Views/UsbProducts/Edit.cshtml | 74 ------------ .../Admin/Views/UsbProducts/Index.cshtml | 6 - 5 files changed, 340 deletions(-) delete mode 100644 DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Delete.cshtml delete mode 100644 DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Details.cshtml delete mode 100644 DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Edit.cshtml diff --git a/DiscImageChef.Server/Areas/Admin/Controllers/UsbProductsController.cs b/DiscImageChef.Server/Areas/Admin/Controllers/UsbProductsController.cs index 0aac3d3e..4c9e7984 100644 --- a/DiscImageChef.Server/Areas/Admin/Controllers/UsbProductsController.cs +++ b/DiscImageChef.Server/Areas/Admin/Controllers/UsbProductsController.cs @@ -23,113 +23,5 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers return View(await dicServerContext.ToListAsync()); } - - // GET: Admin/UsbProducts/Details/5 - public async Task Details(int? id) - { - if(id == null) - { - return NotFound(); - } - - UsbProduct usbProduct = - await _context.UsbProducts.Include(u => u.Vendor).FirstOrDefaultAsync(m => m.Id == id); - - if(usbProduct == null) - { - return NotFound(); - } - - return View(usbProduct); - } - - // GET: Admin/UsbProducts/Edit/5 - public async Task Edit(int? id) - { - if(id == null) - { - return NotFound(); - } - - UsbProduct usbProduct = await _context.UsbProducts.FindAsync(id); - - if(usbProduct == null) - { - return NotFound(); - } - - ViewData["VendorId"] = new SelectList(_context.UsbVendors, "Id", "Id", usbProduct.VendorId); - - return View(usbProduct); - } - - // POST: Admin/UsbProducts/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,ProductId,Product,AddedWhen,ModifiedWhen,VendorId")] - UsbProduct usbProduct) - { - if(id != usbProduct.Id) - { - return NotFound(); - } - - if(ModelState.IsValid) - { - try - { - _context.Update(usbProduct); - await _context.SaveChangesAsync(); - } - catch(DbUpdateConcurrencyException) - { - if(!UsbProductExists(usbProduct.Id)) - { - return NotFound(); - } - - throw; - } - - return RedirectToAction(nameof(Index)); - } - - ViewData["VendorId"] = new SelectList(_context.UsbVendors, "Id", "Id", usbProduct.VendorId); - - return View(usbProduct); - } - - // GET: Admin/UsbProducts/Delete/5 - public async Task Delete(int? id) - { - if(id == null) - { - return NotFound(); - } - - UsbProduct usbProduct = - await _context.UsbProducts.Include(u => u.Vendor).FirstOrDefaultAsync(m => m.Id == id); - - if(usbProduct == null) - { - return NotFound(); - } - - return View(usbProduct); - } - - // POST: Admin/UsbProducts/Delete/5 - [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] - public async Task DeleteConfirmed(int id) - { - UsbProduct usbProduct = await _context.UsbProducts.FindAsync(id); - _context.UsbProducts.Remove(usbProduct); - await _context.SaveChangesAsync(); - - return RedirectToAction(nameof(Index)); - } - - bool UsbProductExists(int id) => _context.UsbProducts.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Delete.cshtml b/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Delete.cshtml deleted file mode 100644 index 2fe410dc..00000000 --- a/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Delete.cshtml +++ /dev/null @@ -1,77 +0,0 @@ -@model UsbProduct - -@{ - Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml"; - ViewBag.Title = "DiscImageChef"; -} -@{ - // /*************************************************************************** - // The Disc Image Chef - // ---------------------------------------------------------------------------- - // - // Filename : Delete.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 - // ****************************************************************************/ -} -

Are you sure you want to delete this?

-
-

UsbProduct

-
-
-
- @Html.DisplayNameFor(model => model.ProductId) -
-
- @Html.DisplayFor(model => model.ProductId) -
-
- @Html.DisplayNameFor(model => model.Product) -
-
- @Html.DisplayFor(model => model.Product) -
-
- @Html.DisplayNameFor(model => model.AddedWhen) -
-
- @Html.DisplayFor(model => model.AddedWhen) -
-
- @Html.DisplayNameFor(model => model.ModifiedWhen) -
-
- @Html.DisplayFor(model => model.ModifiedWhen) -
-
- @Html.DisplayNameFor(model => model.Vendor) -
-
- @Html.DisplayFor(model => model.Vendor.Id) -
-
-
- - Back to List - -
-
\ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Details.cshtml b/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Details.cshtml deleted file mode 100644 index 55e7748c..00000000 --- a/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Details.cshtml +++ /dev/null @@ -1,75 +0,0 @@ -@model UsbProduct - -@{ - 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 - // ****************************************************************************/ -} -
-

UsbProduct

-
-
-
- @Html.DisplayNameFor(model => model.ProductId) -
-
- @Html.DisplayFor(model => model.ProductId) -
-
- @Html.DisplayNameFor(model => model.Product) -
-
- @Html.DisplayFor(model => model.Product) -
-
- @Html.DisplayNameFor(model => model.AddedWhen) -
-
- @Html.DisplayFor(model => model.AddedWhen) -
-
- @Html.DisplayNameFor(model => model.ModifiedWhen) -
-
- @Html.DisplayFor(model => model.ModifiedWhen) -
-
- @Html.DisplayNameFor(model => model.Vendor) -
-
- @Html.DisplayFor(model => model.Vendor.Id) -
-
-
- \ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Edit.cshtml b/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Edit.cshtml deleted file mode 100644 index 5ffbb40e..00000000 --- a/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Edit.cshtml +++ /dev/null @@ -1,74 +0,0 @@ -@model UsbProduct - -@{ - 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 - // ****************************************************************************/ -} -

UsbProduct

-
-
-
-
-
- -
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - Back to List -
-
-
-
\ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Index.cshtml b/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Index.cshtml index 63100a5f..f98c417f 100644 --- a/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Index.cshtml +++ b/DiscImageChef.Server/Areas/Admin/Views/UsbProducts/Index.cshtml @@ -51,7 +51,6 @@ @Html.DisplayNameFor(model => model.Vendor) - @@ -73,11 +72,6 @@ @Html.DisplayFor(modelItem => item.Vendor.Id) - - Details - Edit - Delete - }