|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | +using System.Threading.Tasks; |
| 5 | +using Microsoft.AspNetCore.Http; |
| 6 | +using Microsoft.AspNetCore.Mvc; |
| 7 | + |
| 8 | +namespace Webgentle.BookStore.Areas.Admin.Controllers |
| 9 | +{ |
| 10 | + [Area("admin")] |
| 11 | + [Route("admin")] |
| 12 | + public class HomeController : Controller |
| 13 | + { |
| 14 | + // GET: HomeController |
| 15 | + [Route("")] |
| 16 | + public ActionResult Index() |
| 17 | + { |
| 18 | + return View(); |
| 19 | + } |
| 20 | + |
| 21 | + // GET: HomeController/Details/5 |
| 22 | + [Route("details/{id}")] |
| 23 | + public ActionResult Details(int id) |
| 24 | + { |
| 25 | + return View(id); |
| 26 | + } |
| 27 | + |
| 28 | + // GET: HomeController/Create |
| 29 | + public ActionResult Create() |
| 30 | + { |
| 31 | + return View(); |
| 32 | + } |
| 33 | + |
| 34 | + // POST: HomeController/Create |
| 35 | + [HttpPost] |
| 36 | + [ValidateAntiForgeryToken] |
| 37 | + public ActionResult Create(IFormCollection collection) |
| 38 | + { |
| 39 | + try |
| 40 | + { |
| 41 | + return RedirectToAction(nameof(Index)); |
| 42 | + } |
| 43 | + catch |
| 44 | + { |
| 45 | + return View(); |
| 46 | + } |
| 47 | + } |
| 48 | + |
| 49 | + // GET: HomeController/Edit/5 |
| 50 | + public ActionResult Edit(int id) |
| 51 | + { |
| 52 | + return View(); |
| 53 | + } |
| 54 | + |
| 55 | + // POST: HomeController/Edit/5 |
| 56 | + [HttpPost] |
| 57 | + [ValidateAntiForgeryToken] |
| 58 | + public ActionResult Edit(int id, IFormCollection collection) |
| 59 | + { |
| 60 | + try |
| 61 | + { |
| 62 | + return RedirectToAction(nameof(Index)); |
| 63 | + } |
| 64 | + catch |
| 65 | + { |
| 66 | + return View(); |
| 67 | + } |
| 68 | + } |
| 69 | + |
| 70 | + // GET: HomeController/Delete/5 |
| 71 | + public ActionResult Delete(int id) |
| 72 | + { |
| 73 | + return View(); |
| 74 | + } |
| 75 | + |
| 76 | + // POST: HomeController/Delete/5 |
| 77 | + [HttpPost] |
| 78 | + [ValidateAntiForgeryToken] |
| 79 | + public ActionResult Delete(int id, IFormCollection collection) |
| 80 | + { |
| 81 | + try |
| 82 | + { |
| 83 | + return RedirectToAction(nameof(Index)); |
| 84 | + } |
| 85 | + catch |
| 86 | + { |
| 87 | + return View(); |
| 88 | + } |
| 89 | + } |
| 90 | + } |
| 91 | +} |
0 commit comments