Ejemplo n.º 1
0
        public ActionResult Delete(int id)
        {
            TemasBLL oBLL = new TemasBLL();

            oBLL.Delete(id);
            return(RedirectToAction("Index")); //redirecionar al index cuando borres
        }
Ejemplo n.º 2
0
        public ActionResult Details(int id)
        {
            TemasBLL oBLL = new TemasBLL();
            Tema tema = oBLL.Retrieve(id);

            return View(tema);
        }
Ejemplo n.º 3
0
        public ActionResult Edit(int id)
        {
            TemasBLL oBLL = new TemasBLL();
            Tema     tema = oBLL.Retrieve(id);

            return(View(tema));
        }
Ejemplo n.º 4
0
        // GET: Categorias
        public ActionResult Index()
        {
            TemasBLL    oBLL  = new TemasBLL();
            List <Tema> temas = oBLL.RetrieveAll();

            return(View(temas));
        }
Ejemplo n.º 5
0
        public string GetTema(int id)
        {
            TemasBLL mBLL = new TemasBLL();
            Tema     tema = mBLL.Retrieve(id);
            var      name = tema.NombreTema;

            return(name);
        }
Ejemplo n.º 6
0
        public ActionResult BuscarPreguntas()
        {
            TemasBLL    obBLL = new TemasBLL();
            List <Tema> temas = obBLL.RetrieveAll();

            ViewBag.TemaID = new SelectList(temas, "TemaID", "NombreTema");
            return(View());
        }
Ejemplo n.º 7
0
        public ActionResult Create()
        {
            TemasBLL    temasBLL = new TemasBLL();
            List <Tema> temas    = temasBLL.RetrieveAll();

            ViewBag.TemaID = new SelectList(temas, "TemaID", "NombreTema");
            PreguntasBLL    preguntaBLL = new PreguntasBLL();
            List <Pregunta> preguntas   = preguntaBLL.RetrieveAll();

            ViewBag.PreguntaID = new SelectList(preguntas, "PreguntaID", "TituloPregunta");
            return(View());
        }
Ejemplo n.º 8
0
 public ActionResult Edit(Tema tema)
 {
     ActionResult Result;
     try
     {
         if (ModelState.IsValid)
         {
             TemasBLL oBLL = new TemasBLL();
             oBLL.Update(tema);
             Result = RedirectToAction("Index");
         }
         else
         {
             Result = View(tema);
         }
         return Result;
     }
     catch (Exception e)
     {
         return View(tema);
     }
 }
Ejemplo n.º 9
0
        public ActionResult CreateSelect()
        {
            TemasBLL              mBLL       = new TemasBLL();
            List <Tema>           tema       = mBLL.RetrieveAll();
            List <SelectListItem> listSelect = new List <SelectListItem>();

            foreach (var tem in tema)
            {
                SelectListItem selectListItem = new SelectListItem()
                {
                    Text     = tem.NombreTema,
                    Value    = tem.TemaID.ToString(),
                    Selected = tem.IsSelected
                };
                listSelect.Add(selectListItem);
            }

            VMPregunta vMPregunta = new VMPregunta();

            vMPregunta.Temas = listSelect;
            return(PartialView("_Select", vMPregunta));
        }