177 lines
10 KiB
C#
177 lines
10 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Web.Mvc;
|
|
using Kreta.BusinessLogic.Classes;
|
|
using Kreta.Enums;
|
|
using Kreta.Resources;
|
|
using Kreta.Web.Security;
|
|
|
|
namespace Kreta.Web.Areas.Intezmeny.Models
|
|
{
|
|
public class EszkozModel
|
|
{
|
|
public EszkozModel()
|
|
{
|
|
TipusList = new List<SelectListItem>();
|
|
KategoriaList = new List<SelectListItem>();
|
|
JellegList = new List<SelectListItem>();
|
|
CeljaList = new List<SelectListItem>();
|
|
MertekegysegList = new List<SelectListItem>();
|
|
}
|
|
|
|
public int? ID { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.EszkozNeve), ResourceType = typeof(EszkozResource))]
|
|
[KretaRequired(ErrorMessageResourceName = nameof(ErrorResource.EszkozNevMegadasaKotelezo), ErrorMessageResourceType = typeof(ErrorResource))]
|
|
[MaxLength(255, ErrorMessageResourceName = nameof(ErrorResource.EszkozNevTulHosszu), ErrorMessageResourceType = typeof(ErrorResource))]
|
|
public string Nev { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.FellelhetosegiHely), ResourceType = typeof(EszkozResource))]
|
|
[KretaRequired(ErrorMessageResourceName = nameof(ErrorResource.FellelhetosegiHelyMegadasaKotelezo), ErrorMessageResourceType = typeof(ErrorResource))]
|
|
public int? TeremID { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.FellelhetosegiHely), ResourceType = typeof(EszkozResource))]
|
|
public string TeremNev { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.LeltariSzam), ResourceType = typeof(EszkozResource))]
|
|
[MaxLength(20, ErrorMessageResourceName = nameof(ErrorResource.LeltariSzamNemLehetHosszabb20Karakternel), ErrorMessageResourceType = typeof(ErrorResource))]
|
|
public string LeltariSzam { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.Jelleg), ResourceType = typeof(EszkozResource))]
|
|
public int? Jelleg { get; set; } //EszkozJellegEnum?
|
|
|
|
[Display(Name = nameof(EszkozResource.Jelleg), ResourceType = typeof(EszkozResource))]
|
|
public string JellegNev { get { return Jelleg.GetDisplayName<EszkozJellegEnum>(ClaimData.SelectedTanevID.Value); } }
|
|
|
|
[Display(Name = nameof(EszkozResource.Felhasznalas), ResourceType = typeof(EszkozResource))]
|
|
public string Felhasznalas { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.EszkozTipusa), ResourceType = typeof(EszkozResource))]
|
|
public int? Tipus { get; set; } //EszkozTipusEnum?
|
|
|
|
[Display(Name = nameof(EszkozResource.Kategoria), ResourceType = typeof(EszkozResource))]
|
|
public int? Kategoria { get; set; } //EszkozKategoriaEnum?
|
|
|
|
[Display(Name = nameof(EszkozResource.Kategoria), ResourceType = typeof(EszkozResource))]
|
|
public string KategoriaNev { get { return Kategoria.GetDisplayName<EszkozKategoriaEnum>(ClaimData.SelectedTanevID.Value); } }
|
|
|
|
[Display(Name = nameof(EszkozResource.BeszerzesDatuma), ResourceType = typeof(EszkozResource))]
|
|
[KretaDateRange(ErrorMessageResourceName = nameof(ErrorResource.BeszerzesDatumaNemErvenyes), ErrorMessageResourceType = typeof(ErrorResource))]
|
|
public DateTime? BeszerzesDatum { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.BeszerzesDatuma), ResourceType = typeof(EszkozResource))]
|
|
public string BeszerzesDatumRovid { get { return BeszerzesDatum.HasValue ? BeszerzesDatum.Value.ToShortDateString() : ""; } }
|
|
|
|
[Display(Name = nameof(EszkozResource.BeszerzesiErtek), ResourceType = typeof(EszkozResource))]
|
|
[KretaRange(0, int.MaxValue, ErrorMessageResourceName = nameof(ErrorResource.EszkozArNemLehetNegativ), ErrorMessageResourceType = typeof(ErrorResource))]
|
|
public int? BeszerzesiAr { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.Mennyiseg), ResourceType = typeof(EszkozResource))]
|
|
[KretaParameterizedRange(0, 99999, ErrorMessageResourceName = nameof(ErrorResource.EszkozAMennyisegCsakEgyParameterekKozottiEgeszSzamLehet), ErrorMessageResourceType = typeof(ErrorResource))]
|
|
public int? Darabszam { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.MennyisegiEgyseg), ResourceType = typeof(EszkozResource))]
|
|
public int? MennyisegiEgyseg { get; set; } //MertekegysegTipusEnum?
|
|
|
|
[Display(Name = nameof(EszkozResource.MennyisegiEgyseg), ResourceType = typeof(EszkozResource))]
|
|
public string MennyisegiEgysegNev { get { return MennyisegiEgyseg.GetDisplayName<MertekegysegTipusEnum>(ClaimData.SelectedTanevID.Value); } }
|
|
|
|
[Display(Name = nameof(EszkozResource.GyariSzam), ResourceType = typeof(EszkozResource))]
|
|
public string GyariSzam { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.GyartasiEv), ResourceType = typeof(EszkozResource))]
|
|
[KretaRegularExpression(Core.Constants.RegularExpressions.GyartasiEv, ErrorMessageResourceName = nameof(ErrorResource.GyartasiEvFormatumaNemMegfelelo), ErrorMessageResourceType = typeof(ErrorResource))]
|
|
public int? GyartasiEv { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.FelelosSzemely), ResourceType = typeof(EszkozResource))]
|
|
public int? SzemelyiFelelos { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.FelelosSzemely), ResourceType = typeof(EszkozResource))]
|
|
public string FelelosNev { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.Szallito), ResourceType = typeof(EszkozResource))]
|
|
[StringLength(maximumLength: 50, ErrorMessageResourceName = nameof(ErrorResource.SzallitoMax50Karakter), ErrorMessageResourceType = typeof(ErrorResource))]
|
|
public string Szallito { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.FokonyviSzam), ResourceType = typeof(EszkozResource))]
|
|
[StringLength(maximumLength: 50, ErrorMessageResourceName = nameof(ErrorResource.FokonyviszamMax50Karakter), ErrorMessageResourceType = typeof(ErrorResource))]
|
|
public string FokonyviSzam { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.Berelt), ResourceType = typeof(EszkozResource))]
|
|
public bool Berelt { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.Berelt), ResourceType = typeof(EszkozResource))]
|
|
public string Berelt_BNAME { get { return Berelt.GetDisplayName(); } } //Igen, Nem
|
|
|
|
[Display(Name = nameof(EszkozResource.TanuloHozzaferhet), ResourceType = typeof(EszkozResource))]
|
|
public bool TanuloHozzaferhet { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.TanuloHozzaferhet), ResourceType = typeof(EszkozResource))]
|
|
public string TanuloHozzaferhet_BNAME { get { return TanuloHozzaferhet.GetDisplayName(); } } //Igen, Nem
|
|
|
|
[Display(Name = nameof(EszkozResource.PedagogusHozzaferhet), ResourceType = typeof(EszkozResource))]
|
|
public bool PedagogusHozzaferhet { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.PedagogusHozzaferhet), ResourceType = typeof(EszkozResource))]
|
|
public string PedagogusHozzaferhet_BNAME { get { return PedagogusHozzaferhet.GetDisplayName(); } } //Igen, Nem
|
|
|
|
[Display(Name = nameof(EszkozResource.Multimedias), ResourceType = typeof(EszkozResource))]
|
|
public bool Multimedias { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.Multimedias), ResourceType = typeof(EszkozResource))]
|
|
public string Multimedias_BNAME { get { return Multimedias.GetDisplayName(); } } //Igen, Nem
|
|
|
|
[Display(Name = nameof(EszkozResource.HalotatiKapcsolat), ResourceType = typeof(EszkozResource))]
|
|
public bool HalozatiKapcsolat { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.HalotatiKapcsolat), ResourceType = typeof(EszkozResource))]
|
|
public string HalozatiKapcsolat_BNAME { get { return HalozatiKapcsolat.GetDisplayName(); } } //Igen, Nem
|
|
|
|
[Display(Name = nameof(EszkozResource.Internetkapcsolat), ResourceType = typeof(EszkozResource))]
|
|
public bool InternetKapcsolat { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.Internetkapcsolat), ResourceType = typeof(EszkozResource))]
|
|
public string InternetKapcsolat_BNAME { get { return InternetKapcsolat.GetDisplayName(); } } //Igen, Nem
|
|
|
|
[Display(Name = nameof(EszkozResource.Hordozhato), ResourceType = typeof(EszkozResource))]
|
|
public bool Hordozhato { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.Hordozhato), ResourceType = typeof(EszkozResource))]
|
|
public string Hordozhato_BNAME { get { return Hordozhato.GetDisplayName(); } } //Igen, Nem
|
|
|
|
[Display(Name = nameof(EszkozResource.Tartozek), ResourceType = typeof(EszkozResource))]
|
|
public bool Tartozek { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.Tartozek), ResourceType = typeof(EszkozResource))]
|
|
public string Tartozek_BNAME { get { return Tartozek.GetDisplayName(); } } //Igen, Nem
|
|
|
|
[Display(Name = nameof(EszkozResource.TartozekHivatkozas), ResourceType = typeof(EszkozResource))]
|
|
public string TartozekHivatkozas { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.Megjegyzes), ResourceType = typeof(EszkozResource))]
|
|
[StringLength(255, ErrorMessageResourceName = nameof(ErrorResource.AMegjegyzesMax255KarakterLehet), ErrorMessageResourceType = typeof(ErrorResource))]
|
|
public string Megjegyzes { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.EszkozFelhasznalas), ResourceType = typeof(EszkozResource))]
|
|
public int? Celja { get; set; } //EszkozCelEnum?
|
|
|
|
[Display(Name = nameof(EszkozResource.EszkozFelhasznalas), ResourceType = typeof(EszkozResource))]
|
|
public string CeljaNev { get { return Celja.GetDisplayName<EszkozCelEnum>(ClaimData.SelectedTanevID.Value); } }
|
|
|
|
[Display(Name = nameof(EszkozResource.Vonalkod), ResourceType = typeof(EszkozResource))]
|
|
public string Vonalkod { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.HibasEszkoz), ResourceType = typeof(EszkozResource))]
|
|
public bool NemMukodik { get; set; }
|
|
|
|
[Display(Name = nameof(EszkozResource.HibasEszkoz), ResourceType = typeof(EszkozResource))]
|
|
public string NemMukodik_BNAME { get { return NemMukodik.GetDisplayName(); } } //Igen, Nem
|
|
|
|
public List<SelectListItem> TipusList { get; set; }
|
|
public List<SelectListItem> KategoriaList { get; set; }
|
|
public List<SelectListItem> JellegList { get; set; }
|
|
public List<SelectListItem> CeljaList { get; set; }
|
|
public List<SelectListItem> MertekegysegList { get; set; }
|
|
}
|
|
}
|