kreta/KretaWeb/Models/AmiKepzesiJellemzokModel.cs
2024-03-13 00:33:46 +01:00

65 lines
3.3 KiB
C#

using System.ComponentModel.DataAnnotations;
using Foolproof;
using Kreta.BusinessLogic.Classes;
using Kreta.Enums;
using Kreta.Resources;
using Kreta.Web.Security;
namespace Kreta.Web.Models
{
public class AmiKepzesiJellemzokModel
{
[RequiredIf("MuveszetiAgValidationAttr", true, ErrorMessageResourceName = nameof(ErrorResource.MufajMegadasaKotelezo), ErrorMessageResourceType = typeof(ErrorResource))]
[Display(Name = nameof(TantargyResource.Mufaj), ResourceType = typeof(TantargyResource))]
public int? MufajTipusId { get; set; }
[Display(Name = nameof(TantargyResource.Mufaj), ResourceType = typeof(TantargyResource))]
public string MufajTipus_DNAME => MufajTipusId.GetDisplayName<MufajTipusEnum>(ClaimData.SelectedTanevID.Value);
[Display(Name = nameof(TantargyResource.Tanszak), ResourceType = typeof(TantargyResource))]
[RequiredIf("IsRequiredAmiKepzesiJellemzok", true, ErrorMessageResourceName = nameof(ErrorResource.TanszakMegadasaKotelezo), ErrorMessageResourceType = typeof(ErrorResource))]
public int? TanszakTipusId { get; set; }
[Display(Name = nameof(TantargyResource.Tanszak), ResourceType = typeof(TantargyResource))]
public string TanszakTipus_DNAME => TanszakTipusId.GetDisplayName<TanszakTipusEnum>(ClaimData.SelectedTanevID.Value);
[Display(Name = nameof(TantargyResource.MuveszetiAg), ResourceType = typeof(TantargyResource))]
[RequiredIf("IsRequiredAmiKepzesiJellemzok", true, ErrorMessageResourceName = nameof(ErrorResource.MuveszetiAgMegadasaKotelezo), ErrorMessageResourceType = typeof(ErrorResource))]
public int? MuveszetiAgId { get; set; }
[Display(Name = nameof(TantargyResource.MuveszetiAg), ResourceType = typeof(TantargyResource))]
public string MuveszetiAg_DNAME => MuveszetiAgId.GetDisplayName<MuveszetiAgEnum>(ClaimData.SelectedTanevID.Value);
public int ZenemuveszetiAgId => (int)MuveszetiAgEnum.ZenemuveszetiAg;
public int MufajTipusIdDefaultValue => (int)MufajTipusEnum.na;
public bool MuveszetiAgValidationAttr
{
get
{
return MuveszetiAgId == (int)MuveszetiAgEnum.ZenemuveszetiAg;
}
}
public bool IsRequiredAmiKepzesiJellemzok { get; set; } = false;
}
public class AmiKepzesiJellemzokModelForTanulo : AmiKepzesiJellemzokModel
{
[RequiredIf("MuveszetiAgValidationAttr", true, ErrorMessageResourceName = nameof(ErrorResource.MufajMegadasaKotelezoTanugyFul), ErrorMessageResourceType = typeof(ErrorResource))]
public new int? MufajTipusId { get; set; }
[RequiredIf("IsRequiredAmiKepzesiJellemzok", true, ErrorMessageResourceName = nameof(ErrorResource.TanszakMegadasaKotelezoTanugyFul), ErrorMessageResourceType = typeof(ErrorResource))]
public new int? TanszakTipusId { get; set; }
[RequiredIf("IsRequiredAmiKepzesiJellemzok", true, ErrorMessageResourceName = nameof(ErrorResource.MuveszetiAgMegadasaKotelezoTanugyFul), ErrorMessageResourceType = typeof(ErrorResource))]
public new int? MuveszetiAgId { get; set; }
public new bool MuveszetiAgValidationAttr
{
get
{
return MuveszetiAgId == (int)MuveszetiAgEnum.ZenemuveszetiAg;
}
}
}
}