Exemplo n.º 1
0
        // GET: Auditeur
        public ActionResult Resultats(int id)
        {
            Audit currentaudit = ServiceAudit.getAudit(id);

            ResultsViewModel resultats = new ResultsViewModel();

            resultats.audit  = currentaudit;
            resultats.themes = ServiceTheme.GetAllThemeswithoutdetaching(currentaudit);

            if (!currentaudit.isInProgress)
            {
                resultats.resultats = new List <Resultat>();
                foreach (var item in resultats.themes)
                {
                    foreach (var inneritem in item.points)
                    {
                        resultats.resultats.Add(new Resultat {
                            theme = item, point = inneritem, audit = currentaudit, Note = 0
                        });
                    }
                }
            }
            else
            {
                resultats.resultats = ServiceResultat.getAuditresults(currentaudit);
            }
            return(View(resultats));
        }
Exemplo n.º 2
0
        public ActionResult AddPointToTheme(Point point)
        {
            Theme  theme;
            string idS = Request["theme.ThemeId"];
            int    id  = int.Parse(idS);

            theme = ServiceTheme.GetTheme(id);


            //if (ModelState.IsValid)
            //{
            try
            {
                BL.Services.ServicePoint.addPoint(point);

                //        pointrepo.context.Entry(user).State = EntityState.Unchanged;
                //        pointrepo.context.Entry(theme).State = EntityState.Unchanged;
                //        pointrepo.Save();
                return(Redirect("/Themes/Details/" + id));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            //}



            return(View(point));
        }
        // GET: Evenements/Create
        public ActionResult Create()
        {
            var vm = new CreateEditEvenementVM();

            vm.Evenement = new Evenement();
            vm.Themes    = ServiceTheme.GetListeThemes();
            return(View(vm));
        }
        // GET: Evenement/Edit/5
        public ActionResult Edit(Guid id)
        {
            SelectList         themesBO = new SelectList(ServiceTheme.GetAll(), "ID", "Libelle");
            EvenementViewModel evm      = new EvenementViewModel(ServiceEvenement.GetAll().FirstOrDefault(l => l.ID == id));

            evm.themes = themesBO;
            return(View(evm));
        }
        // GET: Evenement/Create
        public ActionResult Create()
        {
            SelectList         themesBO = new SelectList(ServiceTheme.GetAll(), "ID", "Libelle");
            EvenementViewModel evm      = new EvenementViewModel();

            evm.themes = themesBO;
            return(View(evm));
        }
Exemplo n.º 6
0
        public static List <ThemeViewModel> GetAll()
        {
            List <ThemeViewModel> retour = new List <ThemeViewModel>();
            List <Theme>          livres = ServiceTheme.GetAll();

            foreach (Theme li in livres)
            {
                retour.Add(new ThemeViewModel(li));
            }
            return(retour);
        }
Exemplo n.º 7
0
        public ActionResult PDCAZone(int?idAudit, int?idResultat)
        {
            ResultsViewModel resultats = new ResultsViewModel();

            resultats.auditid   = idAudit.Value;
            resultats.audit     = ServiceAudit.getAudit(idAudit.Value);
            resultats.resultats = ServiceResultat.getAuditresults(resultats.audit);
            resultats.themes    = ServiceTheme.GetAllThemeswithoutdetaching(resultats.audit);
            ViewBag.idResultat  = idResultat;
            return(View(resultats));
        }
Exemplo n.º 8
0
        // GET: Theme
        public ActionResult Index()
        {
            List <ThemeViewModel> themesVM = new List <ThemeViewModel>();
            List <Theme>          themes   = ServiceTheme.GetAll();

            foreach (Theme theme in themes)
            {
                themesVM.Add(new ThemeViewModel(theme));
            }

            return(View(themesVM));
        }
Exemplo n.º 9
0
 public void Save()
 {
     if (this.ID == Guid.Empty)
     {
         //insert
         ServiceTheme.Insert(this.Metier);
     }
     else
     {
         //update
         ServiceTheme.Update(this.Metier.ID);
     }
 }
Exemplo n.º 10
0
        public ActionResult DernierResultats(int id)
        {
            ResultsViewModel resultats = new ResultsViewModel();

            Audit currentaudit = ServiceAudit.getlatestAuditforZone(id);

            resultats.audit = currentaudit;

            resultats.themes = ServiceTheme.GetAllThemeswithoutdetaching(currentaudit);

            resultats.resultats = ServiceResultat.getAuditresults(currentaudit);

            return(View(resultats));
        }
Exemplo n.º 11
0
        /// <summary>
        /// retourne un livre ViewModel
        /// </summary>
        /// <param name="id">Identifiant nullable du livre</param>
        /// <returns>si id null, retourne un viewModel avec un livre initialisé; Si id a une valeur retourne le viewModel avec le livre en BDD
        /// </returns>
        public static ThemeViewModel Get(Guid?id)
        {
            ThemeViewModel retour = null;

            if (id.HasValue)
            {
                retour = new ThemeViewModel(ServiceTheme.Get(id.Value));
            }
            else
            {
                Theme l = new Theme()
                {
                    ID = Guid.Empty, Libelle = "Default"
                };
                retour = new ThemeViewModel(l);
            }

            return(retour);
        }
        // GET: Evenements/Edit/5
        public ActionResult Edit(int?id)
        {
            if (!id.HasValue)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Evenement             evenement = ServiceEvenement.GetOneEvenement(id);
            CreateEditEvenementVM vm        = new CreateEditEvenementVM();

            vm.Evenement = evenement;
            vm.Themes    = ServiceTheme.GetListeThemes();
            List <int> liste = new List <int>();

            foreach (var i in evenement.Themes)
            {
                liste.Add(i.Id);
            }
            if (evenement == null)
            {
                return(HttpNotFound());
            }
            return(View(vm));
        }
Exemplo n.º 13
0
 // GET: Themes
 public ActionResult Index()
 {
     return(View(ServiceTheme.GetListeThemes()));
 }