Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Biblioteca
- {
- public int IdBiblioteca { get; set; }
- public string Nome { get; set; }
- public string Endereco { get; set; }
- }
- public class BibliotecaController : Controller
- {
- ADAO dao = DAOFactory.GetInstance(DAOFactory.DAOType.Biblioteca);
- [HttpGet]
- public ActionResult DeleteLibrary(int id)
- {
- return View(dao.Select(id));
- }
- [HttpPost]
- public ActionResult DeleteLibrary(Biblioteca b)
- {
- dao.Delete(b);
- return RedirectToAction("Index");
- }
- }
- @model BibliotecaWebApp.Models.Biblioteca
- <h2>DeleteLibrary</h2>
- <h3>Are you sure you want to delete this?</h3>
- <div>
- <h4>Biblioteca</h4>
- <hr />
- <dl class="dl-horizontal">
- <dt>@Html.DisplayNameFor(model => model.IdBiblioteca)</dt>
- <dd>@Html.DisplayFor(model => model.IdBiblioteca)</dd>
- <dt>@Html.DisplayNameFor(model => model.Nome)</dt>
- <dd>@Html.DisplayFor(model => model.Nome)</dd>
- <dt>@Html.DisplayNameFor(model => model.Endereco)</dt>
- <dd>@Html.DisplayFor(model => model.Endereco)</dd>
- </dl>
- @using (Html.BeginForm()) {
- @Html.AntiForgeryToken()
- <div class="form-actions no-color">
- <input type="submit" value="Delete" class="btn btn-default" /> |
- @Html.ActionLink("Back to List", "Index")
- </div>
- }
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement