// GET: api/WebApiEditora/5 public Editora Get(int id) { editora = new EditoraBUS(); var result = editora.BuscarEditora(id); return(result); }
// GET: RealBooks/Details/5 public ActionResult Details(int id) { EditoraBUS objEditora = new EditoraBUS(); var lst = objEditora.BuscarEditora(id); return(View(lst)); }
// GET: api/WebApiEditora/5 public Editora Get(int id) { editora = new EditoraBUS(); // retorna editora pelo ID var result = editora.BuscarEditora(id); return(result); }
// GET: RealBooks/Delete/5 public ActionResult Delete(int id) { EditoraBUS objEditora = new EditoraBUS(); var lst = objEditora.BuscarEditora(id); //EditoraBUS objEditora = new EditoraBUS(); objEditora.Excluir(id); return(View(lst)); }
// GET: RealBooks/Edit/5 public ActionResult Edit(int id) { try { if (!ModelState.IsValid) { ModelState.AddModelError("Editora", "Editora Invalida"); } EditoraBUS objEditora = new EditoraBUS(); var lst = objEditora.BuscarEditora(id); return(View()); } catch { return(View()); } }
// GET: api/WebApiEditora/5 public Editora Get(int id) { editora = new EditoraBUS(); // retorna uma Editora pelo ID var result = editora.BuscarEditora(id); if (result == null) { //throw new HttpResponse(HttpStatusCode.NotFound); } HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, result); return(result); }
// GET: RealBooks/Edit/5 public ActionResult Edit(int id) { try { if (!ModelState.IsValid) { ModelState.AddModelError("Editora", "Editora inválida."); } EditoraBUS objEditora = new EditoraBUS(); var lst = objEditora.BuscarEditora(id); return(View(lst)); } catch (Exception) { return(View()); } return(View()); }