public ActionResult Details(int id) { RespuestasBLL oBLL = new RespuestasBLL(); Respuesta respuesta = oBLL.Retrieve(id); return(View(respuesta)); }
// GET: Preguntas // GET: Categorias public ActionResult Index() { RespuestasBLL oBLL = new RespuestasBLL(); List <Respuesta> respuestas = oBLL.RetrieveAll(); return(View(respuestas)); }
public ActionResult Delete(int id) { RespuestasBLL oBLL = new RespuestasBLL(); oBLL.Delete(id); return(RedirectToAction("Index")); //redirecionar al index cuando borres }
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)); } }
public ActionResult ShowRespuestas(int id) { RespuestasBLL listBLL = new RespuestasBLL(); List <Respuesta> respuestas = listBLL.FilterRespuestasByPreguntaID(id); return(PartialView("_ShowRespuestas", respuestas)); }
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)); } }