Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model WeAreNotGoodFoodVerCore2.Models.Restaurant
- @{
- ViewData["Title"] = "Details";
- }
- <h2>Details</h2>
- <div>
- <h4>Restaurant</h4>
- <hr />
- <dl class="dl-horizontal">
- <dt style=" width: 20%; color: darkslategrey">
- <h4 style=" width: 10%; color: darkslategrey">Название заведения</h4>
- </dt>
- <dd>
- <h4 style="width: 50%; color: brown"> @Html.DisplayFor(model => model.Name)</h4>
- </dd>
- <hr />
- <dt style=" width: 20%; color: darkslategrey">
- <h4 style=" width: 10%; color: darkslategrey"> Изображение</h4>
- </dt>
- <dd>
- <img src="~/@Model.ImagesRestaurant" width="550" height="350" />
- </dd>
- <hr />
- <dt style=" width: 20%; color: darkslategrey">
- <h4 style=" width: 20%; color: darkslategrey"> @Html.DisplayNameFor(model => model.Description)</h4>
- </dt>
- <dd>
- <h4 style=" width: 50%; color: darkslategrey"> @Html.DisplayFor(model => model.Description)</h4>
- </dd>
- <hr />
- <dt style=" width: 20%; color: darkslategrey">
- <h4 style=" width: 10%; color: darkslategrey">Имя владельца</h4>
- </dt>
- <dd>
- <h4 style=" width: 10%; color: brown">@Html.DisplayFor(model => model.User.Name)</h4>
- </dd>
- </dl>
- </div>
- <div>
- <a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
- <a asp-action="Index">Back to List</a>
- </div>
- @model IEnumerable<WeAreNotGoodFoodVerCore2.Models.Dish>
- @{
- ViewData["Title"] = "Index";
- }
- <h2>Все блюда</h2>
- <p>
- <h4 style="color: darkslategrey"> <a asp-action="Create">Добавить блюдо</a></h4>
- </p>
- <table class="table table-bordered">
- <thead>
- <tr style="width: auto">
- <th style="width: 10%; color: darkgray">Название</th>
- <th style="width: 60%; color: darkgray">Вид</th>
- <th style="width: 20%; color: darkgray">Цена</th>
- <th style="width: 5%; color: darkgray">Описание</th>
- <th style="width: 5%; color: darkgray">Название ресторана</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- @foreach (var item in Model) {
- <tr>
- <td>
- <h4 style="color: darkslategrey">@Html.DisplayFor(modelItem => item.NameDish)</h4>
- </td>
- <td>
- <img src="~/@item.ImagesDish" width="550" height="350" />
- </td>
- <td>
- <h4 style="color: brown">@Html.DisplayFor(modelItem => item.Price) .com</h4>
- </td>
- <td>
- <h4 style="color: darkgray">@Html.DisplayFor(modelItem => item.Description) </h4>
- </td>
- <td>
- <h4 style="color: darkslategrey">@Html.DisplayFor(modelItem => item.Restaurant.Name)</h4>
- </td>
- <form asp-area="" asp-controller="Dishes" asp-action="AddShoppingCart">
- <div class="form-group">
- <input type="submit" value="AddCart" class="btn btn-default"/>
- </div>
- </form>
- <td>
- <a asp-action="Edit" asp-route-id="@item.Id" style="color: cadetblue">Edit</a> <br />
- <a asp-action="Details" asp-route-id="@item.Id" style="color: cadetblue">Details</a> <br />
- <a asp-action="Delete" asp-route-id="@item.Id" style="color: cadetblue">Delete</a> <br />
- </td>
- </tr>
- }
- </tbody>
- </table>
- // GET: Restaurants/Details/5
- public async Task<IActionResult> Details(int? id)
- {
- if (id == null)
- {
- return NotFound();
- }
- var restaurant = await _context.Restaurants
- .Include(r => r.User)
- .SingleOrDefaultAsync(m => m.Id == id);
- if (restaurant == null)
- {
- return NotFound();
- }
- return View(restaurant);
- }
- // GET: Dishes
- public async Task<IActionResult> Index()
- {
- var applicationDbContext = _context.Dishes
- .Include(d => d.Restaurant)
- .OrderByDescending(r => r.Id);
- return View(await applicationDbContext.ToListAsync());
- }
- @model IEnumerable<WeAreNotGoodFoodVerCore2.Models.Dish>
- @{
- ViewData["Title"] = "Index";
- }
- <h2>Все блюда</h2>
- <p>
- <h4 style="color: darkslategrey"> <a asp-action="Create">Добавить блюдо</a></h4>
- </p>
- <table class="table table-bordered">
- <thead>
- <tr style="width: auto">
- <th style="width: 10%; color: darkgray">Название</th>
- <th style="width: 60%; color: darkgray">Вид</th>
- <th style="width: 20%; color: darkgray">Цена</th>
- <th style="width: 5%; color: darkgray">Описание</th>
- <th style="width: 5%; color: darkgray">Название ресторана</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- @foreach (var item in Model) {
- @Html.Partial("_PartialViewDish", item)
- }
- </tbody>
- </table>
- @model Dish
- <tr>
- <td>
- <h4 style="color: darkslategrey">@Html.DisplayFor(modelItem => item.NameDish)</h4>
- </td>
- <td>
- <img src="~/@item.ImagesDish" width="550" height="350" />
- </td>
- <td>
- <h4 style="color: brown">@Html.DisplayFor(modelItem => item.Price) .com</h4>
- </td>
- <td>
- <h4 style="color: darkgray">@Html.DisplayFor(modelItem => item.Description) </h4>
- </td>
- <td>
- <h4 style="color: darkslategrey">@Html.DisplayFor(modelItem => item.Restaurant.Name)</h4>
- </td>
- <form asp-area="" asp-controller="Dishes" asp-action="AddShoppingCart">
- <div class="form-group">
- <input type="submit" value="AddCart" class="btn btn-default"/>
- </div>
- </form>
- <td>
- <a asp-action="Edit" asp-route-id="@item.Id" style="color: cadetblue">Edit</a> <br />
- <a asp-action="Details" asp-route-id="@item.Id" style="color: cadetblue">Details</a> <br />
- <a asp-action="Delete" asp-route-id="@item.Id" style="color: cadetblue">Delete</a> <br />
- </td>
- </tr>
Add Comment
Please, Sign In to add comment