﻿using System.Web.Mvc;

namespace SOURCE.Web.Controllers.Modularity
{
    public class BaseController : Controller
    {
        protected string Rubrique { get; set; }
        protected string Page { get; set; }
        protected string Secteur { get; set; }

        public BaseController()
            : base()
        {

        }

        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            /*
            List<ModuleModel> leftmodules = new List<ModuleModel>();
            leftmodules.Add(new ModuleModel { BaseModuleName = "Nouveautes", ID = 12 });

            ViewData["modules_gauche"] = (IEnumerable<ModuleModel>)leftmodules;

            List<ModuleModel> rightmodules = new List<ModuleModel>();
            rightmodules.Add(new ModuleModel { BaseModuleName = "Nouveautes", ID = 13 });
            rightmodules.Add(new ModuleModel { BaseModuleName = "MeilleuresVentes", ID = 20 });
            rightmodules.Add(new ModuleModel { BaseModuleName = "Nouveautes", ID = 14 });

            ViewData["modules_droite"] = (IEnumerable<ModuleModel>)rightmodules;

            if (RouteData.Values["secteur"] != null)
                this.Secteur = RouteData.Values["secteur"].ToString();
            else
                this.Secteur = string.Empty;

            if (RouteData.Values["subpage"] != null)
                this.Rubrique = RouteData.Values["subpage"].ToString();
            else
                this.Rubrique = "Normes";

            if (RouteData.Values["page"] != null)
                this.Page = RouteData.Values["page"].ToString();
            else
                this.Page = "Home";
             */
        }
    }
}
