45 lines
1.6 KiB
C#
45 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using Kreta.BusinessLogic.HelperClasses;
|
|
using Kreta.Core.ConnectionType;
|
|
using Kreta.DataAccessManual;
|
|
using Kreta.Enums;
|
|
|
|
namespace Kreta.BusinessLogic.Helpers
|
|
{
|
|
public class TanuloCsoportHelper : LogicBase
|
|
{
|
|
public TanuloCsoportHelper(IConnectionType connectionType) : base(connectionType) { }
|
|
|
|
public List<TanuloCsoportItemCo> GetTanuloCsoportCoList()
|
|
{
|
|
DataSet dataSet = Dal.CustomConnection.Run(ConnectionType, dalHandler => dalHandler.TanuloCsoport().GetTanuloCsoportDataSet(TanevId));
|
|
|
|
var result = new List<TanuloCsoportItemCo>();
|
|
foreach (DataRow dataRow in dataSet.Tables[0].Rows)
|
|
{
|
|
var item = new TanuloCsoportItemCo(dataRow);
|
|
result.Add(item);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
public Dictionary<OktNevelesiKategoriaEnum, int> GetJogviszonyLimits()
|
|
{
|
|
var result = new Dictionary<OktNevelesiKategoriaEnum, int>();
|
|
|
|
var ds = Dal.CustomConnection.Run(ConnectionType, dalHandler => dalHandler.TanuloCsoport().GetJogviszonyLimitList(TanevId));
|
|
var jogviszonyDbList = ds.Tables[0].AsEnumerable();
|
|
foreach (int enumValue in Enum.GetValues(typeof(OktNevelesiKategoriaEnum)))
|
|
{
|
|
var limit = jogviszonyDbList.FirstOrDefault(r => r.Field<int>("ID") == enumValue)?.Field<int>("C_FELADATCSOPORTTANULOOSZTALYK") ?? 1;
|
|
result.Add((OktNevelesiKategoriaEnum)enumValue, limit);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|