| | 1 | | @inject MUNity.Database.Context.MunityContext context |
| | 2 | |
|
| 0 | 3 | | @foreach (var field in formula.Fields) |
| 0 | 4 | | { |
| 0 | 5 | | var targetField = Application.FormulaInputs.FirstOrDefault(n => n.Field == field); |
| | 6 | | <div class="row mb-15px"> |
| 0 | 7 | | <label class="form-label col-form-label col-md-3">@field.FieldName</label> |
| | 8 | | <div class="col-md-9"> |
| 0 | 9 | | @if (field.FieldType == ConferenceApplicationFieldTypes.MultiLineText) |
| 0 | 10 | | { |
| | 11 | | <textarea @bind="targetField.Value" class="form-control" rows="3"></textarea> |
| | 12 | |
|
| 0 | 13 | | } |
| 0 | 14 | | @if (!string.IsNullOrEmpty(field.FieldDescription)) |
| 0 | 15 | | { |
| 0 | 16 | | <small class="fs-12px text-gray-500-darker">@field.FieldDescription</small> |
| 0 | 17 | | } |
| | 18 | | </div> |
| | 19 | | </div> |
| 0 | 20 | | } |
| | 21 | |
|
| | 22 | | <div class="row"> |
| 0 | 23 | | <button class="btn btn-primary" @onclick="() => Finished.InvokeAsync()">Weiter</button> |
| | 24 | | </div> |
| | 25 | |
|
| | 26 | | @code { |
| 0 | 27 | | [Parameter] public string ConferenceId { get; set; } |
| | 28 | |
|
| 0 | 29 | | [Parameter] public MUNity.Database.Models.Conference.DelegationApplication Application { get; set; } |
| | 30 | |
|
| 0 | 31 | | [Parameter] public EventCallback Finished { get; set; } |
| | 32 | |
|
| | 33 | | private MUNity.Database.Models.Conference.ConferenceApplicationFormula formula; |
| | 34 | |
|
| | 35 | | protected override async Task OnInitializedAsync() |
| 0 | 36 | | { |
| 0 | 37 | | await base.OnInitializedAsync(); |
| | 38 | |
|
| | 39 | |
|
| 0 | 40 | | formula = context.ConferenceApplicationFormulas |
| 0 | 41 | | .Include(n => n.Fields) |
| 0 | 42 | | .FirstOrDefault(n => n.Options.Conference.ConferenceId == ConferenceId); |
| | 43 | |
|
| 0 | 44 | | foreach (var field in formula.Fields) |
| 0 | 45 | | { |
| 0 | 46 | | Application.FormulaInputs.Add(new Database.Models.Conference.ConferenceDelegationApplicationFieldInput() |
| 0 | 47 | | { |
| 0 | 48 | | Application = Application, |
| 0 | 49 | | Field = field, |
| 0 | 50 | | Value = field.DefaultValue |
| 0 | 51 | | }); |
| 0 | 52 | | } |
| 0 | 53 | | } |
| | 54 | | } |