Advertisement
Guest User

Untitled

a guest
May 26th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.52 KB | None | 0 0
  1. @model System_biblioteczny.Models.RentBookViewModel
  2. @{
  3.     ViewBag.Title = "Wypozycz ksiazke";
  4.     Layout = "~/Views/Shared/_Layout.cshtml";
  5. }
  6.  
  7. <h2>Lista dostepnych ksiazek w bazie</h2>
  8.  
  9.  
  10.  
  11.  
  12. <table class="table">
  13.     <thead>
  14.         <tr>
  15.             <th scope="col">Tytul</th>
  16.             <th scope="col">Podtytul</th>
  17.             <th scope="col">Rok wydania</th>
  18.             <th scope="col">Ilosc</th>
  19.         </tr>
  20.     </thead>
  21.     <tbody>
  22.         @foreach (var book in Model.Books)
  23.         {
  24.             <tr>
  25.                 <td>@book.ksiazka_id</td>
  26.                 <td>@book.tytul</td>
  27.                 <td>@book.tytul2</td>
  28.                 <td>@book.rok_wydania</td>
  29.                 <td>@book.stawka</td>  
  30.                
  31.                     @if (book.stawka > 0)
  32.                     {
  33.  
  34.                         Html.BeginForm("RentBook", "Rent", new { card = Model.User.nr_karty, bookId = Model.Books.Find(b => b.ksiazka_id == book.ksiazka_id)});
  35.                         {
  36.                             <td>                                
  37.                                 <button type="submit" class="btn btn-default">Wypozycz</button>
  38.                             </td>
  39.                         }
  40.                        
  41.                     }
  42.                     else
  43.                     {
  44.                        <td><a href="#"><button class="btn btn-default">Egzemplarze wypozyczone</button></a></td>
  45.                     }
  46.                
  47.             </tr>
  48.            
  49.         }
  50.     </tbody>
  51. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement