Skip to content
Snippets Groups Projects
Commit 3826d395 authored by Laci's avatar Laci
Browse files

Második alkalom

parent d53dfe31
No related branches found
No related tags found
No related merge requests found
namespace Rendelosch.Models; using System.Collections;
public class ProductForm namespace Rendelosch.Models;
public class ProductForm : IEnumerable
{ {
public readonly string Id; public readonly string Id;
public readonly string Title; public readonly string Title;
...@@ -15,4 +17,9 @@ public class ProductForm ...@@ -15,4 +17,9 @@ public class ProductForm
Title = title; Title = title;
Fields = fields; Fields = fields;
} }
public IEnumerator GetEnumerator()
{
throw new NotImplementedException();
}
} }
\ No newline at end of file
@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>
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment