Beispiel #1
0
        public ActionResult Creer()
        {
            ViewBag.ListeTypes        = TypeBL.GetAllTypes().Select(x => x.ToSelectListItem());
            ViewBag.ListeClients      = ClientBL.GetAllClients().Select(x => x.ToSelectListItem());
            ViewBag.ListeResponsables = ResponsableBL.GetAllResponsables().Select(x => x.ToSelectListItem());
            ViewBag.ListeTechnologies = TechnologieBL.GetAllTechnologies().Select(x => x.ToSelectListItem());

            //Creating the default environnements
            var composant = new ComposantModel();

            composant.Environnements = EnvironnementBL.GetDefaultEnvironnements().Select(x => x.ToEnvironnementModel()).ToList();

            return(View("Creer", composant));
        }
Beispiel #2
0
        public ActionResult Modifier(int id, int idEnvironnement)
        {
            var composant = ComposantBL.GetComposant(id);

            if (composant == null)
            {
                return(View("Error"));
            }
            else
            {
                composant.EnvironnementSelectionne = idEnvironnement;

                ViewBag.ListeTypes        = TypeBL.GetAllTypes().Select(x => x.ToSelectListItem());
                ViewBag.ListeClients      = ClientBL.GetAllClients().Select(x => x.ToSelectListItem());
                ViewBag.ListeResponsables = ResponsableBL.GetAllResponsables().Select(x => x.ToSelectListItem());
                ViewBag.ListeTechnologies = TechnologieBL.GetAllTechnologies().Select(x => x.ToSelectListItem());
                return(View("Modifier", composant));
            }
        }