using System; using System.Collections.Generic; using System.Xml.Serialization; using Kreta.BusinessLogic.Utils; namespace Kreta.BusinessLogic.HelperClasses { [XmlRoot(ElementName = "KIRTanarok")] public class KIRImportTanarokCO { public KIRImportTanarokCO() { Tanarok = new List(); } [XmlArray(ElementName = "ImportaltTanarok")] [XmlArrayItem("Tanar", Type = typeof(TanarKirAdatCO))] public List Tanarok { get; set; } public List Validate() { var errors = new List(); foreach (var tanar in Tanarok) { if (!tanar.IsValid) { errors.Add(tanar.ErrorMessage); } } return errors; } } public class TanarKirAdatCO { public TanarKirAdatCO() { Errors = new List(); } public int ID { get; set; } public string OktatasiAzonosito { get; set; } public string ViseltNevElotag { get; set; } public string ViseltNevVezetekNev { get; set; } public string ViseltNevKeresztNev { get; set; } public string ViseltNevNevSorrend { get; set; } public string AnyjaNeveElotag { get; set; } public string AnyjaNeveVezetekNev { get; set; } public string AnyjaNeveKeresztNev { get; set; } public string AnyjaNeveNevSorrend { get; set; } public string SzuletesiNevElotag { get; set; } public string SzuletesiNevVezetekNev { get; set; } public string SzuletesiNevKeresztNev { get; set; } public string SzuletesiNevNevSorrend { get; set; } public string Telefonszam { get; set; } [XmlIgnore] public DateTime? SzuletesiDatum { get; set; } [XmlElement(ElementName = "SzuletesiDatum")] public string SzuletesiDatumString { get; set; } public string SzuletesiHely { get; set; } public int? SzuletesiOrszag { get; set; } public string KeresesiNev { get; set; } public string NyomtatasiNev { get; set; } [XmlElement(ElementName = "Allampolgarsag")] public int? Allampolgarsag { get; set; } [XmlElement(ElementName = "Allampolgarsag2")] public int? Allampolgarsag2 { get; set; } [XmlElement(ElementName = "Nem")] public int? Nem { get; set; } [XmlElement(ElementName = "BelugyMiniszteriumSzemelyiadatEsLakcimNyilvantartasavalBeazonositott")] public string BelugyMiniszteriumSzemelyiadatEsLakcimNyilvantartasavalBeazonositott { get; set; } [XmlElement(ElementName = "UtolsoSzemelyiadatEsLakcimNyilvantartasFrissitesIdopontja")] public string UtolsoSzemelyiadatEsLakcimNyilvantartasFrissitesIdopontjaString { get; set; } [XmlIgnore] public DateTime? UtolsoSzemelyiadatEsLakcimNyilvantartasFrissitesIdopontja { get; set; } [XmlIgnore] public string VegzettSzintje { get; set; } public string AllandoLakcim { get; set; } public string AllandoLakcimIranyitoSzam { get; set; } public string AllandoLakcimTelepules { get; set; } public string AllandoLakcimKozteruletNev { get; set; } public string AllandoLakcimKozteruletJellegNev { get; set; } public string AllandoLakcimHazszam { get; set; } public string AllandoLakcimPontositas { get; set; } public string TartozkodasiCim { get; set; } public string TartozkodasiCimIranyitoSzam { get; set; } public string TartozkodasiCimTelepules { get; set; } public string TartozkodasiCimKozteruletNev { get; set; } public string TartozkodasiCimKozteruletJellegNev { get; set; } public string TartozkodasiCimHazszam { get; set; } public string TartozkodasiCimPontositas { get; set; } public string EmailCim { get; set; } [XmlIgnore] public int? SzakmaiGyakorlatiEve { get; set; } [XmlIgnore] public string KozoktatasiIntezmenyNeve { get; set; } [XmlIgnore] public string KozoktatasiIntezmenySzekhelye { get; set; } public string OMAzonosito { get; set; } [XmlIgnore] public string KiemeltFeladatellatasiHely { get; set; } [XmlIgnore] public string VezetoiBeosztas { get; set; } [XmlIgnore] public DateTime? JogviszonyKezdete { get; set; } [XmlElement(ElementName = "JogviszonyKezdete")] public string JogviszonyKezdeteString { get; set; } [XmlIgnore] public DateTime? JogviszonyBefejezese { get; set; } [XmlElement(ElementName = "JogviszonyBefejezese")] public string JogviszonyBefejezeseString { get; set; } public string JogviszonyTipusa { get; set; } [XmlIgnore] public string BesorolasiKategoria { get; set; } [XmlIgnore] public string FizetesiOsztaly { get; set; } [XmlIgnore] public string Potlek { get; set; } [XmlIgnore] public string MunkakorKategoria { get; set; } [XmlIgnore] public string Munkakor { get; set; } [XmlIgnore] public string Tantargy { get; set; } [XmlIgnore] public string Szakkepzettsegek { get; set; } [XmlIgnore] public string TudomanyosFokozatok { get; set; } [XmlIgnore] public string PedagogusSzakvizsgak { get; set; } [XmlIgnore] public string EgyebTovabbkepzesek { get; set; } public int FoglalkoztatasTipus { get; set; } public string Foallas { get; set; } public int KotelezoOraszam { get; set; } public int MunkakorTipusa { get; set; } public int MunkaviszonyTipusa { get; set; } public string SzuletesiNeve { get; set; } public string AnyjaNeve { get; set; } [XmlIgnore] public int LineNumber { get; set; } [XmlIgnore] public List Errors { get; set; } [XmlIgnore] public bool IsValid { get { var errors = new List(); errors.AddRange(Errors); if (string.IsNullOrWhiteSpace(AnyjaNeve)) { errors.Add(StringResourcesUtils.GetString(4042)/*"az anyja neve nincs megadva"*/); } if (string.IsNullOrWhiteSpace(NyomtatasiNev)) { errors.Add(StringResourcesUtils.GetString(4043)/*"a viselt név nincs megadva"*/); } if (errors.Count > 0) { ErrorMessage = string.Format("A(z) {0}. sorban {1}", LineNumber, string.Join(", ", errors)); return false; } return true; } } [XmlIgnore] public string ErrorMessage { get; set; } } }