42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|