Remove option to delete CHS.

This commit is contained in:
2019-11-10 13:44:07 +00:00
parent e45ef84919
commit 6af8c1c084
3 changed files with 0 additions and 98 deletions

View File

@@ -22,35 +22,6 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
View(await _context.Chs.OrderBy(c => c.Cylinders).ThenBy(c => c.Heads).ThenBy(c => c.Sectors).
ToListAsync());
// GET: Admin/Chs/Delete/5
public async Task<IActionResult> Delete(int? id)
{
if(id == null)
{
return NotFound();
}
Chs chs = await _context.Chs.FirstOrDefaultAsync(m => m.Id == id);
if(chs == null)
{
return NotFound();
}
return View(chs);
}
// POST: Admin/Chs/Delete/5
[HttpPost, ActionName("Delete"), ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(int id)
{
Chs chs = await _context.Chs.FindAsync(id);
_context.Chs.Remove(chs);
await _context.SaveChangesAsync();
return RedirectToAction(nameof(Index));
}
public IActionResult Consolidate()
{
List<ChsModel> dups = _context.Chs.GroupBy(x => new

View File

@@ -1,65 +0,0 @@
@model DiscImageChef.CommonTypes.Metadata.Chs
@{
Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
ViewBag.Title = "DiscImageChef";
}
@{
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Delete.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// 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 <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2019 Natalia Portillo
// ****************************************************************************/
}
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Chs</h4>
<hr />
<dl class="row">
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Cylinders)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Cylinders)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Heads)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Heads)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Sectors)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Sectors)
</dd>
</dl>
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<a asp-action="Index" class="btn btn-primary">Back to List</a>
<input class="btn btn-danger" type="submit" value="Delete" />
</form>
</div>

View File

@@ -48,7 +48,6 @@
<th>
@Html.DisplayNameFor(model => model.Sectors)
</th>
<th></th>
</tr>
</thead>
<tbody>
@@ -64,9 +63,6 @@
<td>
@Html.DisplayFor(modelItem => item.Sectors)
</td>
<td>
<a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">Delete</a>
</td>
</tr>
}
</tbody>