init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
161
KretaWeb/Areas/Orarend/Models/MulasztasNaplozas.cs
Normal file
161
KretaWeb/Areas/Orarend/Models/MulasztasNaplozas.cs
Normal file
|
@ -0,0 +1,161 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Logic.Naplozas.Elokeszites;
|
||||
using Kreta.Core;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Attributes;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
using Kreta.Web.Utils;
|
||||
|
||||
namespace Kreta.Web.Areas.Orarend.Models
|
||||
{
|
||||
public class MulasztasNaplozas
|
||||
{
|
||||
public MulasztasNaplozas(int? szervezetTipusId, bool isMentorOra = false)
|
||||
{
|
||||
JelenletList = new List<SelectListItem>();
|
||||
FelmentettJelenletList = new List<SelectListItem>();
|
||||
TemaList = new List<SelectListItem>();
|
||||
TanulasiEgysegList = new List<SelectListItem>();
|
||||
SzervezetTipusId_MulasztasNaplozas = szervezetTipusId;
|
||||
IsMentorOra_MulasztasNaplozas = isMentorOra;
|
||||
|
||||
var mulasztasTipusok = ((int)GeneratedAdatszotarTipusEnum.MulasztasTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, visibleOnly: true)
|
||||
.Where(x => (szervezetTipusId.HasValue && x.Id != (int)MulasztasTipusEnum.hianyzas) || (x.Id != (int)MulasztasTipusEnum.szabadsag && x.Id != (int)MulasztasTipusEnum.tappenz
|
||||
&& x.Id != (int)MulasztasTipusEnum.betegszabadsag && x.Id != (int)MulasztasTipusEnum.potlas
|
||||
&& (!isMentorOra || x.Id != (int)MulasztasTipusEnum.hianyzas))).ToList().OrderBy(x => x.Order);
|
||||
|
||||
foreach (var item in mulasztasTipusok)
|
||||
{
|
||||
if (item.Id == (int)MulasztasTipusEnum.na || item.Id == (int)MulasztasTipusEnum.ures || item.Id == (int)MulasztasTipusEnum.keses)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
JelenletList.Add(new SelectListItem() { Value = item.Id.ToString(), Text = item.Name });
|
||||
|
||||
if (item.Id == (int)MulasztasTipusEnum.hianyzas)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
FelmentettJelenletList.Add(new SelectListItem() { Value = item.Id.ToString(), Text = item.Name });
|
||||
}
|
||||
}
|
||||
|
||||
public int? TargyId { get; set; }
|
||||
public int? OsztalyCsoportId { get; set; }
|
||||
public int? TanoraId { get; set; }
|
||||
public int MaxKeses { get; set; }
|
||||
public int? TanarId { get; set; }
|
||||
|
||||
public DateTime OraKezdete { get; set; }
|
||||
public DateTime OraVege { get; set; }
|
||||
|
||||
public bool isTanora { get; set; }
|
||||
public bool isElozoOraTemaNeeded { get; set; }
|
||||
public bool IsAmi { get; set; }
|
||||
|
||||
[Display(Name = nameof(OrarendResource.OraTemaja), ResourceType = typeof(OrarendResource))]
|
||||
public int? TemaTanmenetId { get; set; }
|
||||
|
||||
[Display(Name = nameof(OrarendResource.TanulasiEgyseg), ResourceType = typeof(OrarendResource))]
|
||||
public int? TanulasiEgysegId { get; set; }
|
||||
|
||||
|
||||
[Display(Name = nameof(OrarendResource.Tema), ResourceType = typeof(OrarendResource))]
|
||||
public string Tema { get; set; }
|
||||
|
||||
public List<SelectListItem> JelenletList { get; set; }
|
||||
public List<SelectListItem> FelmentettJelenletList { get; set; }
|
||||
public List<SelectListItem> TemaList { get; set; }
|
||||
public List<SelectListItem> TanulasiEgysegList { get; set; }
|
||||
|
||||
|
||||
[Display(Name = nameof(OrarendResource.OraEvesSorszama), ResourceType = typeof(OrarendResource))]
|
||||
public double? EvesOraSorszam { get; set; }
|
||||
|
||||
public bool IsSorszamozando { get; set; }
|
||||
|
||||
public string SzamonkeresAdatai { get; set; }
|
||||
|
||||
[Display(Name = nameof(OrarendResource.Hetesek), ResourceType = typeof(OrarendResource))]
|
||||
public string Hetesek { get; set; }
|
||||
|
||||
public bool IsSzamonkeresAdataiVisible { get; set; }
|
||||
|
||||
public bool IsHetesekAdataiVisible { get; set; }
|
||||
|
||||
[Display(Name = nameof(OrarendResource.ElozoOraTemaja), ResourceType = typeof(OrarendResource))]
|
||||
public string ElozoOraAdatai { get; set; }
|
||||
|
||||
public string ElozoOraTema { get; set; }
|
||||
|
||||
public bool HianyzokAutoKitoltes { get; set; }
|
||||
|
||||
[Display(Name = nameof(OrarendResource.JogviszontSzuneteltetoDiakok), ResourceType = typeof(OrarendResource))]
|
||||
public int? JogviszonySzunetletetokDb { get; set; }
|
||||
|
||||
public string JogviszonySzunetletetok { get; set; }
|
||||
|
||||
[Display(Name = nameof(OrarendResource.SzakmaiGyakorlatonLevoDiakok), ResourceType = typeof(OrarendResource))]
|
||||
public int? SzakmaiGyakorlatonLevokDb { get; set; }
|
||||
|
||||
public string SzakmaiGyakorlatonLevok { get; set; }
|
||||
|
||||
public int? SzervezetTipusId_MulasztasNaplozas { get; set; }
|
||||
|
||||
public bool IsMentorOra_MulasztasNaplozas { get; set; }
|
||||
|
||||
public void Fill(NaplozasElokeszitesModel model)
|
||||
{
|
||||
TargyId = model.OraAdat.TantargyId;
|
||||
OsztalyCsoportId = model.OraAdat.OsztalyCsoportId;
|
||||
TanarId = model.OraAdat.TanarId;
|
||||
TanoraId = model.OraAdat.TanitasiOraId;
|
||||
MaxKeses = model.MaxKeses;
|
||||
OraKezdete = model.OraAdat.OraKezdete;
|
||||
OraVege = model.OraAdat.OraVege;
|
||||
isTanora = model.IsTanora;
|
||||
isElozoOraTemaNeeded = model.KellElozoOraTema;
|
||||
TemaTanmenetId = model.OraAdat.TemaTanmenetId;
|
||||
TanulasiEgysegId = model.OraAdat.TanulasiEgysegId;
|
||||
Tema = model.OraAdat.Tema;
|
||||
TemaList = model.OraAdat.TemaLista.ToSelectListItemList();
|
||||
EvesOraSorszam = model.OraAdat.EvesOraSorszam;
|
||||
IsSorszamozando = model.OraAdat.IsSorszamozando;
|
||||
ElozoOraAdatai = model.OraAdat.ElozoOraAdat;
|
||||
SzamonkeresAdatai = model.OraAdat.SzamonkeresAdatai;
|
||||
Hetesek = model.OraAdat.Hetesek;
|
||||
IsSzamonkeresAdataiVisible = model.Naplozhat && !string.IsNullOrWhiteSpace(model.OraAdat.SzamonkeresAdatai);
|
||||
IsHetesekAdataiVisible = model.Naplozhat && !string.IsNullOrWhiteSpace(model.OraAdat.Hetesek);
|
||||
ElozoOraTema = model.OraAdat.ElozoOraTema;
|
||||
HianyzokAutoKitoltes = ProfileUtils.IsHianyzokAutoKitoltesEnabled;
|
||||
JogviszonySzunetletetokDb = model.Mulasztas.JogviszonySzunetletetokDb;
|
||||
JogviszonySzunetletetok = model.Mulasztas.JogviszonySzunetletetok;
|
||||
SzakmaiGyakorlatonLevokDb = model.Mulasztas.SzakmaiGyakorlatonLevokDb;
|
||||
SzakmaiGyakorlatonLevok = model.Mulasztas.SzakmaiGyakorlatonLevok;
|
||||
}
|
||||
|
||||
public void SetIsAmi()
|
||||
{
|
||||
IsAmi = OsztalyCsoportId.IsEntityId() && new OsztalyCsoportHelper(ConnectionTypeExtensions.GetSessionConnectionType()).IsAmiOsztalyCsoport(OsztalyCsoportId.Value);
|
||||
}
|
||||
|
||||
public void SetMentorCsoportEgyedisegek()
|
||||
{
|
||||
if (OsztalyCsoportId.IsEntityId() && new OsztalyCsoportHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetCsoportTipusByOsztalyCsoportId(OsztalyCsoportId.Value) == CsoportTipusEnum.apaczai_mentorcsoport)
|
||||
{
|
||||
JelenletList.Remove(JelenletList.SingleOrDefault(x => x.Value == ((int)MulasztasTipusEnum.hianyzas).ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue