Equipment, Lokáció de még csak a lista

This commit is contained in:
2025-03-15 14:05:05 +01:00
parent a72c9b342e
commit 9f1c3df5d6
41 changed files with 645 additions and 4 deletions
@@ -97,7 +97,7 @@
$('#tbCheckPointsEditPage').on('click', '.edit-btn', function ()
{
const row = table.row($(this).closest('tr')).data();
window.location.href = `@Url.Page("./CheckListTemplateRowEditPage")?id=${row.id}`;
});
$('#tbCheckPointsEditPage').on('click', '.delete-btn', function ()
@@ -1,5 +1,7 @@
@page
@model WorkFlowCheck.Web.Pages.BaseStock.CheckPoints.CheckPointsPageModel
@using Microsoft.AspNetCore.Antiforgery
@inject IAntiforgery Antiforgery
@{
ViewData["Title"] = "Ellenőrzési pontok";
}
@@ -0,0 +1,4 @@
@page
@model WorkFlowCheck.Web.Pages.BaseStock.Equipments.EquipmentEditPageModel
@{
}
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace WorkFlowCheck.Web.Pages.BaseStock.Equipments
{
public class EquipmentEditPageModel : PageModel
{
public void OnGet()
{
}
}
}
@@ -0,0 +1,84 @@
@page
@model WorkFlowCheck.Web.Pages.BaseStock.Equipments.EquipmentsPageModel
@{
ViewData["Title"] = "Berendezések";
}
<h1>@ViewData["Title"]</h1>
<div class="card shadow p-4">
<div class="d-flex justify-content-end">
<button class="btn btn-primary float-right">Új elem hozzáadása</button>
</div>
<table id="tbEquipmentsPage" class="table table-bordered table-hover table-sm" style="width:100%">
<thead class="table-primary">
<tr>
<th>ID</th>
<th>Short Name</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tfoot class="table-light">
<tr>
<th>ID</th>
<th>Short Name</th>
<th>Action</th>
</tr>
</tfoot>
</table>
</div>
@section Scripts {
<script>
const table = new DataTable('#tbEquipmentsPage', {
ajax: {
url: "@Url.Page("./EquipmentsPage", "LoadEquipments")",
type: "GET",
dataSrc : "data"
},
columns: [
{ data: "id" },
{ data: "shortName" },
{ data: null, render: function (data, type, row) {
return `<button class="btn btn-primary edit-btn" data-id="${row.id}">Módosítás</button>
<button class="btn btn-danger delete-btn" data-id="${row.id}">Törlés</button>
`;
}}
],
columnDefs: [
{
"targets": 0,
"visible": false
},
{
"targets": 2,
"className": "text-center",
"width": "15%"
}
],
processing:true
});
$('#tbEquipmentsPage').on('click', '.edit-btn', function ()
{
const row = table.row($(this).closest('tr')).data();
window.location.href = `@Url.Page("./EquipmentEditPage")?id=${row.id}`;
});
$('#tbEquipmentsPage').on('click', '.delete-btn', function ()
{
const row = table.row($(this).closest('tr')).data();
console.log(row);
showConfirmModal({
title: 'Törlés megerősítése',
message: 'Biztosan törölni szeretnéd ezt az elemet?',
okText: 'Törlés',
cancelText: 'Mégsem'
}).then(function(result) {
if(result === 'ok') {
console.log('Törlés végrehajtva');
}
});
});
</script>
}
@@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using WorkFlowCheck.Web.Services.Interfaces;
namespace WorkFlowCheck.Web.Pages.BaseStock.Equipments
{
[Authorize]
public class EquipmentsPageModel : PageModel
{
private readonly ILogger<IndexModel> _logger;
private readonly IBaseStockService _baseStockService;
public EquipmentsPageModel(ILogger<IndexModel> logger, IBaseStockService baseStockService)
{
_logger = logger;
_baseStockService = baseStockService;
}
public async Task OnGet()
{
}
public async Task<JsonResult> OnGetLoadEquipments()
{
var results = await _baseStockService.GetAllEquipments();
return new JsonResult(new { data = results });
}
}
}
@@ -0,0 +1,4 @@
@page
@model WorkFlowCheck.Web.Pages.BaseStock.Locations.LocationEditPageModel
@{
}
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace WorkFlowCheck.Web.Pages.BaseStock.Locations
{
public class LocationEditPageModel : PageModel
{
public void OnGet()
{
}
}
}
@@ -0,0 +1,84 @@
@page
@model WorkFlowCheck.Web.Pages.BaseStock.Locations.LocationsPageModel
@{
ViewData["Title"] = "Lokációk";
}
<h1>@ViewData["Title"]</h1>
<div class="card shadow p-4">
<div class="d-flex justify-content-end">
<button class="btn btn-primary float-right">Új elem hozzáadása</button>
</div>
<table id="tbLocationsPage" class="table table-bordered table-hover table-sm" style="width:100%">
<thead class="table-primary">
<tr>
<th>ID</th>
<th>Full name</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tfoot class="table-light">
<tr>
<th>ID</th>
<th>Full name</th>
<th>Action</th>
</tr>
</tfoot>
</table>
</div>
@section Scripts {
<script>
const table = new DataTable('#tbLocationsPage', {
ajax: {
url: "@Url.Page("./LocationsPage", "LoadLocations")",
type: "GET",
dataSrc : "data"
},
columns: [
{ data: "id" },
{ data: "fullName" },
{ data: null, render: function (data, type, row) {
return `<button class="btn btn-primary edit-btn" data-id="${row.id}">Módosítás</button>
<button class="btn btn-danger delete-btn" data-id="${row.id}">Törlés</button>
`;
}}
],
columnDefs: [
{
"targets": 0,
"visible": false
},
{
"targets": 2,
"className": "text-center",
"width": "15%"
}
],
processing:true
});
$('#tbLocationsPage').on('click', '.edit-btn', function ()
{
const row = table.row($(this).closest('tr')).data();
window.location.href = `@Url.Page("./LocationEditPage")?id=${row.id}`;
});
$('#tbLocationsPage').on('click', '.delete-btn', function ()
{
const row = table.row($(this).closest('tr')).data();
console.log(row);
showConfirmModal({
title: 'Törlés megerősítése',
message: 'Biztosan törölni szeretnéd ezt az elemet?',
okText: 'Törlés',
cancelText: 'Mégsem'
}).then(function(result) {
if(result === 'ok') {
console.log('Törlés végrehajtva');
}
});
});
</script>
}
@@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using WorkFlowCheck.Web.Services.Interfaces;
namespace WorkFlowCheck.Web.Pages.BaseStock.Locations
{
[Authorize]
public class LocationsPageModel : PageModel
{
private readonly ILogger<IndexModel> _logger;
private readonly IBaseStockService _baseStockService;
public LocationsPageModel(ILogger<IndexModel> logger, IBaseStockService baseStockService)
{
_logger = logger;
_baseStockService = baseStockService;
}
public async Task OnGet()
{
}
public async Task<JsonResult> OnGetLoadLocations()
{
var results = await _baseStockService.GetAllLocations();
return new JsonResult(new { data = results });
}
}
}