diff --git a/ComputerStoreEmployeeApp/Controllers/HomeController.cs b/ComputerStoreEmployeeApp/Controllers/HomeController.cs index e75787c..023b07b 100644 --- a/ComputerStoreEmployeeApp/Controllers/HomeController.cs +++ b/ComputerStoreEmployeeApp/Controllers/HomeController.cs @@ -1,5 +1,6 @@ using ComputerStoreContracts.BindingModels; using ComputerStoreContracts.ViewModels; +using ComputerStoreDataModels.Models; using ComputerStoreEmployeeApp.Models; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Mvc; @@ -11,10 +12,14 @@ namespace ComputerStoreEmployeeApp.Controllers public class HomeController : Controller { private readonly ILogger _logger; + private Dictionary _productComponents; + private Dictionary _pcComponents; public HomeController(ILogger logger) { _logger = logger; + _productComponents = new Dictionary(); + _pcComponents = new Dictionary(); } public IActionResult Index() @@ -159,11 +164,15 @@ namespace ComputerStoreEmployeeApp.Controllers } [HttpPost] - public void ProductAdd(string val) + public void ProductAdd(string productname, double productprice) { } + public double ProductComponents(int id) + { + var component = Task.Run(() => APIClient.GetRequest("api/main/getcomponent")).Result; + } [HttpGet] public IActionResult ProductUpdate() { diff --git a/ComputerStoreEmployeeApp/Views/Home/ComponentAdd.cshtml b/ComputerStoreEmployeeApp/Views/Home/ComponentAdd.cshtml index 519eb52..f22bf03 100644 --- a/ComputerStoreEmployeeApp/Views/Home/ComponentAdd.cshtml +++ b/ComputerStoreEmployeeApp/Views/Home/ComponentAdd.cshtml @@ -14,4 +14,8 @@ + @if (!string.IsNullOrEmpty(ViewBag.Message)) + { + + } \ No newline at end of file diff --git a/ComputerStoreEmployeeApp/Views/Home/ComponentDelete.cshtml b/ComputerStoreEmployeeApp/Views/Home/ComponentDelete.cshtml index 04f661d..ad7c8eb 100644 --- a/ComputerStoreEmployeeApp/Views/Home/ComponentDelete.cshtml +++ b/ComputerStoreEmployeeApp/Views/Home/ComponentDelete.cshtml @@ -11,4 +11,8 @@ + @if (!string.IsNullOrEmpty(ViewBag.Message)) + { + + } \ No newline at end of file diff --git a/ComputerStoreEmployeeApp/Views/Home/ComponentUpdate.cshtml b/ComputerStoreEmployeeApp/Views/Home/ComponentUpdate.cshtml index 92eadda..825b280 100644 --- a/ComputerStoreEmployeeApp/Views/Home/ComponentUpdate.cshtml +++ b/ComputerStoreEmployeeApp/Views/Home/ComponentUpdate.cshtml @@ -15,4 +15,8 @@ + @if (!string.IsNullOrEmpty(ViewBag.Message)) + { + + } \ No newline at end of file diff --git a/ComputerStoreEmployeeApp/Views/Home/ProductAdd.cshtml b/ComputerStoreEmployeeApp/Views/Home/ProductAdd.cshtml new file mode 100644 index 0000000..dd6ac21 --- /dev/null +++ b/ComputerStoreEmployeeApp/Views/Home/ProductAdd.cshtml @@ -0,0 +1,21 @@ +@{ + ViewData["Title"] = "Add a product"; +} +
+

Add a product

+
+
+
+
+
Name:
+ +
Price:
+ + +
+
+ @if (!string.IsNullOrEmpty(ViewBag.Message)) + { + + } +
\ No newline at end of file diff --git a/ComputerStoreEmployeeApp/Views/Home/ProductMenu.cshtml b/ComputerStoreEmployeeApp/Views/Home/ProductMenu.cshtml index 13b88bf..8bebd34 100644 --- a/ComputerStoreEmployeeApp/Views/Home/ProductMenu.cshtml +++ b/ComputerStoreEmployeeApp/Views/Home/ProductMenu.cshtml @@ -7,38 +7,26 @@

What do you want to do with products?

- +
+ +
-
- +
+ +
- +
+ +
- +
+ +
- - +