Initial commit
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
@model PowderCoating.Application.DTOs.Maintenance.MaintenanceRecordDto
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete Maintenance Record";
|
||||
ViewData["PageIcon"] = "bi-wrench";
|
||||
var seriesDeletableCount = ViewBag.SeriesDeletableCount as int?;
|
||||
}
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<div class="d-flex justify-content-end align-items-center mb-4">
|
||||
<a asp-action="Details" asp-route-id="@Model.Id" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Back to Details
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<i class="bi bi-exclamation-triangle me-2"></i>
|
||||
<strong>Warning:</strong> This action cannot be undone.
|
||||
</div>
|
||||
|
||||
<div class="card border-0 shadow-sm mb-4">
|
||||
<div class="card-header bg-danger bg-opacity-10 border-0 py-3">
|
||||
<h5 class="mb-0 text-danger">
|
||||
<i class="bi bi-wrench me-2"></i>@Model.MaintenanceType — @Model.EquipmentName
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block">Status</small>
|
||||
<strong>@Model.StatusDisplay</strong>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block">Priority</small>
|
||||
<strong>@Model.PriorityDisplay</strong>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block">Scheduled Date</small>
|
||||
<strong>@Model.ScheduledDate.ToString("MMMM dd, yyyy")</strong>
|
||||
</div>
|
||||
@if (Model.IsRecurring)
|
||||
{
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block">Recurrence</small>
|
||||
<span class="badge bg-info text-dark">
|
||||
<i class="bi bi-arrow-repeat me-1"></i>@Model.RecurrenceFrequency
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(Model.Description))
|
||||
{
|
||||
<div class="col-12">
|
||||
<small class="text-muted d-block">Description</small>
|
||||
<span>@Model.Description</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (Model.IsRecurring && seriesDeletableCount.HasValue && seriesDeletableCount.Value > 0)
|
||||
{
|
||||
<!-- Recurring series options -->
|
||||
<div class="card border-warning shadow-sm mb-4">
|
||||
<div class="card-header bg-warning bg-opacity-10 border-0 py-3">
|
||||
<h5 class="mb-0">
|
||||
<i class="bi bi-arrow-repeat me-2 text-warning"></i>This is Part of a Recurring Series
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="mb-3">
|
||||
There are <strong>@seriesDeletableCount</strong> other future scheduled/overdue occurrence@(seriesDeletableCount == 1 ? "" : "s") in this series.
|
||||
Completed occurrences will not be affected.
|
||||
</p>
|
||||
<div class="d-flex flex-column gap-3">
|
||||
<form asp-action="Delete" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" name="id" value="@Model.Id" />
|
||||
<input type="hidden" name="deleteMode" value="single" />
|
||||
<button type="submit" class="btn btn-outline-danger w-100 text-start">
|
||||
<i class="bi bi-trash me-2"></i>
|
||||
<strong>Delete this occurrence only</strong>
|
||||
<br /><small class="ms-4">Removes only this record. The other @seriesDeletableCount occurrence@(seriesDeletableCount == 1 ? "" : "s") remain.</small>
|
||||
</button>
|
||||
</form>
|
||||
<form asp-action="Delete" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" name="id" value="@Model.Id" />
|
||||
<input type="hidden" name="deleteMode" value="series" />
|
||||
<button type="submit" class="btn btn-danger w-100 text-start">
|
||||
<i class="bi bi-collection me-2"></i>
|
||||
<strong>Delete entire series</strong>
|
||||
<br /><small class="ms-4">Removes this record and all @seriesDeletableCount future scheduled/overdue occurrences. Completed records are preserved.</small>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<a asp-action="Details" asp-route-id="@Model.Id" class="btn btn-secondary">Cancel</a>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<!-- Simple single delete -->
|
||||
<div class="d-flex gap-2 justify-content-end">
|
||||
<a asp-action="Details" asp-route-id="@Model.Id" class="btn btn-secondary">Cancel</a>
|
||||
<form asp-action="Delete" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" name="id" value="@Model.Id" />
|
||||
<input type="hidden" name="deleteMode" value="single" />
|
||||
<button type="submit" class="btn btn-danger">
|
||||
<i class="bi bi-trash me-2"></i>Delete Maintenance Record
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user