public ActionResult DeleteConfirmed(int id)
        {
            var laboratorioBo = new LaboratorioBo();

            laboratorioBo.Apagar(id);
            return(RedirectToAction("Index"));
        }
예제 #2
0
        // GET: api/Laboratorios/5
        public HttpResponseMessage Get(int id)
        {
            var laboratorioBo = new LaboratorioBo();

            Laboratorio obj = laboratorioBo.ObterPorId(id);

            var response = Request.CreateResponse(HttpStatusCode.OK, obj);

            return(response);
        }
 public ActionResult Edit([Bind(Include = "LaboratorioId,Nome,Capacidade,Status,DataCadastro,BlocoId")] Laboratorio laboratorio)
 {
     if (ModelState.IsValid)
     {
         var laboratorioBo = new LaboratorioBo();
         laboratorioBo.Editar(laboratorio);
         return(RedirectToAction("Index"));
     }
     ViewBag.BlocoId = new SelectList(db.Blocos, "BlocoId", "Nome", laboratorio.BlocoId);
     return(View(laboratorio));
 }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var laboratorioBo = new LaboratorioBo();
            var laboratorio   = laboratorioBo.Mostrar(id.Value);

            if (laboratorio == null)
            {
                return(HttpNotFound());
            }
            return(View(laboratorio));
        }