init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
14
KretaWeb/Areas/KirImportExport/Models/CompareModel.cs
Normal file
14
KretaWeb/Areas/KirImportExport/Models/CompareModel.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
using Kreta.Web.Models.EditorTemplates;
|
||||
|
||||
namespace Kreta.Web.Areas.KirImportExport.Models.KirImport
|
||||
{
|
||||
public class CompareModel : TabStripModel
|
||||
{
|
||||
public bool IsImportFromKir { get; set; }
|
||||
public int FelhasznaloId { get; set; }
|
||||
public string GridName { get; set; }
|
||||
public string GridApiUrl { get; set; }
|
||||
public string GridAction { get; set; }
|
||||
public bool TanugyiAdatokTabIsVisible { get; set; }
|
||||
}
|
||||
}
|
40
KretaWeb/Areas/KirImportExport/Models/KirGridModel.cs
Normal file
40
KretaWeb/Areas/KirImportExport/Models/KirGridModel.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Core.Domain;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.KirImportExport.Models.KirImport
|
||||
{
|
||||
public class KirGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.Nev), ResourceType = typeof(KirImportExportResource))]
|
||||
public string Nev { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.OktatasiAzonosito), ResourceType = typeof(KirImportExportResource))]
|
||||
public string OktatasiAzonosito { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.SzuletesiIdo), ResourceType = typeof(KirImportExportResource))]
|
||||
public DateTime SzuletesiIdo { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.SzuletesiHely), ResourceType = typeof(KirImportExportResource))]
|
||||
public string SzuletesiHely { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.Statusz), ResourceType = typeof(KirImportExportResource))]
|
||||
public string ValtozottString { get; set; }
|
||||
|
||||
public KirEditableEnum Szerkesztheto { get; set; }
|
||||
|
||||
public static implicit operator KirGridModel(KirFelhasznalo kirAlkalmazott) => new KirGridModel
|
||||
{
|
||||
ID = kirAlkalmazott.Id.ToString(),
|
||||
Nev = kirAlkalmazott.NyomtatasiNev ?? $"{kirAlkalmazott.NevElotag} {kirAlkalmazott.SzuletesiNev}",
|
||||
OktatasiAzonosito = kirAlkalmazott.OktatasiAzonosito,
|
||||
SzuletesiHely = kirAlkalmazott.SzuletesiHely,
|
||||
SzuletesiIdo = kirAlkalmazott.SzuletesiDatum.Value,
|
||||
};
|
||||
}
|
||||
}
|
30
KretaWeb/Areas/KirImportExport/Models/KirLoginModel.cs
Normal file
30
KretaWeb/Areas/KirImportExport/Models/KirLoginModel.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.Core.KIR.Domain.Model;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.KirImportExport.Models.KirImport
|
||||
{
|
||||
public class KirLoginModel
|
||||
{
|
||||
[Display(Name = nameof(KirImportExportResource.IntezmenyAzonosito), ResourceType = typeof(KirImportExportResource))]
|
||||
public string IntezmenyAzonosito { get; set; } = ClaimData.OrganizationCode;
|
||||
|
||||
[Required(ErrorMessageResourceName = nameof(ErrorResource.AFelhasznalonevMegadasaKotelezo), ErrorMessageResourceType = typeof(ErrorResource))]
|
||||
[Display(Name = nameof(KirImportExportResource.KirFelhasznaloNev), ResourceType = typeof(KirImportExportResource))]
|
||||
public string FelhasznaloNev { get; set; }
|
||||
|
||||
[Required(ErrorMessageResourceName = nameof(ErrorResource.JelszoMegadasaKotelezo), ErrorMessageResourceType = typeof(ErrorResource))]
|
||||
[Display(Name = nameof(KirImportExportResource.KirJelszo), ResourceType = typeof(KirImportExportResource))]
|
||||
public string Jelszo { get; set; }
|
||||
|
||||
public string Url { get; set; }
|
||||
|
||||
public static implicit operator AuthHeaderModel(KirLoginModel kirLoginModel) => new AuthHeaderModel
|
||||
{
|
||||
Intezmeny = kirLoginModel.IntezmenyAzonosito,
|
||||
FelhasznaloNev = kirLoginModel.FelhasznaloNev,
|
||||
Jelszo = kirLoginModel.Jelszo
|
||||
};
|
||||
}
|
||||
}
|
48
KretaWeb/Areas/KirImportExport/Models/KirSearchModel.cs
Normal file
48
KretaWeb/Areas/KirImportExport/Models/KirSearchModel.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.KirImportExport.Models.KirImport
|
||||
{
|
||||
public class KirSearchModel
|
||||
{
|
||||
[Display(Name = nameof(KirImportExportResource.Nev), ResourceType = typeof(KirImportExportResource))]
|
||||
public string NevSearch { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.OktatasiAzonosito), ResourceType = typeof(KirImportExportResource))]
|
||||
public string OktatasiAzonositoSearch { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.SzuletesiIdo), ResourceType = typeof(KirImportExportResource))]
|
||||
public DateTime? SzuletesiDatumTol { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.SzuletesiIdo), ResourceType = typeof(KirImportExportResource))]
|
||||
public DateTime? SzuletesiDatumIg { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.SzuletesiHely), ResourceType = typeof(KirImportExportResource))]
|
||||
public string SzuletesiHelySearch { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.Statusz), ResourceType = typeof(KirImportExportResource))]
|
||||
public int? StatuszSearch { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.KirTelephely), ResourceType = typeof(KirImportExportResource))]
|
||||
public int? KirTelephelyId { get; set; }
|
||||
|
||||
public static implicit operator FelhasznaloKirSearchCo(KirSearchModel kirImportSearchModel) => new FelhasznaloKirSearchCo
|
||||
{
|
||||
Nev = kirImportSearchModel.NevSearch,
|
||||
OktatasiAzonosito = kirImportSearchModel.OktatasiAzonositoSearch,
|
||||
SzuletesiDatumTol = kirImportSearchModel.SzuletesiDatumTol,
|
||||
SzuletesiDatumIg = kirImportSearchModel.SzuletesiDatumIg,
|
||||
SzuletesiHely = kirImportSearchModel.SzuletesiHelySearch
|
||||
};
|
||||
|
||||
public static void ValidateModel(KirSearchModel kirLoginModel)
|
||||
{
|
||||
if (!kirLoginModel.KirTelephelyId.HasValue)
|
||||
{
|
||||
throw new Exception("KirTelephelyId kötelező");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.KirImportExport.Models.KirImport
|
||||
{
|
||||
public class KirSzinkronOsszehasonlitasGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.KivalasztottAdat), ResourceType = typeof(KirImportExportResource))]
|
||||
public string KivalasztottAdat { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.AdatNeve), ResourceType = typeof(KirImportExportResource))]
|
||||
public string AdatNeve { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.KirAdat), ResourceType = typeof(KirImportExportResource))]
|
||||
public string KirAdat { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.KretaAdat), ResourceType = typeof(KirImportExportResource))]
|
||||
public string KretaAdat { get; set; }
|
||||
|
||||
public bool Valtozott { get; set; }
|
||||
|
||||
[Display(Name = nameof(KirImportExportResource.Valtozott), ResourceType = typeof(KirImportExportResource))]
|
||||
public string ValtozottString => Valtozott.GetDisplayName();
|
||||
|
||||
public string AdatAzonositoNeve { get; set; }
|
||||
}
|
||||
}
|
448
KretaWeb/Areas/KirImportExport/Models/KirSzinkronSaveModel.cs
Normal file
448
KretaWeb/Areas/KirImportExport/Models/KirSzinkronSaveModel.cs
Normal file
|
@ -0,0 +1,448 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.Core;
|
||||
using Kreta.Core.Domain;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.KirImportExport.Models
|
||||
{
|
||||
public class KirSzinkronSaveModel
|
||||
{
|
||||
public string FelhasznaloId { get; set; }
|
||||
public List<ValtozasDict> ValtozasDictData { get; set; }
|
||||
|
||||
public class ValtozasDict
|
||||
{
|
||||
public string Key { get; set; }
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public static implicit operator KirTanarAdatCo(KirSzinkronSaveModel kirSzinkronSaveModel)
|
||||
{
|
||||
var kirTanarAdatCo = new KirTanarAdatCo();
|
||||
|
||||
if (int.TryParse(kirSzinkronSaveModel.FelhasznaloId, out int felhasznaloId))
|
||||
{
|
||||
kirTanarAdatCo.Id = felhasznaloId;
|
||||
}
|
||||
|
||||
List<ValtozasDict> ValtozasDictData = new List<ValtozasDict>(kirSzinkronSaveModel.ValtozasDictData);
|
||||
|
||||
for (int i = 0; i < ValtozasDictData.Count; i++)
|
||||
{
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.AnyjaUtoneve))
|
||||
{
|
||||
kirTanarAdatCo.AnyjaUtoneve = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.AnyjaVezetekNeve))
|
||||
{
|
||||
kirTanarAdatCo.AnyjaCsaladiNeve = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.NevElotag))
|
||||
{
|
||||
kirTanarAdatCo.Elotag = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.SzuletesiUtonev))
|
||||
{
|
||||
kirTanarAdatCo.SzuletesiUtonev = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.SzuletesiVezeteknev))
|
||||
{
|
||||
kirTanarAdatCo.SzuletesiCsaladiNev = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.Utonev))
|
||||
{
|
||||
kirTanarAdatCo.MunkavallaloUtonev = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.Vezeteknev))
|
||||
{
|
||||
kirTanarAdatCo.MunkavallaloCsaladiNev = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.SzuletesiHely))
|
||||
{
|
||||
kirTanarAdatCo.SzuletesiHely = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.SzuletesiDatum))
|
||||
{
|
||||
kirTanarAdatCo.SzuletesiIdo = Convert.ToDateTime(ValtozasDictData[i].Value);
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.Nem))
|
||||
{
|
||||
if (Enum.TryParse(ValtozasDictData[i].Value.RemoveDiacritics(), true, out NemEnum nemEnum))
|
||||
{
|
||||
kirTanarAdatCo.Nem = (int)nemEnum;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirTanarAdatCo.Nem = (int)NemEnum.NA;
|
||||
}
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.AlkalmazasKezdete))
|
||||
{
|
||||
kirTanarAdatCo.AlkalmazasKezdete = Convert.ToDateTime(ValtozasDictData[i].Value);
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.AlkalmazasMegszunese))
|
||||
{
|
||||
kirTanarAdatCo.AlkalmazasVege = Convert.ToDateTime(ValtozasDictData[i].Value);
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.FoglalkoztatasTipusa))
|
||||
{
|
||||
if (Enum.TryParse(ValtozasDictData[i].Value.RemoveDiacritics(), true, out FoglalkoztatasTipusaEnum foglalkoztatasTipusaEnum))
|
||||
{
|
||||
kirTanarAdatCo.FoglalkoztatasTipusa = (int)foglalkoztatasTipusaEnum;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirTanarAdatCo.FoglalkoztatasTipusa = (int)FoglalkoztatasTipusaEnum.TeljesMunkaidos;
|
||||
}
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.OktatasiAzonosito))
|
||||
{
|
||||
kirTanarAdatCo.OktatasiAzonosito = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.Allampolgarsag))
|
||||
{
|
||||
if (Enum.TryParse(ValtozasDictData[i].Value.RemoveDiacritics(), true, out AllampolgarsagEnum allampolgarsagEnum))
|
||||
{
|
||||
kirTanarAdatCo.Allampolgarsag = (int)allampolgarsagEnum;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirTanarAdatCo.Allampolgarsag = (int)AllampolgarsagEnum.magyar;
|
||||
}
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.Allampolgarsag2))
|
||||
{
|
||||
if (Enum.TryParse(ValtozasDictData[i].Value.RemoveDiacritics(), true, out AllampolgarsagEnum allampolgarsagEnum))
|
||||
{
|
||||
kirTanarAdatCo.Allampolgarsag = (int)allampolgarsagEnum;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirTanarAdatCo.Allampolgarsag = (int)AllampolgarsagEnum.magyar;
|
||||
}
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.SzuletesiOrszag))
|
||||
{
|
||||
if (Enum.TryParse(ValtozasDictData[i].Value.RemoveDiacritics(), true, out OrszagTipusEnum orszagTipusEnum))
|
||||
{
|
||||
kirTanarAdatCo.SzuletesiOrszag = (int)orszagTipusEnum;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirTanarAdatCo.SzuletesiOrszag = (int)OrszagTipusEnum.Magyarorszag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return kirTanarAdatCo;
|
||||
}
|
||||
|
||||
public static KirTanarAdatCo ModelToCo(KirSzinkronSaveModel kirSzinkronSaveModel) => kirSzinkronSaveModel;
|
||||
public static KirTanuloAdatCo ModelToTanuloAdatCo(KirSzinkronSaveModel kirSzinkronSaveModel) => kirSzinkronSaveModel;
|
||||
|
||||
public static FelhasznaloElerhetosegCimCO ModelToAllandoLakcimToElerhetosegCimCo(KirSzinkronSaveModel kirSzinkronSaveModel)
|
||||
{
|
||||
var felhasznaloElerhetosegCimCO = new FelhasznaloElerhetosegCimCO();
|
||||
|
||||
if (int.TryParse(kirSzinkronSaveModel.FelhasznaloId, out int FelhasznaloId))
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.FelhasznaloId = FelhasznaloId;
|
||||
}
|
||||
|
||||
felhasznaloElerhetosegCimCO.Alapertelmezett = true;
|
||||
felhasznaloElerhetosegCimCO.CimTipus = (int)CimTipusEnum.allando_lakcim;
|
||||
|
||||
List<ValtozasDict> ValtozasDictData = new List<ValtozasDict>(kirSzinkronSaveModel.ValtozasDictData);
|
||||
|
||||
for (int i = 0; i < ValtozasDictData.Count; i++)
|
||||
{
|
||||
if (ValtozasDictData[i].Key == "AllandoLakcimHazszam")
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.Hazszam = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == "AllandoLakcimIranyitoszam")
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.Iranyitoszam = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == "AllandoLakcimKozteruletJellegeNev")
|
||||
{
|
||||
if (Enum.TryParse(ValtozasDictData[i].Value.RemoveDiacritics(), true, out KozteruletJellegEnum kozteruletJellegEnum))
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.KozteruletTipusNev = kozteruletJellegEnum.GetDisplayName(ClaimData.SelectedTanevID.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.KozteruletTipusNev = KozteruletJellegEnum.na.GetDisplayName(ClaimData.SelectedTanevID.Value);
|
||||
}
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == "AllandoLakcimKozteruletNev")
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.KozteruletNev = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == "AllandoLakcimVaros")
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.HelysegNev = ValtozasDictData[i].Value;
|
||||
}
|
||||
}
|
||||
|
||||
return felhasznaloElerhetosegCimCO;
|
||||
}
|
||||
|
||||
public static FelhasznaloElerhetosegCimCO ModelToTartozkodasiCimToElerhetosegCimCo(KirSzinkronSaveModel kirSzinkronSaveModel)
|
||||
{
|
||||
var felhasznaloElerhetosegCimCO = new FelhasznaloElerhetosegCimCO();
|
||||
|
||||
if (int.TryParse(kirSzinkronSaveModel.FelhasznaloId, out int FelhasznaloId))
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.FelhasznaloId = FelhasznaloId;
|
||||
}
|
||||
|
||||
felhasznaloElerhetosegCimCO.Alapertelmezett = true;
|
||||
felhasznaloElerhetosegCimCO.CimTipus = (int)CimTipusEnum.tartozkodasi_hely;
|
||||
|
||||
List<ValtozasDict> ValtozasDictData = new List<ValtozasDict>(kirSzinkronSaveModel.ValtozasDictData);
|
||||
|
||||
for (int i = 0; i < ValtozasDictData.Count; i++)
|
||||
{
|
||||
if (ValtozasDictData[i].Key == "TartozkodasiCimHazszam")
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.Hazszam = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == "TartozkodasiCimIranyitoszam")
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.Iranyitoszam = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == "TartozkodasiCimKozteruletJellegeNev")
|
||||
{
|
||||
if (Enum.TryParse(ValtozasDictData[i].Value.RemoveDiacritics(), true, out KozteruletJellegEnum kozteruletJellegEnum))
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.KozteruletTipusNev = kozteruletJellegEnum.GetDisplayName(ClaimData.SelectedTanevID.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.KozteruletTipusNev = KozteruletJellegEnum.na.GetDisplayName(ClaimData.SelectedTanevID.Value);
|
||||
}
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == "TartozkodasiCimKozteruletNev")
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.KozteruletNev = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == "TartozkodasiCimVaros")
|
||||
{
|
||||
felhasznaloElerhetosegCimCO.HelysegNev = ValtozasDictData[i].Value;
|
||||
}
|
||||
}
|
||||
|
||||
return felhasznaloElerhetosegCimCO;
|
||||
}
|
||||
|
||||
public static FelhasznaloElerhetosegTelCO ModelToFelhasznaloElerhetosegTelCo(KirSzinkronSaveModel kirSzinkronSaveModel)
|
||||
{
|
||||
var felhasznaloElerhetosegTelCO = new FelhasznaloElerhetosegTelCO();
|
||||
|
||||
List<ValtozasDict> ValtozasDictData = new List<ValtozasDict>(kirSzinkronSaveModel.ValtozasDictData);
|
||||
|
||||
for (int i = 0; i < ValtozasDictData.Count; i++)
|
||||
{
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.Telefonszam))
|
||||
{
|
||||
felhasznaloElerhetosegTelCO.Telefonszam = ValtozasDictData[i].Value;
|
||||
felhasznaloElerhetosegTelCO.TelefonTipusa = (int)TelefonTipusEnum.Ismeretlen;
|
||||
}
|
||||
}
|
||||
|
||||
return felhasznaloElerhetosegTelCO;
|
||||
}
|
||||
|
||||
public static FelhasznaloElerhetosegEmailCO ModelToFelhasznaloElerhetosegEmailCo(KirSzinkronSaveModel kirSzinkronSaveModel)
|
||||
{
|
||||
var felhasznaloElerhetosegEmailCO = new FelhasznaloElerhetosegEmailCO();
|
||||
|
||||
List<ValtozasDict> ValtozasDictData = new List<ValtozasDict>(kirSzinkronSaveModel.ValtozasDictData);
|
||||
|
||||
for (int i = 0; i < ValtozasDictData.Count; i++)
|
||||
{
|
||||
if (ValtozasDictData[i].Key == nameof(KirAlkalmazott.Email))
|
||||
{
|
||||
felhasznaloElerhetosegEmailCO.EmailCim = ValtozasDictData[i].Value;
|
||||
felhasznaloElerhetosegEmailCO.EmailTipusa = (int)EmailTipusEnum.Na;
|
||||
}
|
||||
}
|
||||
|
||||
return felhasznaloElerhetosegEmailCO;
|
||||
}
|
||||
|
||||
public static implicit operator KirTanuloAdatCo(KirSzinkronSaveModel kirSzinkronSaveModel)
|
||||
{
|
||||
var kirTanuloAdatCo = new KirTanuloAdatCo();
|
||||
|
||||
if (int.TryParse(kirSzinkronSaveModel.FelhasznaloId, out int felhasznaloId))
|
||||
{
|
||||
kirTanuloAdatCo.Id = felhasznaloId;
|
||||
}
|
||||
|
||||
List<ValtozasDict> ValtozasDictData = new List<ValtozasDict>(kirSzinkronSaveModel.ValtozasDictData);
|
||||
|
||||
for (int i = 0; i < ValtozasDictData.Count; i++)
|
||||
{
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.AnyjaUtoneve))
|
||||
{
|
||||
kirTanuloAdatCo.AnyjaUtoneve = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.AnyjaVezetekNeve))
|
||||
{
|
||||
kirTanuloAdatCo.AnyjaVezetekNeve = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.NevElotag))
|
||||
{
|
||||
kirTanuloAdatCo.Elotag = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.SzuletesiUtonev))
|
||||
{
|
||||
kirTanuloAdatCo.SzuletesiUtonev = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.SzuletesiVezeteknev))
|
||||
{
|
||||
kirTanuloAdatCo.SzuletesiVezeteknev = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.Utonev))
|
||||
{
|
||||
kirTanuloAdatCo.Utonev = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.Vezeteknev))
|
||||
{
|
||||
kirTanuloAdatCo.Vezeteknev = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.SzuletesiHely))
|
||||
{
|
||||
kirTanuloAdatCo.SzuletesiHely = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.SzuletesiDatum))
|
||||
{
|
||||
kirTanuloAdatCo.SzuletesiDatum = Convert.ToDateTime(ValtozasDictData[i].Value);
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.Nem))
|
||||
{
|
||||
if (Enum.TryParse(ValtozasDictData[i].Value.RemoveDiacritics(), true, out NemEnum nemEnum))
|
||||
{
|
||||
kirTanuloAdatCo.Nem = (int)nemEnum;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirTanuloAdatCo.Nem = (int)NemEnum.NA;
|
||||
}
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.JogviszonyKezdete))
|
||||
{
|
||||
kirTanuloAdatCo.JogviszonyKezdete = Convert.ToDateTime(ValtozasDictData[i].Value);
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.JogviszonyVarBefejezese))
|
||||
{
|
||||
kirTanuloAdatCo.JogviszonyVarBefejezese = Convert.ToDateTime(ValtozasDictData[i].Value);
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.JogviszonyStatusza))
|
||||
{
|
||||
kirTanuloAdatCo.JogviszonyStatusza = Convert.ToBoolean(ValtozasDictData[i].Value);
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.JogviszonyJellege))
|
||||
{
|
||||
kirTanuloAdatCo.JogviszonyJellege = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.Vendegtanulo))
|
||||
{
|
||||
kirTanuloAdatCo.Vendegtanulo = Convert.ToBoolean(ValtozasDictData[i].Value);
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.Magantanulo))
|
||||
{
|
||||
kirTanuloAdatCo.Magantanulo = Convert.ToBoolean(ValtozasDictData[i].Value);
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.OktatasiAzonosito))
|
||||
{
|
||||
kirTanuloAdatCo.OktatasiAzonosito = ValtozasDictData[i].Value;
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.Allampolgarsag))
|
||||
{
|
||||
if (Enum.TryParse(ValtozasDictData[i].Value.RemoveDiacritics(), true, out AllampolgarsagEnum allampolgarsagEnum))
|
||||
{
|
||||
kirTanuloAdatCo.Allampolgarsag = (int)allampolgarsagEnum;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirTanuloAdatCo.Allampolgarsag = (int)AllampolgarsagEnum.magyar;
|
||||
}
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.Allampolgarsag2))
|
||||
{
|
||||
if (Enum.TryParse(ValtozasDictData[i].Value.RemoveDiacritics(), true, out AllampolgarsagEnum allampolgarsagEnum))
|
||||
{
|
||||
kirTanuloAdatCo.Allampolgarsag = (int)allampolgarsagEnum;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirTanuloAdatCo.Allampolgarsag = (int)AllampolgarsagEnum.magyar;
|
||||
}
|
||||
}
|
||||
|
||||
if (ValtozasDictData[i].Key == nameof(KirTanulo.SzuletesiOrszag))
|
||||
{
|
||||
if (Enum.TryParse(ValtozasDictData[i].Value.RemoveDiacritics(), true, out OrszagTipusEnum orszagTipusEnum))
|
||||
{
|
||||
kirTanuloAdatCo.SzuletesiOrszag = (int)orszagTipusEnum;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirTanuloAdatCo.SzuletesiOrszag = (int)OrszagTipusEnum.Magyarorszag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return kirTanuloAdatCo;
|
||||
}
|
||||
}
|
||||
}
|
8
KretaWeb/Areas/KirImportExport/Models/SaveModel.cs
Normal file
8
KretaWeb/Areas/KirImportExport/Models/SaveModel.cs
Normal file
|
@ -0,0 +1,8 @@
|
|||
namespace Kreta.Web.Areas.KirImportExport.Models
|
||||
{
|
||||
public class SaveModel
|
||||
{
|
||||
public string FelhasznaloId { get; set; }
|
||||
public string OktatasiAzonosito { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue