Ejemplo n.º 1
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));
            }
        }
Ejemplo n.º 2
0
        public ActionResult Create(Respuesta respuesta)
        {
            ActionResult Result;

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