kreta/Kreta.BusinessLogic/HelperClasses/OrarendCO.cs
2024-03-13 00:33:46 +01:00

227 lines
6.8 KiB
C#

namespace Kreta.BusinessLogic.HelperClasses
{
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Kreta.Core.Validation.Exceptions;
using Kreta.Core.Validation.Exceptions.Enum;
using Kreta.Enums;
using Kreta.Enums.ManualEnums;
using Kreta.Resources;
using Newtonsoft.Json;
public class OrarendCO
{
public OrarendCO()
{
Events = new List<Event>();
}
public List<Event> Events { get; set; }
public void ConvertToOrarendViewData()
{
foreach (var item in Events)
{
if (item.start.HasValue)
{
item.orarendViewStart = item.start.Value;
item.start = item.start.Value.Date.Add(new TimeSpan(0, item.hanyadikora, 0));
}
if (item.end.HasValue)
{
item.orarendViewEnd = item.end.Value;
item.end = item.end.Value.Date.Add(new TimeSpan(0, item.hanyadikora, 55));
}
}
}
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "*")]
public class Event
{
public Event()
{
textColor = "#000";
}
public bool allDay { get; set; }
public string borderColor { get; set; }
public string borderStyle { get; set; }
public string color { get; set; }
public EventColorEnum colorEnum { get; set; }
public string colorRightLine { get; set; }
public int? CsengetesiRendId { get; set; }
public DateTime? datum { get; set; }
public bool DisplayTime { get; set; }
public DateTime? end { get; set; }
public int hanyadikora { get; set; }
public int? helyettesitesId { get; set; }
public int? helyettesitoId { get; set; }
public string hetirend { get; set; }
public int id { get; set; }
public bool isElmaradt { get; set; }
public int maxNapiOraszam { get; set; }
public string OraErvenyessegKezdete { get; set; }
public string OraErvenyessegVege { get; set; }
public string OraKezdete { get; set; }
public DateTime? orarendViewEnd { get; set; }
public DateTime? orarendViewStart { get; set; }
public string oraszam { get; set; }
public CalendarOraTypeEnum oraType { get; set; }
public string OraVege { get; set; }
public DateTime? start { get; set; }
public string Tantargy { get; set; }
public string Tema { get; set; }
public string text { get; set; }
public string textColor { get; set; }
public bool textLineThrough { get; set; }
public string title { get; set; }
public bool hasBejelentettSzamonkeres { get; set; }
public string BejelentettSzamonkeresContent { get; set; }
public int[] BejelentettSzamonkeresIdList { get; set; }
public bool hasHaziFeladat { get; set; }
public bool IsHaziFeladatKesz { get; set; }
public bool IsHaziFeladatLejart { get; set; }
public Guid? KozpontiOraGroupId { get; set; }
public Guid? KozpontilagToroltOraGroupId { get; set; }
public bool Torolt { get; set; }
public bool OnlineOra { get; set; }
public bool UseCalendarTooltip { get; set; } = false;
public string TooltipMsg { get; set; }
public bool IsDigitalisOra { get; set; }
public string DigitalisEszkozTipus { get; set; }
public string DigitalisPlatformTipus { get; set; }
public List<string> DigitalisTamogatoEszkozTipusList { get; set; } = new List<string>();
}
public class ExtendedEvent : Event
{
public ExtendedEvent() : base()
{
}
[JsonIgnore]
public string HelyettesNev { get; set; }
[JsonIgnore]
public TanoraAllapotaEnum OraAllapota
{
get
{
if (isElmaradt)
{ return TanoraAllapotaEnum.Elmaradt; }
if (oraType == CalendarOraTypeEnum.TanitasiOra || oraType == CalendarOraTypeEnum.TanoranKivuliNaplozottFoglalkozas)
{ return TanoraAllapotaEnum.Naplozott; }
if (oraType == CalendarOraTypeEnum.OrarendiOra || oraType == CalendarOraTypeEnum.TanoranKivuliFoglalkozas)
{ return TanoraAllapotaEnum.Nem_naplozott; }
throw new ValidationException(ValidationErrorType.Undefined, ErrorResource.OraAllapotaNemMeghatarozhato);
}
}
[JsonIgnore]
public int? OrarendiOraId { get; set; }
[JsonIgnore]
public int? OrarendiOraGroupId { get; set; }
[JsonIgnore]
public string OsztalyCsoport { get; set; }
[JsonIgnore]
public int? OsztalyCsoportId { get; set; }
[JsonIgnore]
public int TanarId { get; set; }
[JsonIgnore]
public string TanarNev { get; set; }
[JsonIgnore]
public Guid TanarIdpUniqueId { get; set; }
[JsonIgnore]
public Guid? HelyettesitoTanarIdpUniqueId { get; set; }
[JsonIgnore]
public int TanevRendOsztalyCsoportId { get; set; }
public string TantargyKategoria { get; set; }
public int TantargyKategoriaId { get; set; }
[JsonIgnore]
public string TantargyTeljesNev { get; set; }
[JsonIgnore]
public int TantargyId { get; set; }
[JsonIgnore]
public MulasztasTipusEnum TanuloJelenlet { get; set; }
[JsonIgnore]
public string Terem { get; set; }
[JsonIgnore]
public int HetSorszama { get; set; }
[JsonIgnore]
public int? EvesOraSorszam { get; set; }
[JsonIgnore]
public int? HaziFeladatId { get; set; }
[JsonIgnore]
public int? BejelentettSzamonkeresId { get; set; }
[JsonIgnore]
public string BejelentettSzamonkeresMod { get; set; }
[JsonIgnore]
public string BejelentettSzamonkeresTema { get; set; }
[JsonIgnore]
public DateTime? ElozoNaplozottOraDatum { get; set; }
[JsonIgnore]
public string ElozoNaplozottOraTema { get; set; }
[JsonIgnore]
public DateTime Letrehozas { get; set; }
[JsonIgnore]
public DateTime UtolsoModositas { get; set; }
}
}
}