示例#1
0
        public ActionResult Buscar(Pesquisa _pesquisa)
        {
            try
            {
                EventoBusiness eb     = new EventoBusiness();
                Evento         evento = new Evento();

                if (_pesquisa.Filtro == "Nome")
                {
                    evento = eb.BuscarPorNome(_pesquisa.Dado);
                }
                else if (_pesquisa.Filtro == "Id")
                {
                    evento = eb.BuscarPorId(_pesquisa.Dado);
                }

                Global.Global.EventoPesquisado = evento;

                return(Redirect("/Evento/"));
            }
            catch
            {
                return(Redirect("/Evento/"));
            }
        }
示例#2
0
        public ActionResult Alterar(EventoInsert _evento)
        {
            try
            {
                EventoBusiness eb     = new EventoBusiness();
                Evento         evento = new Evento();
                evento.IdEvento = _evento.IdEvento;

                eb.Alterar(_evento);

                evento = eb.BuscarPorId(evento.IdEvento);

                Global.Global.EventoPesquisado = evento;

                return(Redirect("/Evento/"));
            }
            catch
            {
                return(Redirect("/Evento/"));
            }
        }