using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Kreta.Resources; namespace Kreta.Web.Areas.Orarend.Models { public class HazifeladatBevitelModel { public int? Id { get; set; } public int? TanitasiOraId { get; set; } public int? OrarendiOraId { get; set; } public int? Oraszam { get; set; } public bool IsTTF { get; set; } public int UsedFilesSizeInKiloBytes { get; set; } = 0; public int MaxAllowedFilesSizeInKiloBytes { get; set; } = 15360; public double UsedFilesSizeInKiloBytesTotal { get; set; } = 0D; public int MaxAllowedFilesSizeInKiloBytesTotal { get; set; } = 2097152; public IEnumerable AllowedFileExtensions { get; set; } = new List { ".txt", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".bmp", ".jpg", ".jpeg", ".png", ".rar", ".zip" }; public int? CsatolmanyId { get; set; } [Display(Name = nameof(OrarendResource.Tantargyfelosztas), ResourceType = typeof(OrarendResource))] public int? TTFId { get; set; } [Required(ErrorMessageResourceName = nameof(OrarendResource.HazifeladatSzovegKotelezo), ErrorMessageResourceType = typeof(OrarendResource))] public string Szoveg { get; set; } [Display(Name = nameof(OrarendResource.OsztalyCsoport), ResourceType = typeof(OrarendResource))] public string OsztalycsoportNev { get; set; } public int? OsztalycsoportId { get; set; } [Display(Name = nameof(OrarendResource.Tantargy), ResourceType = typeof(OrarendResource))] public string TantarrgyNev { get; set; } public int? TantargyId { get; set; } public DateTime ErvenyessegKezdete { get; set; } [Required(ErrorMessageResourceName = nameof(OrarendResource.HazifeladatHataridoKotelezo), ErrorMessageResourceType = typeof(OrarendResource))] [Display(Name = nameof(OrarendResource.HazifeladatHatarido), ResourceType = typeof(OrarendResource))] public DateTime? ErvenyessegVege { get; set; } public int? FeladatTipusId { get; set; } public bool ValidateModel() { if (Id.HasValue || TTFId.HasValue || (TantargyId.HasValue && OsztalycsoportId.HasValue)) { return false; } return true; } } }