Remove edit from SCSI devices.

This commit is contained in:
2019-11-17 13:29:45 +00:00
parent ba0486742a
commit 89e3b91378
4 changed files with 0 additions and 156 deletions

View File

@@ -36,61 +36,6 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
return View(scsi);
}
// GET: Admin/Scsis/Edit/5
public async Task<IActionResult> Edit(int? id)
{
if(id == null)
{
return NotFound();
}
Scsi scsi = await _context.Scsi.FindAsync(id);
if(scsi == null)
{
return NotFound();
}
return View(scsi);
}
// POST: Admin/Scsis/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<IActionResult> Edit(
int id, [Bind(
"Id,InquiryData,SupportsModeSense6,SupportsModeSense10,SupportsModeSubpages,ModeSense6Data,ModeSense10Data,ModeSense6CurrentData,ModeSense10CurrentData,ModeSense6ChangeableData,ModeSense10ChangeableData")]
Scsi scsi)
{
if(id != scsi.Id)
{
return NotFound();
}
if(ModelState.IsValid)
{
try
{
_context.Update(scsi);
await _context.SaveChangesAsync();
}
catch(DbUpdateConcurrencyException)
{
if(!ScsiExists(scsi.Id))
{
return NotFound();
}
throw;
}
return RedirectToAction(nameof(Index));
}
return View(scsi);
}
// GET: Admin/Scsis/Delete/5
public async Task<IActionResult> Delete(int? id)
{

View File

@@ -100,6 +100,5 @@
</dl>
</div>
<div>
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-primary">Edit</a>
<a asp-action="Index" class="btn btn-secondary">Back to List</a>
</div>

View File

@@ -1,99 +0,0 @@
@model DiscImageChef.CommonTypes.Metadata.Scsi
@{
Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
ViewBag.Title = "DiscImageChef";
}
@{
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Edit.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
// ****************************************************************************/
}
<h4>Scsi</h4>
<hr />
<div class="row">
<div class="col-md-4">
<form asp-action="Edit">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="Id" />
<div class="form-group">
<label asp-for="InquiryData" class="control-label"></label>
<input asp-for="InquiryData" class="form-control" />
<span asp-validation-for="InquiryData" class="text-danger"></span>
</div>
<div class="form-check form-group">
<label class="form-check-label">
<input class="form-check-input" asp-for="SupportsModeSense6" /> @Html.DisplayNameFor(model => model.SupportsModeSense6)
</label>
</div>
<div class="form-check form-group">
<label class="form-check-label">
<input class="form-check-input" asp-for="SupportsModeSense10" /> @Html.DisplayNameFor(model => model.SupportsModeSense10)
</label>
</div>
<div class="form-check form-group">
<label class="form-check-label">
<input class="form-check-input" asp-for="SupportsModeSubpages" /> @Html.DisplayNameFor(model => model.SupportsModeSubpages)
</label>
</div>
<div class="form-group">
<label asp-for="ModeSense6Data" class="control-label"></label>
<input asp-for="ModeSense6Data" class="form-control" />
<span asp-validation-for="ModeSense6Data" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="ModeSense10Data" class="control-label"></label>
<input asp-for="ModeSense10Data" class="form-control" />
<span asp-validation-for="ModeSense10Data" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="ModeSense6CurrentData" class="control-label"></label>
<input asp-for="ModeSense6CurrentData" class="form-control" />
<span asp-validation-for="ModeSense6CurrentData" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="ModeSense10CurrentData" class="control-label"></label>
<input asp-for="ModeSense10CurrentData" class="form-control" />
<span asp-validation-for="ModeSense10CurrentData" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="ModeSense6ChangeableData" class="control-label"></label>
<input asp-for="ModeSense6ChangeableData" class="form-control" />
<span asp-validation-for="ModeSense6ChangeableData" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="ModeSense10ChangeableData" class="control-label"></label>
<input asp-for="ModeSense10ChangeableData" class="form-control" />
<span asp-validation-for="ModeSense10ChangeableData" class="text-danger"></span>
</div>
<div class="form-group">
<input class="btn btn-primary" type="submit" value="Save" />
<a asp-action="Index" class="btn btn-secondary">Back to List</a>
</div>
</form>
</div>
</div>

View File

@@ -105,7 +105,6 @@
</td>
<td>
<a asp-action="Details" asp-route-id="@item.Id" class="btn btn-primary">Details</a>
<a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-secondary">Edit</a>
<a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">Delete</a>
</td>
</tr>