Initial commit
This commit is contained in:
35
Groceries/Stores/_StoreForm.cshtml
Normal file
35
Groceries/Stores/_StoreForm.cshtml
Normal file
@ -0,0 +1,35 @@
|
||||
@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>
|
Reference in New Issue
Block a user