// GET: LibrarianBook/Details/5 public ActionResult Details(int id) { Book book = bookDataGateway.SelectById(id); if (book == null) { return(HttpNotFound()); } return(View(book)); }
// GET: Book/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Book book = DataGateway.SelectById(id); if (book == null) { return(HttpNotFound()); } return(View(book)); }
// GET: Attractions/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Attraction attraction = dataGateway.SelectById(id); if (attraction == null) { return(HttpNotFound()); } ViewBag.Longitude = attraction.atLocLong; ViewBag.Latitude = attraction.atLocLat; return(View(attraction)); }
public virtual IActionResult Details(int?id) { if (id == null) { return(NotFound()); } var objectDetails = dataGateway.SelectById(id); if (objectDetails == null) { return(NotFound()); } return(View(objectDetails)); }
// GET: Restaurant/Details/ public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Restaurant myRestaurant = dataGateway.SelectById(id); if (myRestaurant == null) { return(HttpNotFound()); } ViewBag.Longitude = myRestaurant.restLocLong; ViewBag.Latitude = myRestaurant.restLocLat; return(View(myRestaurant)); }
public ActionResult Index() { if (User.Identity.IsAuthenticated) { var user = User.Identity; ViewBag.Name = user.Name; ViewBag.displayMenu = "No"; if (isWhatUser().Equals("Librarian")) { ViewBag.displayMenu = "Librarian"; } else if (isWhatUser().Equals("Borrower")) { ViewBag.displayMenu = "Borrower"; } return(View()); } else { ViewBag.Name = "Not Logged in"; } // For displaying popular books Book book1 = DataGateway.SelectById(1); Book book2 = DataGateway.SelectById(2); Book book3 = DataGateway.SelectById(3); List <Book> list = new List <Book>(); list.Add(book1); list.Add(book2); list.Add(book3); return(View(list)); }
//Get : Attraction/Edit public ActionResult DetailsTicketPrice(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TicketPrice ticketprice = ticketDataGateway.SelectById(id); if (ticketprice == null) { return(HttpNotFound()); } return(View(ticketprice)); }