source: branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/BaseController.cs @ 9324

Last change on this file since 9324 was 9324, checked in by fschoepp, 7 years ago

#1888:

  • DAL: Added a Delete method which deletes by experiment id.
  • HL DataTables will now be transposed and mapped as double[ROWS][COLUMNS] (transposed)
  • JS: Moved all classes into "modules" to prevent namespace pollution (using OAAS_MODEL for model classes, OAAS_VIEW for views and OAAS_CONTROLLER for controllers)
  • JS: Moved DatatypeMapper classes into Backbone views
  • JS: Models now correctly send DELETE requests
  • Added a new job overview page (which also renders run details) using AJAX
  • Using moment.min.js to format DateTime as string
  • Controllers now inherit from BaseController which provides a RedirectToLoginIfNecessary-method
  • Added loading animations to several AJAX bound places (loading experiments / scenarios)
  • Added a section to _Layout.cshtml which allows page-specific JavaScript includes (<script> only for a certain page)
  • Fixed Build/Edit of experiment menu redirecting to the wrong page
  • The Experiment Variation Dialog disables input fields, if the property has not been activated before
File size: 842 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Web;
5using System.Web.Mvc;
6using HeuristicLab.Services.Optimization.Web.Helpers;
7
8namespace HeuristicLab.Services.Optimization.Web.Controllers
9{
10    public class BaseController : Controller
11    {
12      protected ControllerServiceHelper ControllerService {
13        get {
14          var helper = new ControllerServiceHelper(Session["pw"] as string);
15          RedirectToLoginIfNecessary();
16          return helper;
17        }
18      }
19
20      protected bool RedirectToLoginIfNecessary(string destination="%2fOptimization") {
21        var pw = Session["pw"] as string;
22        if (pw == null) {
23          Response.Redirect("/Account/Logon?ReturnUrl=" + destination);
24          return true;
25        }
26        return false;
27      }
28    }
29}
Note: See TracBrowser for help on using the repository browser.