From f9c768037d3b63f6b7a794b324ba42d205f70e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=A4=D0=B5=D0=B4=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Mon, 29 Apr 2024 23:20:48 +0400 Subject: [PATCH] is done --- .../BindingModels/ProductBindingModel.cs | 2 - .../ViewModels/ProductViewModel.cs | 3 -- .../Models/Product.cs | 6 --- .../Models/IProductModel.cs | 1 - .../ElectronicsShopUserApp.csproj | 4 ++ .../Views/Home/CreateOrder.cshtml | 26 +++++++++++ .../Views/Home/CreateProduct.cshtml | 30 +++++++++++++ .../Views/Home/Enter.cshtml | 21 +++++++++ .../Views/Home/Index.cshtml | 44 +++++++++++++++++-- .../Views/Home/Privacy.cshtml | 36 ++++++++++++--- .../Views/Home/Register.cshtml | 25 +++++++++++ .../Views/Shared/_Layout.cshtml | 12 +++-- 12 files changed, 186 insertions(+), 24 deletions(-) create mode 100644 ElectronicsShop/ElectronicsShopUserApp/Views/Home/CreateOrder.cshtml create mode 100644 ElectronicsShop/ElectronicsShopUserApp/Views/Home/CreateProduct.cshtml create mode 100644 ElectronicsShop/ElectronicsShopUserApp/Views/Home/Enter.cshtml create mode 100644 ElectronicsShop/ElectronicsShopUserApp/Views/Home/Register.cshtml diff --git a/ElectronicsShop/ElectronicsShopContracts/BindingModels/ProductBindingModel.cs b/ElectronicsShop/ElectronicsShopContracts/BindingModels/ProductBindingModel.cs index eb513f6..8987b09 100644 --- a/ElectronicsShop/ElectronicsShopContracts/BindingModels/ProductBindingModel.cs +++ b/ElectronicsShop/ElectronicsShopContracts/BindingModels/ProductBindingModel.cs @@ -18,7 +18,5 @@ namespace ElectronicsShopContracts.BindingModels public string ProductName { get; set; } = string.Empty; public double Price { get; set; } - - public int Count { get; set; } } } diff --git a/ElectronicsShop/ElectronicsShopContracts/ViewModels/ProductViewModel.cs b/ElectronicsShop/ElectronicsShopContracts/ViewModels/ProductViewModel.cs index 45b9583..600d70d 100644 --- a/ElectronicsShop/ElectronicsShopContracts/ViewModels/ProductViewModel.cs +++ b/ElectronicsShop/ElectronicsShopContracts/ViewModels/ProductViewModel.cs @@ -20,8 +20,5 @@ namespace ElectronicsShopContracts.ViewModels [DisplayName("Цена")] public double Price { get; set; } - - [DisplayName("Количество")] - public int Count { get; set; } } } diff --git a/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Product.cs b/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Product.cs index b46ce43..9bcbbfe 100644 --- a/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Product.cs +++ b/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Product.cs @@ -18,8 +18,6 @@ namespace ElectronicsShopDataBaseImplement.Models [Required] public double Price { get; set; } [Required] - public int Count { get; set; } - [Required] public int CategoryID { get; set; } public static Product? Create(ProductBindingModel? model) @@ -33,7 +31,6 @@ namespace ElectronicsShopDataBaseImplement.Models ID = model.ID, ProductName = model.ProductName, Price = model.Price, - Count = model.Count, CategoryID = model.CategoryID }; } @@ -44,7 +41,6 @@ namespace ElectronicsShopDataBaseImplement.Models ID = model.ID, ProductName = model.ProductName, Price = model.Price, - Count = model.Count, CategoryID = model.CategoryID }; } @@ -56,7 +52,6 @@ namespace ElectronicsShopDataBaseImplement.Models } ProductName = model.ProductName; Price = model.Price; - Count = model.Count; CategoryID = model.CategoryID; } @@ -65,7 +60,6 @@ namespace ElectronicsShopDataBaseImplement.Models ID = ID, ProductName = ProductName, Price = Price, - Count = Count, CategoryID = CategoryID }; } diff --git a/ElectronicsShop/ElectronicsShopDataModels/Models/IProductModel.cs b/ElectronicsShop/ElectronicsShopDataModels/Models/IProductModel.cs index e198057..49a4ae1 100644 --- a/ElectronicsShop/ElectronicsShopDataModels/Models/IProductModel.cs +++ b/ElectronicsShop/ElectronicsShopDataModels/Models/IProductModel.cs @@ -10,7 +10,6 @@ namespace ElectronicsShopDataModels.Models { string ProductName { get; } double Price { get; } - int Count { get; } int CategoryID { get; } } } diff --git a/ElectronicsShop/ElectronicsShopUserApp/ElectronicsShopUserApp.csproj b/ElectronicsShop/ElectronicsShopUserApp/ElectronicsShopUserApp.csproj index 1b28a01..1d67280 100644 --- a/ElectronicsShop/ElectronicsShopUserApp/ElectronicsShopUserApp.csproj +++ b/ElectronicsShop/ElectronicsShopUserApp/ElectronicsShopUserApp.csproj @@ -6,4 +6,8 @@ enable + + + + diff --git a/ElectronicsShop/ElectronicsShopUserApp/Views/Home/CreateOrder.cshtml b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/CreateOrder.cshtml new file mode 100644 index 0000000..9613372 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/CreateOrder.cshtml @@ -0,0 +1,26 @@ +@{ + ViewData["Title"] = "Create"; +} +
+

Создание заказа

+
+
+ +
+
Продукт:
+
+
+
+
Количество:
+
+
+
+
Сумма:
+
+
+
+
+
+
+
+
diff --git a/ElectronicsShop/ElectronicsShopUserApp/Views/Home/CreateProduct.cshtml b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/CreateProduct.cshtml new file mode 100644 index 0000000..9d9f90d --- /dev/null +++ b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/CreateProduct.cshtml @@ -0,0 +1,30 @@ +@{ + ViewData["Title"] = "Create"; +} +
+

Создание Товара

+
+
+
+
Товар:
+
+ +
+
+
+
+
+
+
+
Сумма:
+
+
+
+
Сумма:
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Enter.cshtml b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Enter.cshtml new file mode 100644 index 0000000..106d3d5 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Enter.cshtml @@ -0,0 +1,21 @@ +@{ + ViewData["Title"] = "Enter"; +} + +
+

Вход в приложение

+
+
+
+
Логин:
+
+
+
+
Пароль:
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Index.cshtml b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Index.cshtml index bcfd79a..bee4982 100644 --- a/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Index.cshtml +++ b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Index.cshtml @@ -1,8 +1,44 @@ -@{ - ViewData["Title"] = "Home Page"; +@using ElectronicsShopContracts.ViewModels + +@model List + +@{ + ViewData["Title"] = "Home Page"; }
-

Welcome

-

Learn about building Web apps with ASP.NET Core.

+

Заказы

+
+ + +
+ @{ + if (Model == null) { +

Авторизируйтесь

+ return; + } +

+ Создать заказ +

+ + + + + + + + + + + +
+ Номер + + категория товара + + название + + цена +
+ }
diff --git a/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Privacy.cshtml b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Privacy.cshtml index af4fb19..bfd0647 100644 --- a/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Privacy.cshtml +++ b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Privacy.cshtml @@ -1,6 +1,32 @@ -@{ - ViewData["Title"] = "Privacy Policy"; -} -

@ViewData["Title"]

+@using ElectronicsShopContracts.ViewModels -

Use this page to detail your site's privacy policy.

+@model UserViewModel + +@{ + ViewData["Title"] = "Privacy Policy"; +} +
+

Личные данные

+
+
+
+
Логин:
+
+
+
+
Пароль:
+
+
+
+
Пароль:
+
+
+
+
логин:
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Register.cshtml b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Register.cshtml new file mode 100644 index 0000000..77fe64e --- /dev/null +++ b/ElectronicsShop/ElectronicsShopUserApp/Views/Home/Register.cshtml @@ -0,0 +1,25 @@ +@{ + ViewData["Title"] = "Register"; +} + +
+

Регистрация

+
+
+
+
Логин:
+
+
+
+
Пароль:
+
+
+
+
ФИО:
+
+
+
+
+
+
+
diff --git a/ElectronicsShop/ElectronicsShopUserApp/Views/Shared/_Layout.cshtml b/ElectronicsShop/ElectronicsShopUserApp/Views/Shared/_Layout.cshtml index c38e850..2c641a0 100644 --- a/ElectronicsShop/ElectronicsShopUserApp/Views/Shared/_Layout.cshtml +++ b/ElectronicsShop/ElectronicsShopUserApp/Views/Shared/_Layout.cshtml @@ -17,13 +17,19 @@ aria-expanded="false" aria-label="Toggle navigation"> -