Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model System_biblioteczny.Models.RentBookViewModel
- @{
- ViewBag.Title = "Wypozycz ksiazke";
- Layout = "~/Views/Shared/_Layout.cshtml";
- }
- <h2>Lista dostepnych ksiazek w bazie</h2>
- <table class="table">
- <thead>
- <tr>
- <th scope="col">Tytul</th>
- <th scope="col">Podtytul</th>
- <th scope="col">Rok wydania</th>
- <th scope="col">Ilosc</th>
- </tr>
- </thead>
- <tbody>
- @foreach (var book in Model.Books)
- {
- <tr>
- <td>@book.ksiazka_id</td>
- <td>@book.tytul</td>
- <td>@book.tytul2</td>
- <td>@book.rok_wydania</td>
- <td>@book.stawka</td>
- @if (book.stawka > 0)
- {
- Html.BeginForm("RentBook", "Rent", new { card = Model.User.nr_karty, bookId = Model.Books.Find(b => b.ksiazka_id == book.ksiazka_id)});
- {
- <td>
- <button type="submit" class="btn btn-default">Wypozycz</button>
- </td>
- }
- }
- else
- {
- <td><a href="#"><button class="btn btn-default">Egzemplarze wypozyczone</button></a></td>
- }
- </tr>
- }
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement