Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model StudentCouncilEventManager.ViewModels.EventInfoViewModel
- @{
- ViewBag.Title = "EventInfo";
- Layout = "~/Views/Shared/_Layout.cshtml";
- }
- <h2>@Model.SchoolEvent.Name Info</h2>
- <table class="table table-bordered" table-hover>
- <thead>
- <tr>
- <th>Product Name</th>
- <th>Product Price</th>
- <th>Product Cost to Manufacture</th>
- <th>Is Taxable</th>
- </tr>
- </thead>
- <tbody>
- @foreach (var product in Model.Products)
- {
- if (Model.SchoolEvent.Id == product.EventProductIsSoldAtId)
- {
- <tr>
- <td style="text-align: center">@product.Name</td>
- <td style="text-align: center">@product.Price</td>
- <td style="text-align: center">@product.CostToManufacture</td>
- <td style="text-align: center">@product.IsTaxable</td>
- </tr>
- }
- }
- </tbody>
- </table>
- <h2>Transactions</h2>
- <table class="table table-bordered" table-hover>
- <thead>
- <tr>
- <th>Product Name</th>
- <th>Product Price</th>
- <th>Product Cost to Manufacture</th>
- <th>Is Taxable</th>
- </tr>
- </thead>
- <tbody>
- @foreach (var transaction in Model.ProductTransactions.GroupBy(p => p.TransactionId).Select(i => i.First()).ToList())
- {
- if (transaction.SchoolEventId == Model.SchoolEvent.Id) // runs code below if transaction belongs to school events
- {
- <tr>
- <td style="text-align: center">supposed to be product name</td>
- <td style="text-align: center">@transaction.Id</td>
- <td style="text-align: center">@transaction.DiscountPercentage</td>
- <td style="text-align: center">@transaction.AmountOfProductSold</td>
- </tr>
- }
- }
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement