public ActionResult DeleteConfirmed(int id)
        {
            NLugares temp = new NLugares();

            temp.eliminarLugar(id);
            return(RedirectToAction("Index"));
        }
        // GET: Profesores/Create
        public ActionResult Create()
        {
            NLugares lugar = new NLugares();

            ViewBag.IdLugar = new SelectList(lugar.getLugares().ToList(), "IdLugar", "Nombre");
            return(View());
        }
 public ActionResult Edit([Bind(Include = "IdLugar,Nombre")] Lugares lugar)
 {
     if (ModelState.IsValid)
     {
         NLugares temp = new NLugares();
         temp.actualizarLugar(lugar);
         return(RedirectToAction("Index"));
     }
     return(View(lugar));
 }
        public ActionResult Create([Bind(Include = "Nombre")] Lugares lugar)
        {
            if (ModelState.IsValid)
            {
                NLugares temp = new NLugares();
                temp.crearLugar(lugar);

                return(RedirectToAction("Index"));
            }

            return(View(lugar));
        }
        // GET: Lugares/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NLugares temp  = new NLugares();
            var      lugar = temp.getLugares().Where(x => x.IdLugar == id).FirstOrDefault();

            if (lugar == null)
            {
                return(HttpNotFound());
            }
            return(View(lugar));
        }
        // GET: Lugares/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NLugares lugares = new NLugares();
            Lugares  temp    = lugares.getLugares().Where(x => x.IdLugar == id).FirstOrDefault();

            if (temp == null)
            {
                return(HttpNotFound());
            }
            return(View(temp));
        }
        // GET: Profesores/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NProfesor lista    = new NProfesor();
            var       profesor = lista.getProfesor2().ToList().Where(x => x.IdProfesor == id).FirstOrDefault();

            if (profesor == null)
            {
                return(HttpNotFound());
            }
            NLugares lugar = new NLugares();

            ViewBag.IdLugar = new SelectList(lugar.getLugares(), "IdLugar", "Nombre", profesor.IdLugar);
            return(View(profesor));
        }
        public ActionResult Edit([Bind(Include = "IdProfesor,Nombre,PrimerApellido,SegundoApellido,Usuario,CorreoElectronico,IdLugar")] Profesor profesor, HttpPostedFileBase Foto)
        {
            if (ModelState.IsValid)
            {
                if (Foto == null)
                {
                    profesor.Foto = null;
                }
                else
                {
                    profesor.Foto = new byte[Foto.ContentLength];
                    Foto.InputStream.Read(profesor.Foto, 0, Foto.ContentLength);
                }
                NProfesor profeTemp = new NProfesor();
                profeTemp.actualizarProfesor(profesor);
                return(RedirectToAction("Details", new { id = profesor.IdProfesor }));
            }
            NLugares lugar = new NLugares();

            ViewBag.IdLugar = new SelectList(lugar.getLugares(), "IdLugar", "Nombre", profesor.IdLugar);
            return(View(profesor));
        }
        // GET: Lugares
        public ActionResult Index()
        {
            NLugares lugares = new NLugares();

            return(View(lugares.getLugares().ToList()));
        }