66 lines
2.2 KiB
Plaintext
66 lines
2.2 KiB
Plaintext
@page "/CustomDescriptions/Delete/{CustomDescriptionId}"
|
|
|
|
@using Gremlin_BlazorServer.Data.EntityClasses;
|
|
@using Gremlin_BlazorServer.Services;
|
|
|
|
@inject CustomDescriptionService CustomDescriptionService
|
|
@inject NavigationManager NavigationManager
|
|
|
|
<h2>Delete Employee</h2>
|
|
<hr />
|
|
<h3>Are you sure want to delete this?</h3>
|
|
<form>
|
|
<div class="row">
|
|
<div class=" col-md-8">
|
|
<div class="form-group">
|
|
<label>CustomDescriptionId:</label>
|
|
<label>@customDescription!.CustomDescriptionId</label>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>ProductNumber:</label>
|
|
<label>@customDescription.ProductNumber</label>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>OptionNumber:</label>
|
|
<label>@customDescription.OptionNumber</label>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Heading:</label>
|
|
<label>@customDescription.Heading</label>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>DescriptionText:</label>
|
|
<label>@customDescription.DescriptionText</label>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<input type="button" class="btn btn-danger" @onclick="@DeleteCustomDescription" value="Delete" />
|
|
<input type="button" class="btn btn-primary" @onclick="@Cancel" value="Cancel" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public string CustomDescriptionId { get; set; } = string.Empty;
|
|
CustomDescription customDescription = new();
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
customDescription = await Task.Run(() => CustomDescriptionService.GetCustomDescriptionAsync(Convert.ToUInt32(CustomDescriptionId)));
|
|
}
|
|
protected async void DeleteCustomDescription()
|
|
{
|
|
await CustomDescriptionService.DeleteCustomDescriptionAsync(customDescription);
|
|
NavigationManager.NavigateTo("CustomDescriptions/Index");
|
|
}
|
|
void Cancel()
|
|
{
|
|
NavigationManager.NavigateTo("CustomDescriptions/Index");
|
|
}
|
|
} |