init
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Web.Areas.Adminisztracio.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adminisztracio.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
public class FelHelyValasztoController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
var model = new FelHelyValasztoModel();
|
||||
MukodesiHelyHelper helper = new MukodesiHelyHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var list = helper.GetMukodesiHelyekForFelhelyValaszto();
|
||||
foreach (var item in list)
|
||||
{
|
||||
model.FelhelyList.Add(new SelectListItem
|
||||
{
|
||||
Text = item.MukodesiHelyNev + (string.IsNullOrWhiteSpace(item.FelhelyNev) ? "" : " - " + item.FelhelyNev),
|
||||
Value = string.Format("{0}_{1}", item.MukodesiHelyID.ToString(), item.FelhelyId.ToString())
|
||||
});
|
||||
}
|
||||
return View(model);
|
||||
}
|
||||
|
||||
public ActionResult SetFelHelyToClaim(string mukodesifelhelyId)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(mukodesifelhelyId))
|
||||
{
|
||||
int felhelyId;
|
||||
if (int.TryParse(mukodesifelhelyId.Split('_')[1], out felhelyId) && felhelyId > 0)
|
||||
{
|
||||
ClaimManager.AddClaim(KretaClaimTypes.FelhelySzuro, felhelyId.ToString());
|
||||
}
|
||||
|
||||
return Json(new { Url = Url.Content(CommonExtensions.GetDefaultPage()), Success = true });
|
||||
}
|
||||
|
||||
return Json(new { Success = false });
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user