Ejemplo n.º 1
0
        public ActionResult posterDemande(int lstService, int idMateriel, DateTime dateRealisation, int lstHeureDebut,
                                          int lstMinuteDebut, int lstHeureFin, int lstMinuteFin, int lstVille, string txtAdresse, bool ckbRecurrence)
        {
            // enregistrer les infos en base
            ActionDAO myActionDao = new ActionDAO();
            int       idAction    = myActionDao.ObtenirProchainIdAction();
            Action    action      = new Action()
            {
                Id_action             = idAction,
                Id_util               = 3, //Par défaut utilisateur 3
                Id_ville              = lstVille,
                Id_activite           = lstService,
                Id_gamme_heure_debut  = lstHeureDebut,
                Id_gamme_minute_debut = lstMinuteDebut,
                Id_gamme_heure_fin    = lstHeureFin,
                Id_gamme_minute_fin   = lstMinuteFin,
                Id_final              = 1,
                Date_action           = dateRealisation,
                Voie_action           = txtAdresse,
                Date_soumission       = DateTime.Now
            };

            try
            {
                myActionDao.EnregistrerNouvelleAction(action);
            } catch (Exception)
            {
                return(RedirectToAction("posterDemande"));
            }


            return(RedirectToAction("posterDemande"));
        }
Ejemplo n.º 2
0
        public ActionResult listeActions()
        {
            ActionDAO myDAO = new ActionDAO();

            ViewBag.test = myDAO.GetPremierString();
            Action ActionResult = myDAO.LireAction(3);

            ViewBag.result = ActionResult.ToString();

            //List<Action> maListe = myDAO.RecupererListeActions();
            //ViewBag.data = maListe;
            ViewBag.data = myDAO.RecupererListeActionsParUtil(1);
            var test = myDAO.DernierService(3, 2);  //Par défaut utilisateur 3

            ViewBag.test1 = test.Item1;
            ViewBag.test2 = test.Item2;

            int x = 00;

            ViewBag.X = x;


            return(View());
        }