using System.Web; using System.Web.Mvc; using Kreta.Web.Areas.ImportExport.Models.TanmenetImportExport; using Kreta.Web.Classes; using Kreta.Web.Security; namespace Kreta.Web.Areas.ImportExport.Controllers { public class TanmenetImportExportController : BaseTanmenetImportExportController { #region Fields private const string TovabbUrl = @"~/Tantargy/Tanmenet"; #endregion Fields #region Properties public static string ControllerName => "TanmenetImportExport"; #endregion public TanmenetImportExportController(IUploadFileValidator uploadFileValidator, IKretaAuthorization authorization) : base(uploadFileValidator, authorization) { } public ActionResult Index() { if (Authorization.IsValidTanulasiElemImportExport()) { return Redirect(Url.Action("AccessDenied", "ErrorHandler", new { area = string.Empty })); } var model = new TanmenetImportExportModel { MaxAllowedFileSizeInBytes = UploadFileValidator.Configuration.ImportMaxAllowedFileSizeInBytes, AllowedFileExtensions = UploadFileValidator.Configuration.ImportAllowedFileExtensions, ControllerName = ControllerName, }; return View(model); } public JsonResult UploadFile(HttpPostedFileBase importFile, int? tantargyfelosztasId) { return UploadFile(importFile, tantargyfelosztasId, false); } public ActionResult Import() { return Import(TovabbUrl); } } }