diff --git a/DiscImageChef.Server/Areas/Admin/Controllers/UsbVendorsController.cs b/DiscImageChef.Server/Areas/Admin/Controllers/UsbVendorsController.cs index 6033481a..b50d6fa9 100644 --- a/DiscImageChef.Server/Areas/Admin/Controllers/UsbVendorsController.cs +++ b/DiscImageChef.Server/Areas/Admin/Controllers/UsbVendorsController.cs @@ -1,4 +1,3 @@ -using System.Linq; using System.Threading.Tasks; using DiscImageChef.Server.Models; using Microsoft.AspNetCore.Authorization; @@ -34,89 +33,5 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers return View(usbVendor); } - - // GET: Admin/UsbVendors/Edit/5 - public async Task Edit(int? id) - { - if(id == null) - { - return NotFound(); - } - - UsbVendor usbVendor = await _context.UsbVendors.FindAsync(id); - - if(usbVendor == null) - { - return NotFound(); - } - - return View(usbVendor); - } - - // POST: Admin/UsbVendors/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,VendorId,Vendor,AddedWhen,ModifiedWhen")] - UsbVendor usbVendor) - { - if(id != usbVendor.Id) - { - return NotFound(); - } - - if(ModelState.IsValid) - { - try - { - _context.Update(usbVendor); - await _context.SaveChangesAsync(); - } - catch(DbUpdateConcurrencyException) - { - if(!UsbVendorExists(usbVendor.Id)) - { - return NotFound(); - } - - throw; - } - - return RedirectToAction(nameof(Index)); - } - - return View(usbVendor); - } - - // GET: Admin/UsbVendors/Delete/5 - public async Task Delete(int? id) - { - if(id == null) - { - return NotFound(); - } - - UsbVendor usbVendor = await _context.UsbVendors.FirstOrDefaultAsync(m => m.Id == id); - - if(usbVendor == null) - { - return NotFound(); - } - - return View(usbVendor); - } - - // POST: Admin/UsbVendors/Delete/5 - [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] - public async Task DeleteConfirmed(int id) - { - UsbVendor usbVendor = await _context.UsbVendors.FindAsync(id); - _context.UsbVendors.Remove(usbVendor); - await _context.SaveChangesAsync(); - - return RedirectToAction(nameof(Index)); - } - - bool UsbVendorExists(int id) => _context.UsbVendors.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Delete.cshtml b/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Delete.cshtml deleted file mode 100644 index 12a658e8..00000000 --- a/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Delete.cshtml +++ /dev/null @@ -1,71 +0,0 @@ -@model UsbVendor - -@{ - 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?

-
-

UsbVendor

-
-
-
- @Html.DisplayNameFor(model => model.VendorId) -
-
- @Html.DisplayFor(model => model.VendorId) -
-
- @Html.DisplayNameFor(model => model.Vendor) -
-
- @Html.DisplayFor(model => model.Vendor) -
-
- @Html.DisplayNameFor(model => model.AddedWhen) -
-
- @Html.DisplayFor(model => model.AddedWhen) -
-
- @Html.DisplayNameFor(model => model.ModifiedWhen) -
-
- @Html.DisplayFor(model => model.ModifiedWhen) -
-
-
- - Back to List - -
-
\ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Details.cshtml b/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Details.cshtml index 7bccd69a..bd78b3cd 100644 --- a/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Details.cshtml +++ b/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Details.cshtml @@ -64,6 +64,5 @@ \ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Edit.cshtml b/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Edit.cshtml deleted file mode 100644 index d8075c16..00000000 --- a/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Edit.cshtml +++ /dev/null @@ -1,69 +0,0 @@ -@model UsbVendor - -@{ - 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 - // ****************************************************************************/ -} -

UsbVendor

-
-
-
-
-
- -
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - Back to List -
-
-
-
\ No newline at end of file diff --git a/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Index.cshtml b/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Index.cshtml index 5d436553..e7d9afa3 100644 --- a/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Index.cshtml +++ b/DiscImageChef.Server/Areas/Admin/Views/UsbVendors/Index.cshtml @@ -69,8 +69,6 @@ Details - Edit - Delete }