コード例 #1
0
        public ActionResult Edit(int id, Evento evento)
        {
            if (Session[Constantes.UsuarioSession] == null)
            {
                return(RedirectToAction("Auth", "Login"));
            }
            try
            {
                Usuario usLogeado = (Usuario)Session[Constantes.UsuarioSession];

                evento.CodEvento  = id;
                evento.CodUsuario = usLogeado.CodUsuario;
                SRefEvento.ServiceResponse response = clientEv.actualizar(evento);

                if (response.IsSuccess)
                {
                    return(RedirectToAction("Index"));
                }


                ViewBag.areaTematicas = comboBoxAreaTematica();
                ViewBag.estados       = comboBoxEstado();

                ViewBag.Message = response.Message;
            }
            catch (Exception ex)
            {
            }

            return(View(evento));
        }
コード例 #2
0
 public ActionResult Delete(int id, Evento evento)
 {
     try
     {
         SRefEvento.ServiceResponse service = clientEv.eliminar(id);
         // TODO: Add delete logic here
         if (service.IsSuccess)
         {
             return(RedirectToAction("Index"));
         }
         return(View(evento));
     }
     catch
     {
         return(View(evento));
     }
 }
コード例 #3
0
        public ActionResult Create(Evento evento)
        {
            if (Session[Constantes.UsuarioSession] == null)
            {
                return(RedirectToAction("Auth", "Login"));
            }
            try
            {
                Usuario usLogeado = (Usuario)Session[Constantes.UsuarioSession];


                if (evento == null)
                {
                    ViewBag.Message = "Ingrese Datos";
                    return(View(evento));
                }

                evento.CodUsuario         = usLogeado.CodUsuario;
                evento.LugaresDisponibles = evento.LimiteParticipantes;

                SRefEvento.ServiceResponse respuesta = clientEv.registrar(evento);

                if (respuesta.IsSuccess)
                {
                    return(RedirectToAction("Index"));
                }


                ViewBag.Message = respuesta.Message;

                return(View(evento));
            }
            catch (Exception ex)
            {
            }

            ViewBag.AreaTematicas = comboBoxAreaTematica();

            return(View(evento));
        }
コード例 #4
0
        public ActionResult Create(Evento evento)
        {
            try
            {
                evento.CodUsuario         = 1;
                evento.LugaresDisponibles = evento.LimiteParticipantes;
                SRefEvento.ServiceResponse response = clientEv.registrar(evento);

                if (response.IsSuccess)
                {
                    return(RedirectToAction("Index"));
                }

                ViewBag.areaTematicas = comboBoxAreaTematica();

                ViewBag.Message = response.Message;

                return(View(evento));
            }
            catch (Exception ex)
            {
                return(View(evento));
            }
        }
コード例 #5
0
        public ActionResult Edit(int id, Evento evento)
        {
            try
            {
                evento.CodEvento  = id;
                evento.CodUsuario = 1;
                SRefEvento.ServiceResponse response = clientEv.actualizar(evento);

                if (response.IsSuccess)
                {
                    return(RedirectToAction("Index"));
                }


                ViewBag.areaTematicas = comboBoxAreaTematica();

                ViewBag.Message = response.Message;
            }
            catch (Exception ex)
            {
            }

            return(View(evento));
        }