Bearbeitung von Lektion und Kurs

This commit is contained in:
2020-06-09 16:00:08 +02:00
parent 6a49e1b8f7
commit 01585fc9ef
13 changed files with 317 additions and 72 deletions

View File

@@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Mvc.Rendering;
namespace MultipleChoiceTrainer.Models
{
public class AbstractEditViewModel<T>
where T: new()
{
public T Entity { get; set; }
public int? PreviousCategoryId { get; set; }
public SelectList Assignables { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using MultipleChoiceTrainer.Models.DataModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MultipleChoiceTrainer.Models
{
public class CategoryEditViewModel: AbstractEditViewModel<Category>
{
}
}

View File

@@ -15,8 +15,9 @@ namespace MultipleChoiceTrainer.Models.DataModels
[Display(Name = "Beschreibung")]
public string Description { get; set; }
[Display(Name = "Kurs")]
public Category Category { get; set; }
[Display(Name = "Kurs")]
public int CategoryId { get; set; }
public ICollection<Question> Questions { get; set; } = new HashSet<Question>();

View File

@@ -0,0 +1,14 @@
using MultipleChoiceTrainer.Models.DataModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MultipleChoiceTrainer.Models
{
public class HomeViewModel
{
public IList<Category> Categories { get; set; }
public int SelectedCategoryId { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using MultipleChoiceTrainer.Models.DataModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MultipleChoiceTrainer.Models
{
public class SectionEditViewModel: AbstractEditViewModel<Section>
{
}
}