36 lines
1.2 KiB
Plaintext
36 lines
1.2 KiB
Plaintext
@using Groceries.Data
|
|
@using Microsoft.EntityFrameworkCore
|
|
|
|
@model Store?
|
|
@inject AppDbContext dbContext
|
|
@{
|
|
var retailers = await dbContext.Retailers
|
|
.OrderBy(retailer => retailer.Name)
|
|
.ToListAsync();
|
|
}
|
|
|
|
<div class="form-field">
|
|
<label class="form-field__label" for="storeRetailerId">Retailer</label>
|
|
<select class="form-field__control select" id="storeRetailerId" name="retailerId" required autofocus>
|
|
@foreach (var retailer in retailers)
|
|
{
|
|
<option value="@retailer.Id" selected="@(retailer.Id == Model?.RetailerId)">@retailer.Name</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-field">
|
|
<label class="form-field__label" for="storeName">Name</label>
|
|
<div class="form-field__control input">
|
|
<input class="input__control" id="storeName" name="name" value="@Model?.Name" required />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-field">
|
|
<label class="form-field__label" for="storeAddress">
|
|
Address
|
|
<span class="form-field__corner-hint">Optional</span>
|
|
</label>
|
|
<textarea class="form-field__control textarea" id="storeAddress" name="address" rows="4">@Model?.Address</textarea>
|
|
</div>
|