Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
lesson60
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Нурбек Созоев
lesson60
Commits
d159ac81
Commit
d159ac81
authored
May 29, 2019
by
Нурбек Созоев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил страницу для отображения деталей продукта
parent
f2a35b29
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
2 deletions
+43
-2
ProductController.cs
Store/Controllers/ProductController.cs
+12
-0
Startup.cs
Store/Startup.cs
+3
-0
Details.cshtml
Store/Views/Product/Details.cshtml
+27
-0
_MainLayout.cshtml
Store/Views/Shared/_MainLayout.cshtml
+1
-2
No files found.
Store/Controllers/ProductController.cs
View file @
d159ac81
...
@@ -33,5 +33,17 @@ namespace Store.Controllers
...
@@ -33,5 +33,17 @@ namespace Store.Controllers
return
View
();
return
View
();
}
}
public
IActionResult
Details
(
string
id
)
{
return
View
(
new
Product
{
Id
=
Guid
.
NewGuid
().
ToString
(),
Name
=
"Asus A674"
,
Amount
=
150
,
Brand
=
"Asus"
,
Category
=
"TV"
});
}
}
}
}
}
Store/Startup.cs
View file @
d159ac81
...
@@ -57,6 +57,9 @@ namespace Store
...
@@ -57,6 +57,9 @@ namespace Store
{
{
routes
.
MapRoute
(
routes
.
MapRoute
(
name
:
"default"
,
template
:
"{controller=Product}/{action=Index}"
);
name
:
"default"
,
template
:
"{controller=Product}/{action=Index}"
);
routes
.
MapRoute
(
name
:
"details"
,
template
:
"{controller=Product}/{action=Details}/{id}"
);
});
});
}
}
}
}
...
...
Store/Views/Product/Details.cshtml
0 → 100644
View file @
d159ac81
@model Store.Models.Product
@{
Layout = "_MainLayout";
}
<h2>Product details:</h2>
<table class="table">
<tbody>
<tr>
<td>Name:</td>
<td>@Model.Name</td>
</tr>
<tr>
<td>Category:</td>
<td>@Model.Category</td>
</tr>
<tr>
<td>Brand:</td>
<td>@Model.Brand</td>
</tr>
<tr>
<td>Amount:</td>
<td>@Model.Amount</td>
</tr>
</tbody>
</table>
Store/Views/Shared/_MainLayout.cshtml
View file @
d159ac81
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<div
class=
"navbar-collapse collapse"
>
<div
class=
"navbar-collapse collapse"
>
<ul
class=
"nav navbar-nav"
>
<ul
class=
"nav navbar-nav"
>
<li>
<li>
<a
href=
"/Product/Index"
>
Home
</a>
<a
href=
"/Product/Index"
>
Main
</a>
</li>
</li>
</ul>
</ul>
</div>
</div>
...
@@ -39,7 +39,6 @@
...
@@ -39,7 +39,6 @@
</footer>
</footer>
</div>
</div>
<script
src=
"~/lib/jquery/dist/jquery.js"
></script>
<script
src=
"~/lib/jquery/dist/jquery.js"
></script>
<script
src=
"~/lib/bootstrap/dist/js/bootstrap.js"
></script>
<script
src=
"~/lib/bootstrap/dist/js/bootstrap.js"
></script>
<script
src=
"~/js/site.js"
asp-append-version=
"true"
></script>
<script
src=
"~/js/site.js"
asp-append-version=
"true"
></script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment