diff --git a/Rendelosch/Models/ProductForm.cs b/Rendelosch/Models/ProductForm.cs index e97fe59d5b3c99b6087b2787c23d1a7ff8cf5372..97fb44968dab4ace869da1db802ec471c62be732 100644 --- a/Rendelosch/Models/ProductForm.cs +++ b/Rendelosch/Models/ProductForm.cs @@ -1,6 +1,8 @@ -namespace Rendelosch.Models; +using System.Collections; -public class ProductForm +namespace Rendelosch.Models; + +public class ProductForm : IEnumerable { public readonly string Id; public readonly string Title; @@ -15,4 +17,9 @@ public class ProductForm Title = title; Fields = fields; } + + public IEnumerator GetEnumerator() + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Rendelosch/Pages/SubmitForm.cshtml b/Rendelosch/Pages/SubmitForm.cshtml new file mode 100644 index 0000000000000000000000000000000000000000..597f2219a6beb1fd125805e26a825e8387d7ad4b --- /dev/null +++ b/Rendelosch/Pages/SubmitForm.cshtml @@ -0,0 +1,27 @@ +@page "{Id}" +@model Rendelosch.Pages.SubmitForm + +@{ + ViewData["Title"] = "Submit"; +} + +<form method="post" > + <div class="container-lg"> + <h1>@Model.Repository.GetProductForm(Request.RouteValues["Id"].ToString()).Title</h1> + <div> + @foreach (var productForm in Model.Repository.GetProductForm(Request.RouteValues["Id"].ToString()).Fields) + { + <div class="card-title col-6 m-0 me-3"> + <Label > + @productForm.Name + </Label> + <input class="form-control col-6"/> + </div> + + } + <input class="btn btn-primary mt-4" type="submit"/> + </div> + </div> +</form> + + diff --git a/Rendelosch/Pages/SubmitForm.cshtml.cs b/Rendelosch/Pages/SubmitForm.cshtml.cs new file mode 100644 index 0000000000000000000000000000000000000000..3abfe6356b3a809e436ef4c7b4407820369b034a --- /dev/null +++ b/Rendelosch/Pages/SubmitForm.cshtml.cs @@ -0,0 +1,19 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; +using Rendelosch.Repository; + +namespace Rendelosch.Pages; + +public class SubmitForm : PageModel +{ + public IProductFormRepository Repository { get; } + + public SubmitForm(IProductFormRepository repository) + { + Repository = repository; + } + + public void OnPost() + { + + } +} \ No newline at end of file