All checks were successful
Docker Image CI / build (push) Successful in 3m45s
40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
@using Groceries.Data
|
|
@using Microsoft.EntityFrameworkCore
|
|
|
|
@layout Layout
|
|
|
|
@inject AppDbContext DbContext
|
|
|
|
<PageTitle>Groceries – New Transaction Item</PageTitle>
|
|
|
|
<h1>New Transaction Item</h1>
|
|
|
|
<div class="form-field">
|
|
@Transaction.CreatedAt.ToShortDateString() @Transaction.CreatedAt.ToLongTimeString() – @store
|
|
</div>
|
|
|
|
<TransactionItemForm TransactionItem="TransactionItem">
|
|
<div class="row">
|
|
<button class="button button--primary" type="submit">Add</button>
|
|
<a class="button" href="/transaction/new/items">Cancel</a>
|
|
</div>
|
|
</TransactionItemForm>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public required Transaction Transaction { get; set; }
|
|
|
|
[Parameter]
|
|
public required TransactionItem TransactionItem { get; set; }
|
|
|
|
private string store = string.Empty;
|
|
|
|
protected override async Task OnParametersSetAsync()
|
|
{
|
|
store = await DbContext.Stores
|
|
.Where(store => store.Id == Transaction.StoreId)
|
|
.Select(store => string.Concat(store.Retailer!.Name, " ", store.Name))
|
|
.SingleAsync();
|
|
}
|
|
}
|