dde39d52dd
- OK salvataggio ricetta in MongoDB
75 lines
3.2 KiB
Plaintext
75 lines
3.2 KiB
Plaintext
@if (isLoading)
|
|
{
|
|
<LoadingData></LoadingData>
|
|
}
|
|
else
|
|
{
|
|
<div class="card shadow p-3 mb-5 bg-body rounded">
|
|
<div class="card-header">
|
|
<h5>Testata Ricetta</h5>
|
|
@if (CurrRecipe?.HeadVal != null)
|
|
{
|
|
<div class="row g-1">
|
|
@foreach (var item in CurrRecipe.HeadVal)
|
|
{
|
|
<div class="col-3">
|
|
<div class="form-floating2">
|
|
<small class="form-label small">@item.Key</small>
|
|
@if (item.Value.Type == MP.Data.MgModels.RecipeModel.KeyType.Fixed)
|
|
{
|
|
<input type="text" class="form-control" placeholder="@item.Key" @bind-value="@item.Value.Value" disabled>
|
|
}
|
|
else if (item.Value.Type == MP.Data.MgModels.RecipeModel.KeyType.Enum)
|
|
{
|
|
<select class="form-select" @bind="@item.Value.Value">
|
|
@foreach (var enumItem in GetListByType(item.Value.EnumType))
|
|
{
|
|
<option value="@enumItem.Key">@enumItem.Value</option>
|
|
}
|
|
</select>
|
|
}
|
|
else
|
|
{
|
|
<input type="text" class="form-control" placeholder="@item.Key" @bind-value="@item.Value.Value">
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="row g-1">
|
|
<div class="col-6">
|
|
<div class="d-grid">
|
|
<button class="btn btn-sm btn-success" @onclick="() => SaveHeadData()">Save</button>
|
|
</div>
|
|
</div>
|
|
<div class="col-6">
|
|
<div class="d-grid">
|
|
<button class="btn btn-sm btn-warning" @onclick="() => CancelHeadData()">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="card-body">
|
|
<h5>Righe Ricetta</h5>
|
|
@if (CurrRecipe?.RowsVal != null)
|
|
{
|
|
@foreach (var riga in CurrRecipe.RowsVal)
|
|
{
|
|
<div class="row g-1">
|
|
@foreach (var item in riga.Value)
|
|
{
|
|
<div class="col-3">
|
|
<div class="form-floating">
|
|
<input type="text" class="form-control" placeholder="@item.Key" @bind-value="@item.Value.Value">
|
|
<label>@item.Key</label>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|