44 lines
1.6 KiB
C#
44 lines
1.6 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web.Mvc;
|
|
using Kreta.BusinessLogic.Classes;
|
|
using Kreta.BusinessLogic.Helpers;
|
|
using Kreta.BusinessLogic.Security;
|
|
using Kreta.Web.Areas.Tanar.Models;
|
|
using Kreta.Web.Helpers;
|
|
using Kreta.Web.Security;
|
|
|
|
namespace Kreta.Web.Areas.Tanar.Controllers
|
|
{
|
|
[MvcRoleClaimsAuthorize(true)]
|
|
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
|
[MvcRolePackageAuthorize(KretaClaimPackages.Tanar.ClaimValue)]
|
|
public class HelyettesitendoTanarOraiController : Controller
|
|
{
|
|
// GET: Tanar/HelyettesitendoTanarOrai
|
|
public ActionResult Index()
|
|
{
|
|
|
|
TanarHelyettesitesekKereseseSearchModel model = new TanarHelyettesitesekKereseseSearchModel()
|
|
{
|
|
AlkalmazottList = GetTanarList(),
|
|
HelyettesitoId = ClaimData.FelhasznaloId
|
|
};
|
|
|
|
return View("Index", model);
|
|
}
|
|
|
|
private List<SelectListItem> GetTanarList()
|
|
{
|
|
var connectionType = ConnectionTypeExtensions.GetSessionConnectionType();
|
|
var felhasznalokOnlyAlkalmazottSzerepkorIds = new FelhasznaloHelper(connectionType).GetFelhasznaloIdsOnlyAlkalmazottSzerepkor();
|
|
IDictionary<string, string> lista;
|
|
var helper = new TanarHelper(connectionType);
|
|
lista = helper.GetTanarok(string.Empty, oktatasiAzonositoval: true);
|
|
|
|
lista.Remove("");
|
|
|
|
return lista.ToSelectListItemList().Where(x => !felhasznalokOnlyAlkalmazottSzerepkorIds.Contains(SDAConvert.ToInt32(x.Value))).ToList();
|
|
}
|
|
}
|
|
}
|