init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
243
Kreta.BusinessLogic/Logic/Naplozas/Elokeszites/OraAdatModel.cs
Normal file
243
Kreta.BusinessLogic/Logic/Naplozas/Elokeszites/OraAdatModel.cs
Normal file
|
@ -0,0 +1,243 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Utils;
|
||||
using Kreta.Core.ConnectionType;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.BusinessLogic.Logic.Naplozas.Elokeszites
|
||||
{
|
||||
public class OraAdatModel
|
||||
{
|
||||
internal OraAdatModel()
|
||||
{
|
||||
Hetirend = (int)HetiRendTipusEnum.MindegyikHet;
|
||||
TemaLista = new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
public DateTime OraKezdete { get; set; }
|
||||
public DateTime OraVege { get; set; }
|
||||
public DateTime RogzitesDatuma { get; set; }
|
||||
|
||||
public int? OrarendiOraId { get; set; }
|
||||
public int? TanitasiOraId { get; set; }
|
||||
public int? CsengetesirendOraId { get; set; }
|
||||
public int? CsengetesirendId { get; set; }
|
||||
public int? Hanyadikora { get; set; }
|
||||
public int? TanarId { get; set; }
|
||||
public string TanarNev { get; set; }
|
||||
public int? OsztalyfonokId { get; set; }
|
||||
public string Tema { get; set; }
|
||||
public int? TemaTanmenetId { get; set; }
|
||||
public int? TanulasiEgysegId { get; set; }
|
||||
public int? FoglakozasId { get; set; }
|
||||
public int? OsztalyCsoportId { get; set; }
|
||||
public string OsztalyCsoportNev { get; set; }
|
||||
public int? TantargyId { get; set; }
|
||||
public string TantargyNev { get; set; }
|
||||
public int? TeremId { get; set; }
|
||||
public bool IsOraOsszevonas { get; set; }
|
||||
public bool IsElmaradt { get; set; }
|
||||
public bool IsSorszamozando { get; set; }
|
||||
public bool IsTanorankivuli { get; set; }
|
||||
public int? EvesOraSorszam { get; set; }
|
||||
public string Megjegyzes { get; set; }
|
||||
public int? Oraszam { get; set; }
|
||||
public string ElozoOraAdat { get; set; }
|
||||
public string ElozoOraTema { get; set; }
|
||||
public int? SzamonkeresModId { get; set; }
|
||||
public string SzamonkeresModja { get; set; }
|
||||
public string SzamonkeresMegnevezes { get; set; }
|
||||
|
||||
public string SzamonkeresAdatai
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(SzamonkeresModja))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return string.Format(OrarendResource.SzamonkeresElorejelzesModjaTemajaStr, SzamonkeresModja, string.IsNullOrWhiteSpace(SzamonkeresMegnevezes) ? "-" : SzamonkeresMegnevezes);
|
||||
}
|
||||
}
|
||||
|
||||
public string Hetesek { get; set; }
|
||||
public int Hetirend { get; set; }
|
||||
public IDictionary<string, string> TemaLista { get; internal set; }
|
||||
public bool IsMobilNaplozott { get; set; }
|
||||
public bool IsAdminAltalKiirt { get; set; }
|
||||
public int GroupId { get; set; }
|
||||
public int? HetNapja { get; set; }
|
||||
public bool VanOralatogatasa { get; set; }
|
||||
public List<int> CheckedOpenBoardFileIdList { get; internal set; }
|
||||
|
||||
public int? DigEszkozTipusId { get; set; }
|
||||
public int? DigPlatformTipusId { get; set; }
|
||||
public List<int> DigTamEszkozTipusIdList { get; set; }
|
||||
|
||||
internal void Fill(TanoraCO co, bool helyettesitesEsetenFelugyeletAlapertelmezettenSorszamozando)
|
||||
{
|
||||
OrarendiOraId = co.OrarendiOra;
|
||||
TanitasiOraId = co.ID;
|
||||
OraKezdete = co.OraKezd;
|
||||
OraVege = co.OraVeg;
|
||||
CsengetesirendOraId = co.CsengetesiRendOraId;
|
||||
CsengetesirendId = co.CsengetesiRendID;
|
||||
TanarId = co.Tanar;
|
||||
FoglakozasId = co.Fogl;
|
||||
OsztalyCsoportId = co.OsztCsop;
|
||||
TantargyId = co.Targy;
|
||||
TeremId = co.Terem;
|
||||
TanarNev = co.TanarNev;
|
||||
OsztalyCsoportNev = co.OsztalyCsoportNev;
|
||||
TantargyNev = co.TantargyNev;
|
||||
EvesOraSorszam = co.EvesOraSorszam;
|
||||
TemaTanmenetId = co.TemaTanmenetId;
|
||||
Tema = co.Tema;
|
||||
TanulasiEgysegId = co.TanulasiEgysegId;
|
||||
IsSorszamozando = GetSorszamozandoBaseValue(co.Sorszamozando, co.HelyettesitesTipus, helyettesitesEsetenFelugyeletAlapertelmezettenSorszamozando);
|
||||
Megjegyzes = co.Megjegyzes;
|
||||
Oraszam = co.Oraszam;
|
||||
IsTanorankivuli = co.IsTanoranKivuli;
|
||||
Hetirend = co.Hetirend ?? (int)HetiRendTipusEnum.MindegyikHet;
|
||||
IsMobilNaplozott = co.MobilNaplozott ?? false;
|
||||
IsAdminAltalKiirt = co.AdminAltalKiirt;
|
||||
GroupId = co.OrarendiOraGroupId;
|
||||
HetNapja = co.HetNapja;
|
||||
RogzitesDatuma = co.BejegyIdo;
|
||||
IsElmaradt = !co.Megtartott ?? false;
|
||||
VanOralatogatasa = co.OraLatogatok != null && co.OraLatogatok.Count > 0;
|
||||
CheckedOpenBoardFileIdList = co.CheckedOpenBoardFileIdList;
|
||||
DigEszkozTipusId = co.DigEszkozTipusId;
|
||||
DigPlatformTipusId = co.DigPlatformTipusId;
|
||||
DigTamEszkozTipusIdList = co.DigTamEszkozTipusIdList;
|
||||
}
|
||||
|
||||
internal void Fill(IConnectionType connectionType, EgyediNaplozasElokeszitesCo input, bool helyettesitesEsetenFelugyeletAlapertelmezettenSorszamozando)
|
||||
{
|
||||
OraKezdete = input.Start;
|
||||
OraVege = input.End;
|
||||
OrarendiOraId = input.OrarendiOraId;
|
||||
TanitasiOraId = input.TanitasiOraId;
|
||||
CsengetesirendOraId = input.CsengetesirendOraId;
|
||||
CsengetesirendId = input.CsengetesirendId;
|
||||
IsTanorankivuli = !(input.CsengetesirendOraId.HasValue && input.CsengetesirendOraId > 0);
|
||||
|
||||
if (!IsTanorankivuli && !CsengetesirendId.HasValue)
|
||||
{
|
||||
var cshelper = new CsengetesiRendHelper(connectionType);
|
||||
CsengetesirendId = cshelper.GetCsengetesiRendId(CsengetesirendOraId.Value);
|
||||
}
|
||||
|
||||
TanarId = input.TanarId;
|
||||
FoglakozasId = input.FoglakozasId;
|
||||
OsztalyCsoportId = input.OsztalyCsoportId;
|
||||
TantargyId = input.TantargyId;
|
||||
TeremId = input.TeremId;
|
||||
IsOraOsszevonas = input.IsOraOsszevonas;
|
||||
IsSorszamozando = GetSorszamozandoBaseValue(baseValue: true, input.HelyettesitesTipus, helyettesitesEsetenFelugyeletAlapertelmezettenSorszamozando);
|
||||
HetNapja = CommonUtils.GetHetNapja(OraKezdete);
|
||||
}
|
||||
|
||||
internal void Fill(NaplozasCo input)
|
||||
{
|
||||
OraKezdete = input.OraAdat.OraKezdete;
|
||||
OraVege = input.OraAdat.OraVege;
|
||||
|
||||
if (input.OraAdat.OrarendiOraId.HasValue)
|
||||
{
|
||||
OrarendiOraId = input.OraAdat.OrarendiOraId;
|
||||
}
|
||||
if (input.OraAdat.TanitasiOraId.HasValue)
|
||||
{
|
||||
TanitasiOraId = input.OraAdat.TanitasiOraId;
|
||||
}
|
||||
if (input.OraAdat.CsengetesirendOraId.HasValue)
|
||||
{
|
||||
CsengetesirendOraId = input.OraAdat.CsengetesirendOraId;
|
||||
}
|
||||
if (input.OraAdat.CsengetesirendId.HasValue)
|
||||
{
|
||||
CsengetesirendId = input.OraAdat.CsengetesirendId;
|
||||
}
|
||||
if (input.OraAdat.TanarId.HasValue && !TanarId.HasValue)
|
||||
{
|
||||
TanarId = input.OraAdat.TanarId;
|
||||
}
|
||||
if (input.OraAdat.TemaTanmenetId.HasValue)
|
||||
{
|
||||
TemaTanmenetId = input.OraAdat.TemaTanmenetId;
|
||||
}
|
||||
if (input.OraAdat.TanulasiEgysegId.HasValue)
|
||||
{
|
||||
TanulasiEgysegId = input.OraAdat.TanulasiEgysegId;
|
||||
}
|
||||
if (input.OraAdat.FoglakozasId.HasValue)
|
||||
{
|
||||
FoglakozasId = input.OraAdat.FoglakozasId;
|
||||
}
|
||||
if (input.OraAdat.OsztalyCsoportId.HasValue)
|
||||
{
|
||||
OsztalyCsoportId = input.OraAdat.OsztalyCsoportId;
|
||||
}
|
||||
if (input.OraAdat.TantargyId.HasValue)
|
||||
{
|
||||
TantargyId = input.OraAdat.TantargyId;
|
||||
}
|
||||
if (input.OraAdat.TeremId.HasValue)
|
||||
{
|
||||
TeremId = input.OraAdat.TeremId;
|
||||
}
|
||||
if (input.OraAdat.Oraszam.HasValue)
|
||||
{
|
||||
Oraszam = input.OraAdat.Oraszam;
|
||||
}
|
||||
if (!input.IsEgyediNaplozas)
|
||||
{
|
||||
CheckedOpenBoardFileIdList = input.OraAdat.CheckedOpenBoardFileIdList;
|
||||
}
|
||||
Tema = input.OraAdat.Tema;
|
||||
IsSorszamozando = input.OraAdat.IsSorszamozando;
|
||||
IsTanorankivuli = input.OraAdat.IsTanorankivuli;
|
||||
Megjegyzes = input.OraAdat.Megjegyzes;
|
||||
|
||||
if (RogzitesDatuma == default)
|
||||
{
|
||||
RogzitesDatuma = DateTime.Now;
|
||||
}
|
||||
|
||||
if (!HetNapja.HasValue)
|
||||
{
|
||||
HetNapja = CommonUtils.GetHetNapja(OraKezdete);
|
||||
}
|
||||
|
||||
IsMobilNaplozott = false;
|
||||
DigPlatformTipusId = input.OraAdat.DigPlatformTipusId;
|
||||
DigEszkozTipusId = input.OraAdat.DigEszkozTipusId;
|
||||
DigTamEszkozTipusIdList = input.OraAdat.DigTamEszkozTipusIdList;
|
||||
}
|
||||
|
||||
internal void Fill(NaplozasMobilCo input)
|
||||
{
|
||||
OrarendiOraId = input.OraAdat.OrarendiOraId;
|
||||
TanitasiOraId = input.OraAdat.TanitasiOraId;
|
||||
Tema = input.OraAdat.Tema;
|
||||
IsElmaradt = input.OraAdat.IsElmaradt;
|
||||
RogzitesDatuma = input.OraAdat.RogzitesDatuma == default ? DateTime.Now : input.OraAdat.RogzitesDatuma;
|
||||
IsMobilNaplozott = true;
|
||||
}
|
||||
|
||||
private bool GetSorszamozandoBaseValue(bool baseValue, int? helyettesitesTipus, bool helyettesitesEsetenFelugyeletAlapertelmezettenSorszamozando)
|
||||
{
|
||||
if (!TanitasiOraId.HasValue && (helyettesitesTipus == (int)HelyettesitesTipusEnum.nem_szakszeru_helyettesites_felugyelet_ || helyettesitesTipus == (int)HelyettesitesTipusEnum.osszevont_felugyelet))
|
||||
{
|
||||
return helyettesitesEsetenFelugyeletAlapertelmezettenSorszamozando;
|
||||
}
|
||||
|
||||
return baseValue;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue