Bearbeitung von Lektion und Kurs
This commit is contained in:
13
MultipleChoiceTrainer/Models/AbstractEditViewModel.cs
Normal file
13
MultipleChoiceTrainer/Models/AbstractEditViewModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
12
MultipleChoiceTrainer/Models/CategoryEditViewModel.cs
Normal file
12
MultipleChoiceTrainer/Models/CategoryEditViewModel.cs
Normal 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>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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>();
|
||||
|
||||
14
MultipleChoiceTrainer/Models/HomeViewModel.cs
Normal file
14
MultipleChoiceTrainer/Models/HomeViewModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
12
MultipleChoiceTrainer/Models/SectionEditViewModel.cs
Normal file
12
MultipleChoiceTrainer/Models/SectionEditViewModel.cs
Normal 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>
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user