Example #1
0
        // GET: Simulateur/Maison
        public ActionResult Index()
        {
            Session["service"] = _service;

            IndexViewModel view = new IndexViewModel();

            view.lesPlans = _donnePlanBDD();
            view.PlanViewModel.lesModules = Mapper.Map <List <Module>, List <ModuleDTO> >(_moduleService.DonneTous().ToList());

            return(View(view));
        }
Example #2
0
        // GET: GestionStock/Stocks
        public ActionResult Index()
        {
            Session["service"] = _service;

            ModuleIndexViewModel     modelOut = new ModuleIndexViewModel();
            BootstrapButtonViewModel button   = new BootstrapButtonViewModel();

            modelOut.tableauModules.typeObjet      = "RechercheDeveloppement/Module";
            modelOut.tableauModules.avecActionCrud = true;
            modelOut.tableauModules.messageSiVide  = "Aucun module n'a été ajouté à l'application.";

            List <ModuleDTO> lesModules = Mapper.Map <List <Module>, List <ModuleDTO> >(_moduleService.DonneTous().ToList());

            modelOut.tableauModules.lesLignes.Add(new List <object> {
                "", "Nom module", "Gamme", "Prix du module", ""
            });

            foreach (ModuleDTO module in lesModules)
            {
                button = new BootstrapButtonViewModel
                {
                    href         = Url.Action("Detail", "Module", new { area = "RechercheDeveloppement", id = module.id }).ToString(),
                    cssClass     = "",
                    libe         = " ",
                    typeDeBouton = Parametres.TypeBouton.Detail
                };
                modelOut.tableauModules.lesLignes.Add(new List <object> {
                    button, module.libe, module.typeModule.libe, module.prix.ToString(), module.id
                });
            }


            return(View(modelOut));
        }