using System.Collections.Generic; using System.Linq; using System.Web.Mvc; using BeWoPlanerMobil.Models; using BeWoPlanerMobil.Service; using BeWoPlanerMobil.Util; using BS.Shared.Core; namespace BeWoPlanerMobil.Controllers { public class DebuggingToolsController : AbstractBaseController { private DebuggingToolsModel _Model; public DebuggingToolsModel Model { get { if(!MobileSessionFacade.IsUserLoggedIn()) { Logout(); return null; } if (_Model == null) { _Model = new DebuggingToolsModel(); InitModel(_Model); } //if (((DebuggingToolsModel)Session[ModelSessionConstants.DebuggingToolsModelKey])?.LoggedInEmployee is null) //{ // _Model = new DebuggingToolsModel(); // InitModel(_Model); // Session[ModelSessionConstants.DebuggingToolsModelKey] = _Model; //} //else //{ // _Model = (DebuggingToolsModel) Session[ModelSessionConstants.DebuggingToolsModelKey]; //} return _Model; } } [Authorize] public ActionResult DebuggingTools() { if(!MobileSessionFacade.IsUserLoggedIn() || Model is null) { return RedirectToActionPermanent("Index", "Login"); } Model.MandatorSettings = new MandatorSettings(MobileSessionFacade.Mandator.Settings); return View(Model); } [Authorize] public ActionResult LoadSettingsPartial() { return PartialView("DevToolsSettingsPartial", Model); } [Authorize] public ActionResult LoadUserRightPartial() { return PartialView("DevToolsUserRightsPartial", Model); } [Authorize] public ActionResult LoadDataGenerationPartial() { return PartialView("DevToolsDataGenerationPartial", Model); } [Authorize] public override string SaveCollapsibleStatus(bool isOpen, string identifier) { Model.Collapsibles2IsShown[identifier] = isOpen; return LeerzeichenFuerGetMethoden; } } }