Advertisement
Guest User

Untitled

a guest
May 7th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. @using BlazorMVVM.Client.ViewModels
  2.  
  3. <button class="btn btn-primary" onclick="@ViewModel.AddItemsButtonClickDelegate.Invoke">Display/Hide Catalog</button>
  4.  
  5. @if (ViewModel.CatalogItems.Count > 0)
  6. {
  7. <table class="table table-bordered table-hover">
  8. <thead class="thead-light">
  9. <tr>
  10. <th>Item</th>
  11. <th>Quantity</th>
  12. <th>Price</th>
  13. </tr>
  14. </thead>
  15. <tbody>
  16. @foreach (var item in ViewModel.CatalogItems)
  17. {
  18. <tr onclick=@(() => ViewModel.SelectItem(item.Key))>
  19. <td>@item.Value.Name</td>
  20. <td>@item.Value.Quantity</td>
  21. <td>@item.Value.Price.DisplayPrice()</td>
  22. </tr>
  23. }
  24. </tbody>
  25. </table>
  26. }
  27. @if (ViewModel.SelectedItem.Key != 0)
  28. {
  29. <table class="table">
  30. <tbody>
  31. <tr>
  32. <td>@ViewModel.SelectedItem.Value.Name</td>
  33. <td><button class="btn bg-primary" onclick=@(() => ViewModel.AddSelectedItemToCartDelegate(ViewModel.SelectedItem.Key))>Add to Cart</button></td>
  34. <td><button class="btn bg-primary" onclick="@ViewModel.ClickCancel">Cancel</button></td>
  35. </tr>
  36. </tbody>
  37. </table>
  38. }
  39.  
  40. @functions {
  41. [Parameter]
  42. private IInventoryCatalog_ViewModel ViewModel { get; set; }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement