using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using Kreta.BusinessLogic.HelperClasses; using Kreta.BusinessLogic.Interfaces; using Kreta.Resources; namespace Kreta.Web.Areas.Tanulo.Models { public class HetesekModel : IKretaIdentity { public string ID { get; set; } [Display(Name = nameof(HetesResource.HetSorszama), ResourceType = typeof(HetesResource))] public int HetSorszam { get; set; } [Display(Name = nameof(HetesResource.HetKezdoNapja), ResourceType = typeof(HetesResource))] public DateTime HetKezdoNap { get; set; } [Display(Name = nameof(HetesResource.HetUtolsoNapja), ResourceType = typeof(HetesResource))] public DateTime HetUtolsoNap { get; set; } [Display(Name = nameof(HetesResource.Hetirend), ResourceType = typeof(HetesResource))] public string Hetirend { get; set; } [Display(Name = nameof(HetesResource.HetesTanulok), ResourceType = typeof(HetesResource))] public string Tanulok { get; set; } public int OsztalyCsoportId { get; set; } public HetesekCO ToCo() { var tanuloIds = new List(); if (!string.IsNullOrWhiteSpace(Tanulok)) { tanuloIds = Tanulok.Split(',').Select(x => int.Parse(x)).ToList(); } return new HetesekCO() { HetSorszam = HetSorszam, TanuloIdList = tanuloIds }; } } }