Remove edit and detail from PCMCIA.

This commit is contained in:
2019-11-16 02:21:44 +00:00
parent e3675eec40
commit 6eb598b92f
4 changed files with 0 additions and 236 deletions

View File

@@ -18,78 +18,6 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
// GET: Admin/Pcmcias
public async Task<IActionResult> Index() => View(await _context.Pcmcia.ToListAsync());
// GET: Admin/Pcmcias/Details/5
public async Task<IActionResult> Details(int? id)
{
if(id == null)
{
return NotFound();
}
Pcmcia pcmcia = await _context.Pcmcia.FirstOrDefaultAsync(m => m.Id == id);
if(pcmcia == null)
{
return NotFound();
}
return View(pcmcia);
}
// GET: Admin/Pcmcias/Edit/5
public async Task<IActionResult> Edit(int? id)
{
if(id == null)
{
return NotFound();
}
Pcmcia pcmcia = await _context.Pcmcia.FindAsync(id);
if(pcmcia == null)
{
return NotFound();
}
return View(pcmcia);
}
// POST: Admin/Pcmcias/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,CIS,Compliance,ManufacturerCode,CardCode,Manufacturer,ProductName")]
Pcmcia pcmcia)
{
if(id != pcmcia.Id)
{
return NotFound();
}
if(ModelState.IsValid)
{
try
{
_context.Update(pcmcia);
await _context.SaveChangesAsync();
}
catch(DbUpdateConcurrencyException)
{
if(!PcmciaExists(pcmcia.Id))
{
return NotFound();
}
throw;
}
return RedirectToAction(nameof(Index));
}
return View(pcmcia);
}
// GET: Admin/Pcmcias/Delete/5
public async Task<IActionResult> Delete(int? id)
{
@@ -118,7 +46,5 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
return RedirectToAction(nameof(Index));
}
bool PcmciaExists(int id) => _context.Pcmcia.Any(e => e.Id == id);
}
}

View File

@@ -1,81 +0,0 @@
@model DiscImageChef.CommonTypes.Metadata.Pcmcia
@{
Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
ViewBag.Title = "DiscImageChef";
}
@{
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Details.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
// ****************************************************************************/
}
<div>
<h4>Pcmcia</h4>
<hr />
<dl class="row">
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.CIS)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.CIS)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Compliance)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Compliance)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.ManufacturerCode)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.ManufacturerCode)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.CardCode)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.CardCode)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Manufacturer)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Manufacturer)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.ProductName)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.ProductName)
</dd>
</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,79 +0,0 @@
@model DiscImageChef.CommonTypes.Metadata.Pcmcia
@{
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>Pcmcia</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="CIS" class="control-label"></label>
<input asp-for="CIS" class="form-control" />
<span asp-validation-for="CIS" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Compliance" class="control-label"></label>
<input asp-for="Compliance" class="form-control" />
<span asp-validation-for="Compliance" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="ManufacturerCode" class="control-label"></label>
<input asp-for="ManufacturerCode" class="form-control" />
<span asp-validation-for="ManufacturerCode" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="CardCode" class="control-label"></label>
<input asp-for="CardCode" class="form-control" />
<span asp-validation-for="CardCode" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Manufacturer" class="control-label"></label>
<input asp-for="Manufacturer" class="form-control" />
<span asp-validation-for="Manufacturer" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="ProductName" class="control-label"></label>
<input asp-for="ProductName" class="form-control" />
<span asp-validation-for="ProductName" 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

@@ -80,8 +80,6 @@
@Html.DisplayFor(modelItem => item.ProductName)
</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>