This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,42 @@
using System;
using System.Web.Http;
using System.Web.Mvc;
using Kreta.BusinessLogic.Helpers;
using Kreta.BusinessLogic.Security;
using Kreta.Resources;
using Kreta.Web.Areas.Hianyzas.Models;
using Kreta.Web.Helpers;
using Kreta.Web.Security;
namespace Kreta.Web.Areas.Hianyzas.Controllers
{
[MvcRoleClaimsAuthorize(true)]
[MvcRolePackageAuthorize(KretaClaimPackages.Ellenorzo.ClaimValue)]
public class HianyzasokController : Controller
{
// GET: Hianyzas/Hianyzasok
public ActionResult Index(int? id)
{
var hianyzasokSearchModel = new HianyzasokSearchModel
{
MulaszatasId = id,
};
return View(hianyzasokSearchModel);
}
public ActionResult Export([FromUri] HianyzasokSearchModel searchModel)
{
var mulasztasHelper = new MulasztasHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
var stream = mulasztasHelper.ExportTanuloKesesekHianyzasok(searchModel.ConvertToMulasztasokCo());
var fileName = string.Format(HianyzasResource.TanuloKesesekHianyzasokExportFileName, DateTime.Now.ToString(Constants.General.ExportFileNameDateFormat));
var result = new FileStreamResult(stream, Core.Constants.ContentTypes.Xlsx)
{
FileDownloadName = fileName
};
return result;
}
}
}