Upload project.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "AccessDenied";
|
||||
}
|
||||
|
||||
<h1>AccessDenied</h1><br />
|
||||
|
||||
Access to page has been denied.
|
||||
|
||||
17
ThAmCo-Stock/ThAmCo.Stock/Views/Account/Login.cshtml
Normal file
17
ThAmCo-Stock/ThAmCo.Stock/Views/Account/Login.cshtml
Normal file
@@ -0,0 +1,17 @@
|
||||
@{
|
||||
ViewData["Title"] = "Login";
|
||||
}
|
||||
|
||||
<h1>Login</h1>
|
||||
|
||||
<form asp-action="Login">
|
||||
<div class="form-group">
|
||||
<label for="emailInput">Username</label>
|
||||
<input type="email" name="email" class="form-control" placeholder="Enter email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="passwordInput">Password</label>
|
||||
<input type="password" name="password" class="form-control" placeholder="Password">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Login</button>
|
||||
</form>
|
||||
21
ThAmCo-Stock/ThAmCo.Stock/Views/Home/Index.cshtml
Normal file
21
ThAmCo-Stock/ThAmCo.Stock/Views/Home/Index.cshtml
Normal file
@@ -0,0 +1,21 @@
|
||||
@{
|
||||
ViewData["Title"] = "Admin Page";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Welcome</h1>
|
||||
<form action="stock/low">
|
||||
Product Count:
|
||||
<input type="number" name="count" value="5" min="1">
|
||||
<input type="submit" class="btn btn-danger" value="Low Stock">
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
<a class="btn btn-primary" href="/stock/index" role="button">View Stocks</a>
|
||||
<br />
|
||||
<br />
|
||||
<a class="btn btn-primary" href="/stock/vendorproducts/supplier?=undercutters" role="button">Vendor Products</a>
|
||||
<br />
|
||||
<br />
|
||||
<a class="btn btn-primary" href="/stock/orderrequests" role="button">Order Requests</a>
|
||||
</div>
|
||||
6
ThAmCo-Stock/ThAmCo.Stock/Views/Home/Privacy.cshtml
Normal file
6
ThAmCo-Stock/ThAmCo.Stock/Views/Home/Privacy.cshtml
Normal file
@@ -0,0 +1,6 @@
|
||||
@{
|
||||
ViewData["Title"] = "Privacy Policy";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<p>Use this page to detail your site's privacy policy.</p>
|
||||
25
ThAmCo-Stock/ThAmCo.Stock/Views/Shared/Error.cshtml
Normal file
25
ThAmCo-Stock/ThAmCo.Stock/Views/Shared/Error.cshtml
Normal file
@@ -0,0 +1,25 @@
|
||||
@model ErrorViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Error";
|
||||
}
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (Model.ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
||||
@@ -0,0 +1,25 @@
|
||||
@using Microsoft.AspNetCore.Http.Features
|
||||
|
||||
@{
|
||||
var consentFeature = Context.Features.Get<ITrackingConsentFeature>();
|
||||
var showBanner = !consentFeature?.CanTrack ?? false;
|
||||
var cookieString = consentFeature?.CreateConsentCookie();
|
||||
}
|
||||
|
||||
@if (showBanner)
|
||||
{
|
||||
<div id="cookieConsent" class="alert alert-info alert-dismissible fade show" role="alert">
|
||||
Use this space to summarize your privacy and cookie use policy. <a asp-area="" asp-controller="Home" asp-action="Privacy">Learn More</a>.
|
||||
<button type="button" class="accept-policy close" data-dismiss="alert" aria-label="Close" data-cookie-string="@cookieString">
|
||||
<span aria-hidden="true">Accept</span>
|
||||
</button>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
var button = document.querySelector("#cookieConsent button[data-cookie-string]");
|
||||
button.addEventListener("click", function (event) {
|
||||
document.cookie = button.dataset.cookieString;
|
||||
}, false);
|
||||
})();
|
||||
</script>
|
||||
}
|
||||
83
ThAmCo-Stock/ThAmCo.Stock/Views/Shared/_Layout.cshtml
Normal file
83
ThAmCo-Stock/ThAmCo.Stock/Views/Shared/_Layout.cshtml
Normal file
@@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - ThAmCo</title>
|
||||
|
||||
<environment include="Development">
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
|
||||
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
|
||||
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"/>
|
||||
</environment>
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||
<div class="container">
|
||||
<a class="navbar-brand">ThAmCo</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" href="https://localhost:44375">Products</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Stock</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Account" asp-action="Login">Login</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Account" asp-action="Logout">Logout</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="container">
|
||||
<partial name="_CookieConsentPartial" />
|
||||
<main role="main" class="pb-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2019 - ThAmCo.Stock - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<environment include="Development">
|
||||
<script src="~/lib/jquery/dist/jquery.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
|
||||
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
|
||||
asp-fallback-test="window.jQuery"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
|
||||
</script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"
|
||||
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o">
|
||||
</script>
|
||||
</environment>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
|
||||
@RenderSection("Scripts", required: false)
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<environment include="Development">
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.min.js"
|
||||
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.validator"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha256-F6h55Qw6sweK+t7SiOJX+2bpSAa3b/fnlrVCJvmEj1A=">
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"
|
||||
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha256-9GycpJnliUjJDVDqP0UEu/bsm9U+3dnQUH8+3W10vkY=">
|
||||
</script>
|
||||
</environment>
|
||||
30
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/AdjustCost.cshtml
Normal file
30
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/AdjustCost.cshtml
Normal file
@@ -0,0 +1,30 @@
|
||||
@model ThAmCo.Stock.Models.ViewModel.AdjustCostViewModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Adjust Cost";
|
||||
}
|
||||
|
||||
<h1>Adjust Cost</h1>
|
||||
|
||||
<h4>Cost</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@Html.LabelFor(m => m.Name) :
|
||||
@Html.DisplayFor(m => m.Name)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Description) :
|
||||
@Html.DisplayFor(m => m.Description)
|
||||
<form asp-action="AdjustCost">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="Cost" class="control-label"></label>
|
||||
<input asp-for="Cost" class="form-control" />
|
||||
<span asp-validation-for="Cost" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Adjust" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
43
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Create.cshtml
Normal file
43
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Create.cshtml
Normal file
@@ -0,0 +1,43 @@
|
||||
@model ThAmCo.Stock.Data.ProductStock
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h1>Create</h1>
|
||||
|
||||
<h4>ProductStock</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="ProductId" class="control-label"></label>
|
||||
<input asp-for="ProductId" class="form-control" />
|
||||
<span asp-validation-for="ProductId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Stock" class="control-label"></label>
|
||||
<input asp-for="Stock" class="form-control" />
|
||||
<span asp-validation-for="Stock" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="PriceId" class="control-label"></label>
|
||||
<input asp-for="PriceId" class="form-control" />
|
||||
<span asp-validation-for="PriceId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Create" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
39
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Delete.cshtml
Normal file
39
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Delete.cshtml
Normal file
@@ -0,0 +1,39 @@
|
||||
@model ThAmCo.Stock.Data.ProductStock
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h1>Delete</h1>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>ProductStock</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.ProductId)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.ProductId)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Stock)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.Stock)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.PriceId)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.PriceId)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<input type="submit" value="Delete" class="btn btn-danger" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</form>
|
||||
</div>
|
||||
36
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Details.cshtml
Normal file
36
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Details.cshtml
Normal file
@@ -0,0 +1,36 @@
|
||||
@model ThAmCo.Stock.Data.ProductStock
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h1>Details</h1>
|
||||
|
||||
<div>
|
||||
<h4>ProductStock</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.ProductId)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.ProductId)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Stock)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.Stock)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.PriceId)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.PriceId)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
44
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Edit.cshtml
Normal file
44
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Edit.cshtml
Normal file
@@ -0,0 +1,44 @@
|
||||
@model ThAmCo.Stock.Data.ProductStock
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h1>Edit</h1>
|
||||
|
||||
<h4>ProductStock</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Edit">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="ProductId" class="control-label"></label>
|
||||
<input asp-for="ProductId" class="form-control" />
|
||||
<span asp-validation-for="ProductId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Stock" class="control-label"></label>
|
||||
<input asp-for="Stock" class="form-control" />
|
||||
<span asp-validation-for="Stock" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="PriceId" class="control-label"></label>
|
||||
<input asp-for="PriceId" class="form-control" />
|
||||
<span asp-validation-for="PriceId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Save" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
47
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Index.cshtml
Normal file
47
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Index.cshtml
Normal file
@@ -0,0 +1,47 @@
|
||||
@model IEnumerable<ThAmCo.Stock.Models.Dto.ProductStockDto>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h1>Index</h1>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.ProductStock.ProductId)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.ProductStock.Stock)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.ProductStock.PriceId)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductStock.ProductId)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductStock.Stock)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductStock.PriceId)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.ProductStock.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.ProductStock.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.ProductStock.Id">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
54
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Low.cshtml
Normal file
54
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/Low.cshtml
Normal file
@@ -0,0 +1,54 @@
|
||||
@model IEnumerable<ThAmCo.Stock.Models.Dto.ProductStockDto>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Low Stock Products";
|
||||
}
|
||||
|
||||
<h1>Products with Low Stock</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().ProductStock.ProductId)
|
||||
</th>
|
||||
<th>
|
||||
Sale Price
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().ProductStock.Stock)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@{ int i = 1; }
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => i)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductStock.ProductId)
|
||||
</td>
|
||||
<td>
|
||||
£@Html.DisplayFor(modelItem => item.Price.ProductPrice)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductStock.Stock)
|
||||
</td>
|
||||
<td>
|
||||
<form asp-action="VendorProducts">
|
||||
<input type="hidden" asp-for="@item.ProductStock.ProductId" />
|
||||
<input type="submit" value="Order" class="btn btn-primary" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@Html.Display(i++.ToString())
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
31
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/OrderRequest.cshtml
Normal file
31
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/OrderRequest.cshtml
Normal file
@@ -0,0 +1,31 @@
|
||||
@model ThAmCo.Stock.Models.ViewModel.OrderRequestModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Order Request";
|
||||
}
|
||||
|
||||
<h1>OrderRequest</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@Html.LabelFor(m => m.Name) :
|
||||
@Html.DisplayFor(m => m.Name)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Description) :
|
||||
@Html.DisplayFor(m => m.Description)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Supplier) :
|
||||
@Html.DisplayFor(m => m.Supplier)
|
||||
<form asp-action="OrderRequestSubmitted">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<input type="hidden" asp-for="Supplier" />
|
||||
<div class="form-group">
|
||||
<label class="control-label">Quantity</label>
|
||||
<input type="number" name="quantity" class="form-control" min="1" value="1" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Request Order" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
@model ThAmCo.Stock.Models.ViewModel.OrderRequestReviewModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Order Request Review";
|
||||
}
|
||||
|
||||
<h1>Review Order Request from: @(Model.Supplier)</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@Html.LabelFor(m => m.Name) :
|
||||
@Html.DisplayFor(m => m.Name)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Description) :
|
||||
@Html.DisplayFor(m => m.Description)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Supplier) :
|
||||
@Html.DisplayFor(m => m.Supplier)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Quantity) :
|
||||
@Html.DisplayFor(m => m.Quantity)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Price) :
|
||||
£@Html.DisplayFor(m => m.Price)
|
||||
<form asp-action="OrderRequestApproved">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Approve Order" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
49
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/OrderRequests.cshtml
Normal file
49
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/OrderRequests.cshtml
Normal file
@@ -0,0 +1,49 @@
|
||||
@model IEnumerable<ThAmCo.Stock.Data.OrderRequest>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Order Requests (" + Model.Count() + ")";
|
||||
}
|
||||
|
||||
<h1>Order Requests</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().ProductId)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().SubmittedTime)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().Quantity)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().Price)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductId)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.SubmittedTime)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Quantity)
|
||||
</td>
|
||||
<td>
|
||||
£@Html.DisplayFor(modelItem => item.Price)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="OrderRequestReview" asp-route-id="@item.Id">Review</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
61
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/VendorProducts.cshtml
Normal file
61
ThAmCo-Stock/ThAmCo.Stock/Views/Stock/VendorProducts.cshtml
Normal file
@@ -0,0 +1,61 @@
|
||||
@model ThAmCo.Stock.Models.ViewModel.VendorProductIndexModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Vendor Product Index";
|
||||
}
|
||||
|
||||
<h1>Index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Name)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Description)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Price)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().BrandName)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().CategoryName)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().InStock)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Products)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Name)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Description)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Price)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.BrandName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.CategoryName)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="OrderRequest" asp-route-id="@item.Id" asp-route-supplier="@Model.Vendor">Order</a>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
3
ThAmCo-Stock/ThAmCo.Stock/Views/_ViewImports.cshtml
Normal file
3
ThAmCo-Stock/ThAmCo.Stock/Views/_ViewImports.cshtml
Normal file
@@ -0,0 +1,3 @@
|
||||
@using ThAmCo.Stock
|
||||
@using ThAmCo.Stock.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
3
ThAmCo-Stock/ThAmCo.Stock/Views/_ViewStart.cshtml
Normal file
3
ThAmCo-Stock/ThAmCo.Stock/Views/_ViewStart.cshtml
Normal file
@@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
||||
Reference in New Issue
Block a user