示例#1
0
        public ActionResult Index(CadastroEventoModel evento)
        {
            EventoDAL DAL     = new EventoDAL();
            var       sucesso = DAL.Inserir(evento);

            if (sucesso)
            {
                TempData["msg"] = "<script>alert('Evento Cadastrado com sucesso');</script>";

                ModelState.Clear();
            }
            else
            {
                TempData["msg"] = "<script>alert('Este evento já existe');</script>";
            }
            ViewBag.LocalId = new SelectList(context.LocalEvento.ToList(), "LocalId", "Nome");

            return(View());
        }