Implement storage by owned machine admin pages.

This commit is contained in:
2019-05-31 01:40:35 +01:00
parent 46033c4001
commit 6949da12a8
8 changed files with 717 additions and 3 deletions

View File

@@ -29,7 +29,7 @@
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
}
@using cicm_web.Areas.Admin.Models
@using CompanyViewModel = cicm_web.Areas.Admin.Models.CompanyViewModel
@model IEnumerable<cicm_web.Areas.Admin.Models.CompanyViewModel>
@{

View File

@@ -16,13 +16,13 @@
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Extension.Extension)
</dd class>
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Processor)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Processor.Name)
</dd class>
</dd>
</dl>
<form asp-action="Delete">

View File

@@ -0,0 +1,107 @@
@{
/******************************************************************************
// Canary Islands Computer Museum Website
// ----------------------------------------------------------------------------
//
// Filename : Create.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// Admin view create
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
}
@using Cicm.Database
@model Cicm.Database.Models.StorageByOwnedMachine
@{
ViewData["Title"] = "Create";
}
<h2>Create</h2>
<h4>Storage by machine</h4>
<hr />
<div class="row">
<div class="col-md-4">
<form asp-action="Create">
<div asp-validation-summary="ModelOnly"
class="text-danger">
</div>
<div class="form-group">
<label asp-for="OwnedMachine"
class="control-label">
</label>
<select asp-for="OwnedMachineId"
class="form-control"
asp-items="ViewBag.OwnedMachineId">
</select>
</div>
<div class="form-group">
<label asp-for="Type"
class="control-label">
</label>
<select asp-for="Type"
class="form-control"
asp-items="Html.GetEnumSelectList<StorageType>().OrderBy(s => s.Text)">
</select>
<span asp-validation-for="Type"
class="text-danger">
</span>
</div>
<div class="form-group">
<label asp-for="Interface"
class="control-label">
</label>
<select asp-for="Interface"
class="form-control"
asp-items="Html.GetEnumSelectList<StorageInterface>().OrderBy(s => s.Text)">
</select>
<span asp-validation-for="Interface"
class="text-danger">
</span>
</div>
<div class="form-group">
<label asp-for="Capacity"
class="control-label">
</label>
<input asp-for="Capacity"
class="form-control" />
<span asp-validation-for="Capacity"
class="text-danger">
</span>
</div>
<div class="form-group">
<input class="btn btn-primary"
type="submit"
value="Create" />
<a asp-action="Index"
class="btn btn-secondary">
Back to List
</a>
</div>
</form>
</div>
</div>
@section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}

View File

@@ -0,0 +1,82 @@
@{
/******************************************************************************
// Canary Islands Computer Museum Website
// ----------------------------------------------------------------------------
//
// Filename : Delete.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// Admin view delete
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
}
@model cicm_web.Areas.Admin.Models.StorageByMachineViewModel
@{
ViewData["Title"] = "Delete";
}
<h2>Delete</h2>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Storage by machine</h4>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.Type)
</dt>
<dd>
@Html.DisplayFor(model => model.Type)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Interface)
</dt>
<dd>
@Html.DisplayFor(model => model.Interface)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Capacity)
</dt>
<dd>
@Html.DisplayFor(model => model.Capacity)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Machine)
</dt>
<dd>
@Html.DisplayFor(model => model.Machine)
</dd>
</dl>
<form asp-action="Delete">
<input type="hidden"
asp-for="Id" />
<input class="btn btn-danger"
type="submit"
value="Delete" />
<a asp-action="Index"
class="btn btn-secondary">
Back to List
</a>
</form>
</div>

View File

@@ -0,0 +1,80 @@
@{
/******************************************************************************
// Canary Islands Computer Museum Website
// ----------------------------------------------------------------------------
//
// Filename : Details.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// Admin view details
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
}
@model cicm_web.Areas.Admin.Models.StorageByMachineViewModel
@{
ViewData["Title"] = "Details";
}
<h2>Details</h2>
<div>
<h4>Storage by machine</h4>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.Type)
</dt>
<dd>
@Html.DisplayFor(model => model.Type)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Interface)
</dt>
<dd>
@Html.DisplayFor(model => model.Interface)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Capacity)
</dt>
<dd>
@Html.DisplayFor(model => model.Capacity)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Machine)
</dt>
<dd>
@Html.DisplayFor(model => model.Machine)
</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

@@ -0,0 +1,112 @@
@{
/******************************************************************************
// Canary Islands Computer Museum Website
// ----------------------------------------------------------------------------
//
// Filename : Edit.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// Admin view edit
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
}
@using Cicm.Database
@model Cicm.Database.Models.StorageByOwnedMachine
@{
ViewData["Title"] = "Edit";
}
<h2>Edit</h2>
<h4>Storage by machine</h4>
<hr />
<div class="row">
<div class="col-md-4">
<form asp-action="Edit">
<div asp-validation-summary="ModelOnly"
class="text-danger">
</div>
<div class="form-group">
<label asp-for="OwnedMachineId"
class="control-label">
</label>
<select asp-for="OwnedMachineId"
class="form-control"
asp-items="ViewBag.OwnedMachineId">
</select>
<span asp-validation-for="OwnedMachineId"
class="text-danger">
</span>
</div>
<div class="form-group">
<label asp-for="Type"
class="control-label">
</label>
<select asp-for="Type"
class="form-control"
asp-items="Html.GetEnumSelectList<StorageType>().OrderBy(s => s.Text)">
</select>
<span asp-validation-for="Type"
class="text-danger">
</span>
</div>
<div class="form-group">
<label asp-for="Interface"
class="control-label">
</label>
<select asp-for="Interface"
class="form-control"
asp-items="Html.GetEnumSelectList<StorageInterface>().OrderBy(s => s.Text)">
</select>
<span asp-validation-for="Interface"
class="text-danger">
</span>
</div>
<div class="form-group">
<label asp-for="Capacity"
class="control-label">
</label>
<input asp-for="Capacity"
class="form-control" />
<span asp-validation-for="Capacity"
class="text-danger">
</span>
</div>
<input type="hidden"
asp-for="Id" />
<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>
@section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}

View File

@@ -0,0 +1,107 @@
@{
/******************************************************************************
// Canary Islands Computer Museum Website
// ----------------------------------------------------------------------------
//
// Filename : Index.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// Admin view index
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
}
@using cicm_web.Areas.Admin.Models
@model IEnumerable<cicm_web.Areas.Admin.Models.StorageByMachineViewModel>
@{
ViewData["Title"] = "Storage by machines (Admin)";
}
<h2>Storage by machines</h2>
<p>
<a asp-action="Create"
class="btn btn-primary">
Create New
</a>
</p>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Company)
</th>
<th>
@Html.DisplayNameFor(model => model.Machine)
</th>
<th>
@Html.DisplayNameFor(model => model.Type)
</th>
<th>
@Html.DisplayNameFor(model => model.Interface)
</th>
<th>
@Html.DisplayNameFor(model => model.Capacity)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach(StorageByMachineViewModel item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Company)
</td>
<td>
@Html.DisplayFor(modelItem => item.Machine)
</td>
<td>
@Html.DisplayFor(modelItem => item.Type)
</td>
<td>
@Html.DisplayFor(modelItem => item.Interface)
</td>
<td>
@Html.DisplayFor(modelItem => item.Capacity)
</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>
}
</tbody>
</table>