Пример #1
0
        public ActionResult Details(int id)
        {
            RespuestasBLL oBLL      = new RespuestasBLL();
            Respuesta     respuesta = oBLL.Retrieve(id);

            return(View(respuesta));
        }
Пример #2
0
        // GET: Preguntas
        // GET: Categorias
        public ActionResult Index()
        {
            RespuestasBLL    oBLL       = new RespuestasBLL();
            List <Respuesta> respuestas = oBLL.RetrieveAll();

            return(View(respuestas));
        }
Пример #3
0
        public ActionResult Delete(int id)
        {
            RespuestasBLL oBLL = new RespuestasBLL();

            oBLL.Delete(id);
            return(RedirectToAction("Index")); //redirecionar al index cuando borres
        }
Пример #4
0
        public ActionResult ShowNewRespuesta(Pregunta pregunta, Respuesta respuesta)
        {
            ActionResult Result;

            try
            {
                if (ModelState.IsValid)
                {
                    RespuestasBLL oBLL = new RespuestasBLL();
                    oBLL.Create(respuesta);
                    RespuestasBLL    listBLL    = new RespuestasBLL();
                    List <Respuesta> respuestas = listBLL.FilterRespuestasByPreguntaID(pregunta.PreguntaID);
                    Result = PartialView("_ShowNewRespuesta", respuestas);
                }
                else
                {
                    Result = View(respuesta);
                }
                return(Result);
            }
            catch (Exception e)
            {
                return(View(respuesta));
            }
        }
Пример #5
0
        public ActionResult ShowRespuestas(int id)
        {
            RespuestasBLL    listBLL    = new RespuestasBLL();
            List <Respuesta> respuestas = listBLL.FilterRespuestasByPreguntaID(id);

            return(PartialView("_ShowRespuestas", respuestas));
        }
Пример #6
0
        public ActionResult Edit(Respuesta respuesta)
        {
            ActionResult Result;

            try
            {
                if (ModelState.IsValid)
                {
                    RespuestasBLL oBLL = new RespuestasBLL();
                    oBLL.Update(respuesta);
                    Result = RedirectToAction("Index");
                }
                else
                {
                    Result = View(respuesta);
                }
                return(Result);
            }
            catch (Exception e)
            {
                return(View(respuesta));
            }
        }