init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
Kreta.BusinessLogic/Helpers
134
Kreta.BusinessLogic/Helpers/NaptariNapHelper.cs
Normal file
134
Kreta.BusinessLogic/Helpers/NaptariNapHelper.cs
Normal file
|
@ -0,0 +1,134 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.Core.ConnectionType;
|
||||
using Kreta.DataAccessManual;
|
||||
using Kreta.Enums;
|
||||
|
||||
namespace Kreta.BusinessLogic.Helpers
|
||||
{
|
||||
public class NaptariNapHelper : LogicBase
|
||||
{
|
||||
public NaptariNapHelper(IConnectionType connectionType) : base(connectionType) { }
|
||||
|
||||
public bool IsTanitasiNap(DateTime datum)
|
||||
{
|
||||
return Dal.CustomConnection.Run(ConnectionType, (h) =>
|
||||
{
|
||||
var dal = h.NaptariNap();
|
||||
return dal.IsTanitasiNap(datum, GetTanitasiNapIdList(), TanevId);
|
||||
});
|
||||
}
|
||||
|
||||
/// INFO @DevKornel: Mobil használja
|
||||
public int? GetNaptariNapId(DateTime datum)
|
||||
{
|
||||
return Dal.CustomConnection.Run(ConnectionType, (h) =>
|
||||
{
|
||||
var dal = h.NaptariNap();
|
||||
return dal.GetNaptariNapId(datum);
|
||||
});
|
||||
}
|
||||
|
||||
public Dictionary<int, string> GetNaplozottOrakTanarai(int? naptariNapId)
|
||||
{
|
||||
var ds = Dal.CustomConnection.Run(ConnectionType, (h) =>
|
||||
{
|
||||
var dal = h.NaptariNap();
|
||||
return dal.GetNaplozottOrakTanarai(naptariNapId);
|
||||
});
|
||||
|
||||
var result = new Dictionary<int, string>();
|
||||
if (ds == null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
foreach (DataRow row in ds.Tables[0].Rows)
|
||||
{
|
||||
result.Add(row.Field<int>("ID"), row.Field<string>("Nev"));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public Dictionary<int, string> GetNaplozottOrakTanarai(DateTime? datum)
|
||||
{
|
||||
return GetNaplozottOrakTanarai(GetNaptariNapId(datum.Value));
|
||||
}
|
||||
|
||||
public List<int> GetTanitasiNapIdList()
|
||||
{
|
||||
var tanitasiNapIdList = new List<int>
|
||||
{
|
||||
(int)NapTipusEnum.tanitasi_nap,
|
||||
(int)NapTipusEnum.roviditett_orakat_tartalmazo_tanitasi_nap,
|
||||
(int)NapTipusEnum.elso_tanitasi_nap,
|
||||
(int)NapTipusEnum.utolso_tanitasi_nap,
|
||||
(int)NapTipusEnum.elso_felev_vege,
|
||||
(int)NapTipusEnum.vizsganap,
|
||||
(int)NapTipusEnum.utolso_tanitasi_nap_a_vegzos_evfolyamokon,
|
||||
(int)NapTipusEnum.I_negyedev_vege,
|
||||
(int)NapTipusEnum.III_negyedev_vege,
|
||||
(int)NapTipusEnum.RendkivuliTanitasiNap,
|
||||
(int)NapTipusEnum.Nyilt_nap
|
||||
};
|
||||
|
||||
return tanitasiNapIdList;
|
||||
}
|
||||
|
||||
public DataSet GetNaptariNapData(DateTime datum)
|
||||
{
|
||||
return Dal.CustomConnection.Run(ConnectionType, (h) =>
|
||||
{
|
||||
var dal = h.NaptariNap();
|
||||
return dal.GetNaptariNapData(datum, TanevId);
|
||||
});
|
||||
}
|
||||
|
||||
public bool GetIsEgyediNapByDate(DateTime datum)
|
||||
{
|
||||
return Dal.CustomConnection.Run(ConnectionType, (h) =>
|
||||
{
|
||||
var dal = h.NaptariNap();
|
||||
return dal.GetIsEgyediNapByDate(datum, TanevId);
|
||||
});
|
||||
}
|
||||
|
||||
public DataSet GetNapTipusData(int naptipus)
|
||||
{
|
||||
return Dal.CustomConnection.Run(ConnectionType, (h) =>
|
||||
{
|
||||
var dal = h.NaptariNap();
|
||||
return dal.GetNapTipusData(naptipus, TanevId);
|
||||
});
|
||||
}
|
||||
|
||||
public bool GetIsEgyediNapByDateAndOsztalyCsoportId(DateTime datum, int osztalyCsoportId)
|
||||
{
|
||||
return Dal.CustomConnection.Run(ConnectionType, h =>
|
||||
{
|
||||
var dal = h.NaptariNap();
|
||||
return dal.GetIsEgyediNapByDateAndOsztalyCsoportId(datum, TanevId, osztalyCsoportId);
|
||||
});
|
||||
}
|
||||
|
||||
public EgyediNapCo GetIsEgyediNapByDateAndOsztalyCsoportNev(DateTime datum, string osztalyCsoportNev)
|
||||
{
|
||||
return Dal.CustomConnection.Run(ConnectionType, h =>
|
||||
{
|
||||
var dal = h.NaptariNap();
|
||||
var dataSet = dal.GetIsEgyediNapByDateAndOsztalyCsoportNev(datum, TanevId, osztalyCsoportNev);
|
||||
var dataRow = dataSet.Tables[0].Rows[0];
|
||||
var result = new EgyediNapCo
|
||||
{
|
||||
IsEgyediNap = SDAConvert.ToBooleanFromTF(dataRow["IsEgyediNap"]),
|
||||
HetNapjaTipusId = SDAConvert.ToNullableInt32(dataRow["HetNapjaTipusId"]),
|
||||
};
|
||||
return result;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue