27 lines
891 B
Plaintext
27 lines
891 B
Plaintext
@using Groceries.Data;
|
|
@using Microsoft.EntityFrameworkCore;
|
|
|
|
@model (Transaction Transaction, TransactionItem TransactionItem)
|
|
@inject AppDbContext dbContext
|
|
@{
|
|
ViewBag.Title = "Edit Transaction Item";
|
|
|
|
var store = await dbContext.Stores
|
|
.Where(store => store.Id == Model.Transaction.StoreId)
|
|
.Select(store => string.Concat(store.Retailer!.Name, " ", store.Name))
|
|
.SingleAsync();
|
|
}
|
|
|
|
<h1>Edit Transaction Item</h1>
|
|
|
|
<div>@Model.Transaction.CreatedAt.ToShortDateString() @Model.Transaction.CreatedAt.ToShortTimeString() – @store</div>
|
|
|
|
<form method="post" asp-action="EditTransactionItem">
|
|
<partial name="_TransactionItemForm" model="Model.TransactionItem" />
|
|
|
|
<div class="row">
|
|
<button class="button button--primary" type="submit">Update</button>
|
|
<a class="button" asp-action="EditTransactionItems">Cancel</a>
|
|
</div>
|
|
</form>
|