40 lines
1.7 KiB
C#
40 lines
1.7 KiB
C#
using System.Linq;
|
|
using System.Web.Mvc;
|
|
using Kreta.BusinessLogic.Helpers;
|
|
using Kreta.BusinessLogic.Helpers.SystemSettings;
|
|
using Kreta.BusinessLogic.Security;
|
|
using Kreta.Enums;
|
|
using Kreta.Web.Areas.Tanulo.Models;
|
|
using Kreta.Web.Helpers;
|
|
using Kreta.Web.Security;
|
|
|
|
namespace Kreta.Web.Areas.Tanulo.Controllers
|
|
{
|
|
[MvcRoleClaimsAuthorize(true)]
|
|
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
|
[MvcRolePackageAuthorize(KretaClaimPackages.CsoportVezeto.ClaimValue, KretaClaimPackages.SzuperOsztalyfonok.ClaimValue)]
|
|
public class CsoportTanuloiController : Controller
|
|
{
|
|
public ActionResult Index()
|
|
{
|
|
var systemSettingsHelper = new SystemSettingsHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
|
|
|
var model = new CsoportTanuloiSearchModel
|
|
{
|
|
showDetailView = systemSettingsHelper.GetSystemSettingValue<bool>(RendszerBeallitasTipusEnum.Csoportvezeto_Tanulo_Adat_Modositas),
|
|
showTanoraCeluCsoport = systemSettingsHelper.GetSystemSettingValue<bool>(RendszerBeallitasTipusEnum.Csoportvezeto_Tanora_Celu_Csoportok)
|
|
};
|
|
|
|
var helper = new OsztalyCsoportHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
|
var firstCsoportId = helper.GetCsoportListByCsoportVezeto(model.showTanoraCeluCsoport, (int)CsoportTipusEnum.iskolai_csoport_tanorai_celu_, ClaimData.IsSzuperOsztalyfonok).Select(x => x.Value).FirstOrDefault();
|
|
|
|
if (!string.IsNullOrWhiteSpace(firstCsoportId))
|
|
{
|
|
int.TryParse(firstCsoportId, out int result);
|
|
model.OsztalyCsoport = result;
|
|
}
|
|
|
|
return View("Index", model);
|
|
}
|
|
}
|
|
}
|