Beispiel #1
0
        public ActionResult SupprimerSondage(int?id, string confirmer, string annuler)
        {
            if (!String.IsNullOrEmpty(confirmer) && String.IsNullOrEmpty(annuler))
            {
                GetSondage_Result sond = null;

                try
                {
                    if (id == null)
                    {
                        throw new ArgumentNullException("id");
                    }

                    sond = db.GetSondage(id).First();
                }
                catch
                {
                    TempData[Constantes.CLE_MSG_RETOUR] = new Message(Message.TYPE_MESSAGE.ERREUR, Resources.Sondages.idSondageInvalide);
                }

                if (sond != null)
                {
                    db.SupprimerSondage(id);

                    TempData[Constantes.CLE_MSG_RETOUR] = new Message(Message.TYPE_MESSAGE.SUCCES, Resources.Sondages.sondageSupprime);
                }
            }

            return(RedirectToAction("ResultatsSondages", "Sectoriel"));
        }
Beispiel #2
0
        public ActionResult SupprimerSondage(int?id)
        {
            GetSondage_Result sond = null;

            try
            {
                if (id == null)
                {
                    throw new ArgumentNullException("id");
                }

                sond = db.GetSondage(id).First();
            }
            catch
            {
                TempData[Constantes.CLE_MSG_RETOUR] = new Message(Message.TYPE_MESSAGE.ERREUR, Resources.Sondages.idSondageInvalide);
            }

            if (sond != null)
            {
                return(View(sond));
            }

            return(RedirectToAction("ResultatsSondages", "Sectoriel"));
        }