Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. public class Biblioteca
  2. {
  3. public int IdBiblioteca { get; set; }
  4. public string Nome { get; set; }
  5. public string Endereco { get; set; }
  6. }
  7.  
  8. public class BibliotecaController : Controller
  9. {
  10. ADAO dao = DAOFactory.GetInstance(DAOFactory.DAOType.Biblioteca);
  11.  
  12. [HttpGet]
  13. public ActionResult DeleteLibrary(int id)
  14. {
  15. return View(dao.Select(id));
  16. }
  17.  
  18. [HttpPost]
  19. public ActionResult DeleteLibrary(Biblioteca b)
  20. {
  21. dao.Delete(b);
  22. return RedirectToAction("Index");
  23. }
  24. }
  25.  
  26. @model BibliotecaWebApp.Models.Biblioteca
  27.  
  28. <h2>DeleteLibrary</h2>
  29. <h3>Are you sure you want to delete this?</h3>
  30. <div>
  31. <h4>Biblioteca</h4>
  32. <hr />
  33. <dl class="dl-horizontal">
  34. <dt>@Html.DisplayNameFor(model => model.IdBiblioteca)</dt>
  35. <dd>@Html.DisplayFor(model => model.IdBiblioteca)</dd>
  36. <dt>@Html.DisplayNameFor(model => model.Nome)</dt>
  37. <dd>@Html.DisplayFor(model => model.Nome)</dd>
  38. <dt>@Html.DisplayNameFor(model => model.Endereco)</dt>
  39. <dd>@Html.DisplayFor(model => model.Endereco)</dd>
  40. </dl>
  41.  
  42. @using (Html.BeginForm()) {
  43. @Html.AntiForgeryToken()
  44. <div class="form-actions no-color">
  45. <input type="submit" value="Delete" class="btn btn-default" /> |
  46. @Html.ActionLink("Back to List", "Index")
  47. </div>
  48. }
  49. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement