From 189b4573bca150be50771f9a38abb3655b98a9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=9C=D0=B0=D0=BB?= =?UTF-8?q?=D0=B0=D1=84=D0=B5=D0=B5=D0=B2?= Date: Tue, 28 May 2024 19:25:23 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BB=D0=B5=D0=B3=D0=B5=D0=BD=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=8F=D1=82=D1=8C=20=D1=81=D0=BE=D1=82=D0=B5=D0=BD=20?= =?UTF-8?q?=D0=B0=D0=B9=D0=BA=D1=8C=D1=8E=20=D0=BF=D0=BE=D1=87=D0=B8=D0=BD?= =?UTF-8?q?=D0=B8=D0=BB=D0=B0=20=D0=B2=D1=81=D1=91=20+=202=20=D1=81=D1=83?= =?UTF-8?q?=D1=89=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D1=84=D1=83=D0=BB=D0=BB?= =?UTF-8?q?=20=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/FeatureBindingModel.cs | 3 +- .../SearchModels/FeatureSearchModel.cs | 3 +- .../ViewModels/FeatureViewModel.cs | 3 +- .../Implements/BundlingStorage.cs | 2 +- .../Implements/FeatureStorage.cs | 4 +- ...20240528143805_InitialCreate3.Designer.cs} | 7 +- ...e2.cs => 20240528143805_InitialCreate3.cs} | 3 +- .../CarCenterDatabaseModelSnapshot.cs | 3 + .../Models/Feature.cs | 7 +- .../Controllers/HomeController.cs | 55 +++++++- .../StorekeeperData.cs | 119 ++++-------------- .../Views/Home/CreateFeature.cshtml | 83 ++++++++++++ .../Views/Home/FeatureCreate.cshtml | 46 ------- .../Views/Home/FeatureDelete.cshtml | 16 --- .../Views/Home/FeatureUpdate.cshtml | 52 -------- .../Views/Home/Features.cshtml | 60 --------- .../Views/Home/Index.cshtml | 3 +- .../Views/Home/IndexFeature.cshtml | 82 ++++++++++++ 18 files changed, 269 insertions(+), 282 deletions(-) rename CarCenter/CarCenterDatabaseImplement/Migrations/{20240528131936_InitialCreate2.Designer.cs => 20240528143805_InitialCreate3.Designer.cs} (98%) rename CarCenter/CarCenterDatabaseImplement/Migrations/{20240528131936_InitialCreate2.cs => 20240528143805_InitialCreate3.cs} (99%) create mode 100644 CarCenter/CarCenterStorekeeperApp/Views/Home/CreateFeature.cshtml delete mode 100644 CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureCreate.cshtml delete mode 100644 CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureDelete.cshtml delete mode 100644 CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureUpdate.cshtml delete mode 100644 CarCenter/CarCenterStorekeeperApp/Views/Home/Features.cshtml create mode 100644 CarCenter/CarCenterStorekeeperApp/Views/Home/IndexFeature.cshtml diff --git a/CarCenter/CarCenterContracts/BindingModels/FeatureBindingModel.cs b/CarCenter/CarCenterContracts/BindingModels/FeatureBindingModel.cs index d3dbf25..a0cd04e 100644 --- a/CarCenter/CarCenterContracts/BindingModels/FeatureBindingModel.cs +++ b/CarCenter/CarCenterContracts/BindingModels/FeatureBindingModel.cs @@ -11,7 +11,8 @@ namespace CarCenterContracts.BindingModels public class FeatureBindingModel : IFeatureModel { public int Id { get; set; } - public HelpDevices HelpDevice { get; set; } = HelpDevices.Неизвестно; + public int StorekeeperId { get; set; } + public HelpDevices HelpDevice { get; set; } = HelpDevices.Неизвестно; public string CabinColor { get; set; } = string.Empty; public DriveTypes DriveType { get; set; } = DriveTypes.Неизвестно; public double Price { get; set; } diff --git a/CarCenter/CarCenterContracts/SearchModels/FeatureSearchModel.cs b/CarCenter/CarCenterContracts/SearchModels/FeatureSearchModel.cs index b11b48f..c19b4e8 100644 --- a/CarCenter/CarCenterContracts/SearchModels/FeatureSearchModel.cs +++ b/CarCenter/CarCenterContracts/SearchModels/FeatureSearchModel.cs @@ -9,5 +9,6 @@ namespace CarCenterContracts.SearchModels public class FeatureSearchModel { public int? Id { get; set; } - } + public int? StorekeeperId { get; set; } + } } diff --git a/CarCenter/CarCenterContracts/ViewModels/FeatureViewModel.cs b/CarCenter/CarCenterContracts/ViewModels/FeatureViewModel.cs index 2e3bc94..fbafa6d 100644 --- a/CarCenter/CarCenterContracts/ViewModels/FeatureViewModel.cs +++ b/CarCenter/CarCenterContracts/ViewModels/FeatureViewModel.cs @@ -12,7 +12,8 @@ namespace CarCenterContracts.ViewModels public class FeatureViewModel : IFeatureModel { public int Id { get; set; } - [DisplayName("Вспомогательные устройства")] + public int StorekeeperId { get; set; } + [DisplayName("Вспомогательные устройства")] public HelpDevices HelpDevice { get; set; } [DisplayName("Цвет салона")] public string CabinColor { get; set; } = string.Empty; diff --git a/CarCenter/CarCenterDatabaseImplement/Implements/BundlingStorage.cs b/CarCenter/CarCenterDatabaseImplement/Implements/BundlingStorage.cs index 0cd8de1..c0584d6 100644 --- a/CarCenter/CarCenterDatabaseImplement/Implements/BundlingStorage.cs +++ b/CarCenter/CarCenterDatabaseImplement/Implements/BundlingStorage.cs @@ -27,7 +27,7 @@ namespace CarCenterDatabaseImplement.Implements { return context.Bundlings .Where(x => x.StorekeeperId == model.StorekeeperId) - .Select(x => x.GetViewModel) + .Select(x => x.GetViewModel) .ToList(); } return new(); diff --git a/CarCenter/CarCenterDatabaseImplement/Implements/FeatureStorage.cs b/CarCenter/CarCenterDatabaseImplement/Implements/FeatureStorage.cs index 01b24b0..632b60a 100644 --- a/CarCenter/CarCenterDatabaseImplement/Implements/FeatureStorage.cs +++ b/CarCenter/CarCenterDatabaseImplement/Implements/FeatureStorage.cs @@ -24,10 +24,10 @@ namespace CarCenterDatabaseImplement.Implements public List GetFilteredList(FeatureSearchModel model) { using var context = new CarCenterDatabase(); - if (model.Id.HasValue) + if (model.StorekeeperId.HasValue) { return context.Features - .Where(x => x.Id == model.Id) + .Where(x => x.StorekeeperId == model.StorekeeperId) .Select(x => x.GetViewModel) .ToList(); } diff --git a/CarCenter/CarCenterDatabaseImplement/Migrations/20240528131936_InitialCreate2.Designer.cs b/CarCenter/CarCenterDatabaseImplement/Migrations/20240528143805_InitialCreate3.Designer.cs similarity index 98% rename from CarCenter/CarCenterDatabaseImplement/Migrations/20240528131936_InitialCreate2.Designer.cs rename to CarCenter/CarCenterDatabaseImplement/Migrations/20240528143805_InitialCreate3.Designer.cs index 20edc6b..860192c 100644 --- a/CarCenter/CarCenterDatabaseImplement/Migrations/20240528131936_InitialCreate2.Designer.cs +++ b/CarCenter/CarCenterDatabaseImplement/Migrations/20240528143805_InitialCreate3.Designer.cs @@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace CarCenterDatabaseImplement.Migrations { [DbContext(typeof(CarCenterDatabase))] - [Migration("20240528131936_InitialCreate2")] - partial class InitialCreate2 + [Migration("20240528143805_InitialCreate3")] + partial class InitialCreate3 { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -146,6 +146,9 @@ namespace CarCenterDatabaseImplement.Migrations b.Property("Price") .HasColumnType("double precision"); + b.Property("StorekeeperId") + .HasColumnType("integer"); + b.HasKey("Id"); b.ToTable("Features"); diff --git a/CarCenter/CarCenterDatabaseImplement/Migrations/20240528131936_InitialCreate2.cs b/CarCenter/CarCenterDatabaseImplement/Migrations/20240528143805_InitialCreate3.cs similarity index 99% rename from CarCenter/CarCenterDatabaseImplement/Migrations/20240528131936_InitialCreate2.cs rename to CarCenter/CarCenterDatabaseImplement/Migrations/20240528143805_InitialCreate3.cs index 8be30c8..07524b5 100644 --- a/CarCenter/CarCenterDatabaseImplement/Migrations/20240528131936_InitialCreate2.cs +++ b/CarCenter/CarCenterDatabaseImplement/Migrations/20240528143805_InitialCreate3.cs @@ -6,7 +6,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace CarCenterDatabaseImplement.Migrations { - public partial class InitialCreate2 : Migration + public partial class InitialCreate3 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -33,6 +33,7 @@ namespace CarCenterDatabaseImplement.Migrations { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + StorekeeperId = table.Column(type: "integer", nullable: false), HelpDevice = table.Column(type: "integer", nullable: false), CabinColor = table.Column(type: "text", nullable: false), DriveType = table.Column(type: "integer", nullable: false), diff --git a/CarCenter/CarCenterDatabaseImplement/Migrations/CarCenterDatabaseModelSnapshot.cs b/CarCenter/CarCenterDatabaseImplement/Migrations/CarCenterDatabaseModelSnapshot.cs index 8fc8c39..87fc91f 100644 --- a/CarCenter/CarCenterDatabaseImplement/Migrations/CarCenterDatabaseModelSnapshot.cs +++ b/CarCenter/CarCenterDatabaseImplement/Migrations/CarCenterDatabaseModelSnapshot.cs @@ -144,6 +144,9 @@ namespace CarCenterDatabaseImplement.Migrations b.Property("Price") .HasColumnType("double precision"); + b.Property("StorekeeperId") + .HasColumnType("integer"); + b.HasKey("Id"); b.ToTable("Features"); diff --git a/CarCenter/CarCenterDatabaseImplement/Models/Feature.cs b/CarCenter/CarCenterDatabaseImplement/Models/Feature.cs index 2643656..4dbdea9 100644 --- a/CarCenter/CarCenterDatabaseImplement/Models/Feature.cs +++ b/CarCenter/CarCenterDatabaseImplement/Models/Feature.cs @@ -16,7 +16,8 @@ namespace CarCenterDatabaseImplement.Models public class Feature : IFeatureModel { public int Id { get; private set; } - [Required] + public int StorekeeperId { get; set; } + [Required] public HelpDevices HelpDevice { get; set; } = HelpDevices.Неизвестно; [Required] public string CabinColor { get; set; } = string.Empty; @@ -40,6 +41,7 @@ namespace CarCenterDatabaseImplement.Models CabinColor = model.CabinColor, DriveType = model.DriveType, Price = model.Price, + StorekeeperId = model.StorekeeperId, }; } public static Feature Create(FeatureViewModel model) @@ -47,6 +49,7 @@ namespace CarCenterDatabaseImplement.Models return new Feature { Id = model.Id, + StorekeeperId = model.StorekeeperId, HelpDevice = model.HelpDevice, CabinColor = model.CabinColor, DriveType = model.DriveType, @@ -59,6 +62,7 @@ namespace CarCenterDatabaseImplement.Models { return; } + StorekeeperId = model.StorekeeperId; HelpDevice = model.HelpDevice; CabinColor = model.CabinColor; DriveType = model.DriveType; @@ -67,6 +71,7 @@ namespace CarCenterDatabaseImplement.Models public FeatureViewModel GetViewModel => new() { Id = Id, + StorekeeperId = StorekeeperId, HelpDevice = HelpDevice, CabinColor = CabinColor, DriveType = DriveType, diff --git a/CarCenter/CarCenterStorekeeperApp/Controllers/HomeController.cs b/CarCenter/CarCenterStorekeeperApp/Controllers/HomeController.cs index c93ed8b..a26e7f0 100644 --- a/CarCenter/CarCenterStorekeeperApp/Controllers/HomeController.cs +++ b/CarCenter/CarCenterStorekeeperApp/Controllers/HomeController.cs @@ -112,12 +112,63 @@ namespace CarCenterStorekeeperApp.Controllers } else { - if (_data.UpdateBundling(model)) + model.StorekeeperId = UserStorekeeper.user!.Id; + if (_data.UpdateBundling(model)) return RedirectToAction("IndexBundling"); } return View(); } - [HttpGet] + + [HttpGet] + public IActionResult IndexFeature() + { + if (UserStorekeeper.user != null) + { + var list = _data.GetFeatures(UserStorekeeper.user.Id); + if (list != null) + return View(list); + return View(new List()); + } + return RedirectToAction("IndexNonReg"); + } + [HttpPost] + public void IndexFeature(int id) + { + if (UserStorekeeper.user != null) + { + _data.DeleteFeature(id); + } + Response.Redirect("IndexFeature"); + } + [HttpGet] + public IActionResult CreateFeature(int id) + { + if (id != 0) + { + var value = _data.GetFeature(id); + if (value != null) + return View(value); + } + return View(new FeatureViewModel()); + } + [HttpPost] + public IActionResult CreateFeature(FeatureBindingModel model) + { + if (model.Id == 0) + { + model.StorekeeperId = UserStorekeeper.user!.Id; + if (_data.CreateFeature(model)) + return RedirectToAction("IndexFeature"); + } + else + { + model.StorekeeperId = UserStorekeeper.user!.Id; + if (_data.UpdateFeature(model)) + return RedirectToAction("IndexFeature"); + } + return View(); + } + [HttpGet] public IActionResult Privacy() { if (IsLoggedIn) diff --git a/CarCenter/CarCenterStorekeeperApp/StorekeeperData.cs b/CarCenter/CarCenterStorekeeperApp/StorekeeperData.cs index e6d85ad..0b5bb09 100644 --- a/CarCenter/CarCenterStorekeeperApp/StorekeeperData.cs +++ b/CarCenter/CarCenterStorekeeperApp/StorekeeperData.cs @@ -11,20 +11,14 @@ namespace StorekeeperApp private readonly ILogger _logger; private readonly IStorekeeperLogic _storekeeperLogic; private readonly IBundlingLogic _bundlingLogic; -/* private readonly IProductionLogic _productionLogic; - private readonly IProductLogic _productLogic; - private readonly IMachineLogic _machineLogic; - private readonly IWorkshopLogic _workshopLogic;*/ + private readonly IFeatureLogic _featureLogic; - public StorekeeperData(ILogger logger, IStorekeeperLogic storekeeperLogic, IBundlingLogic bundlingLogic/* IProductionLogic productionLogic, IProductLogic productLogic, IMachineLogic machineLogic, IWorkshopLogic workshopLogic*/) + public StorekeeperData(ILogger logger, IStorekeeperLogic storekeeperLogic, IBundlingLogic bundlingLogic, IFeatureLogic featureLogic) { _logger = logger; _storekeeperLogic = storekeeperLogic; _bundlingLogic = bundlingLogic; -/* _productionLogic = productionLogic; - _productLogic = productLogic; - _machineLogic = machineLogic; - _workshopLogic = workshopLogic;*/ + _featureLogic = featureLogic; } public StorekeeperViewModel? Login(string email, string password) @@ -64,90 +58,27 @@ namespace StorekeeperApp { return _bundlingLogic.ReadElement(new() { Id = id }); } + public List? GetFeatures(int userId) + { + return _featureLogic.ReadList(new FeatureSearchModel() { StorekeeperId = userId }); + } + public bool DeleteFeature(int bundlingId) + { + return _featureLogic.Delete(new() { Id = bundlingId }); + } + public bool CreateFeature(FeatureBindingModel model) + { + return _featureLogic.Create(model); + } + public bool UpdateFeature(FeatureBindingModel model) + { + return _featureLogic.Update(model); + } + public FeatureViewModel? GetFeature(int id) + { + return _featureLogic.ReadElement(new() { Id = id }); + } + - /*public List? GetProducts(int userId) - { - return _productLogic.ReadList(new ProductSearchModel() { UserId = userId }); - } - public ProductViewModel? GetProduct(int id) - { - return _productLogic.ReadElement(new() { Id = id }); - } - public bool UpdateProduct(ProductBindingModel model) - { - return _productLogic.Update(model); - } - public bool DeleteProduct(int productId) - { - return _productLogic.Delete(new() { Id = productId }); - } - public bool CreateProduct(ProductBindingModel model) - { - return _productLogic.Create(model); - } - - public List? GetProductions(int userId) - { - return _productionLogic.ReadList(new() { UserId = userId }); - } - public ProductionViewModel? GetProduction(int id) - { - return _productionLogic.ReadElement(new() { Id = id }); - } - public bool CreateProduction(ProductionBindingModel model) - { - return _productionLogic.Create(model); - } - public bool UpdateProduction(ProductionBindingModel model) - { - return _productionLogic.Update(model); - } - public bool DeleteProduction(int productionId) - { - return _productionLogic.Delete(new() { Id = productionId }); - } - - public List? GetMachines() - { - return _machineLogic.ReadList(null); - } - - public List GetTimeReport(DateTime? startDate, DateTime? endDate, int UserId) - { - var bundlings = _bundlingLogic.ReadList(new() { DateFrom = startDate, DateTo = endDate, UserId = UserId }); - if (bundlings == null) - return new(); - List bundlingTimeReports = new List(); - foreach (var bundling in bundlings) - { - var report = new BundlingTimeReport(); - report.BundlingName = bundling.Name; - var products = _productLogic.ReadList(new() { BundlingId = bundling.Id, UserId = UserId }); - if (products != null) - report.Products = products.Select(p => p.Name).ToList(); - var productions = _productionLogic.ReadList(new() { BundlingId = bundling.Id, UserId = UserId }); - if (productions != null) - report.Productions = productions.Select(p => p.Name).ToList(); - bundlingTimeReports.Add(report); - } - return bundlingTimeReports; - } - - public List? GetWorkshopReports(List bundlings) - { - List reports = new(); - foreach (int i in bundlings) - { - BundlingWorkshopReportViewModel report = new(); - var bundling = _bundlingLogic.ReadElement(new() { Id = i }); - report.BundlingName = bundling!.Name; - var workshops = _workshopLogic.ReadList(new() { BundlingId = i }); - if (workshops != null) - report.WorkShops = workshops.Select(w => w.Title).ToList(); - reports.Add(report); - } - return reports; - }*/ - - } + } } diff --git a/CarCenter/CarCenterStorekeeperApp/Views/Home/CreateFeature.cshtml b/CarCenter/CarCenterStorekeeperApp/Views/Home/CreateFeature.cshtml new file mode 100644 index 0000000..255b8b9 --- /dev/null +++ b/CarCenter/CarCenterStorekeeperApp/Views/Home/CreateFeature.cshtml @@ -0,0 +1,83 @@ +@using CarCenterContracts.ViewModels; +@using CarCenterDataModels.Enums; + +@model FeatureViewModel; + +@{ + ViewData["Title"] = "CreateFeature"; +} +
+

Особенность

+
+
+ +
+
Вспомогательные устройства:
+
+ + +
+
+
+
Тип привода:
+
+ + +
+
+
+
Цвет салона:
+
+ + +
+
+
+
Цена:
+
+ + +
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureCreate.cshtml b/CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureCreate.cshtml deleted file mode 100644 index 9134aee..0000000 --- a/CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureCreate.cshtml +++ /dev/null @@ -1,46 +0,0 @@ -@using CarCenterContracts.ViewModels; -@using CarCenterDataModels.Enums; -@{ - ViewData["Title"] = "FeatureCreate"; -} - -
-

Создание особенности

-
- -
-
-
Вспомогательные устройства:
-
- -
-
-
-
Цвет салона:
-
-
-
-
Тип привода:
-
- -
-
-
-
Цена:
-
-
-
-
-
-
-
\ No newline at end of file diff --git a/CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureDelete.cshtml b/CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureDelete.cshtml deleted file mode 100644 index a67665a..0000000 --- a/CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureDelete.cshtml +++ /dev/null @@ -1,16 +0,0 @@ -@{ - ViewData["Title"] = "FeatureDelete"; -} -
-

Удалить особенность

-
-
-
-
- -
-
-
- -
-
\ No newline at end of file diff --git a/CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureUpdate.cshtml b/CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureUpdate.cshtml deleted file mode 100644 index 1b559b0..0000000 --- a/CarCenter/CarCenterStorekeeperApp/Views/Home/FeatureUpdate.cshtml +++ /dev/null @@ -1,52 +0,0 @@ - -@using CarCenterDataModels.Enums; -@{ - ViewData["Title"] = "FeatureUpdate"; -} - -
-

Обновление особенности

-
- -
-
-
Особенность
-
- -
-
-
-
Вспомогательные устройства:
-
- -
-
-
-
Цвет салона:
-
-
-
-
Тип привода:
-
- -
-
-
-
Цена:
-
-
-
-
-
-
-
\ No newline at end of file diff --git a/CarCenter/CarCenterStorekeeperApp/Views/Home/Features.cshtml b/CarCenter/CarCenterStorekeeperApp/Views/Home/Features.cshtml deleted file mode 100644 index c312c3b..0000000 --- a/CarCenter/CarCenterStorekeeperApp/Views/Home/Features.cshtml +++ /dev/null @@ -1,60 +0,0 @@ -@using CarCenterContracts.ViewModels; -@model List -@{ - ViewData["Title"] = "Features"; -} -
-

Особенность

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

Надо войти в аккаунт.

- return; - } -

- Создать особенность - Изменить особенность - Удалить особенность -

- - - - - - - - - - - - @foreach (var feature in Model) - { - - - - - - - } - -
- Вспомогательные устройства - - Цвет салона - - Тип привода - - Цена -
- @Html.DisplayFor(modelItem => feature.HelpDevice) - - @Html.DisplayFor(modelItem => feature.CabinColor) - - @Html.DisplayFor(modelItem => feature.DriveType) - - @Html.DisplayFor(modelItem => feature.Price) -
- } -
diff --git a/CarCenter/CarCenterStorekeeperApp/Views/Home/Index.cshtml b/CarCenter/CarCenterStorekeeperApp/Views/Home/Index.cshtml index c68796a..237ecfa 100644 --- a/CarCenter/CarCenterStorekeeperApp/Views/Home/Index.cshtml +++ b/CarCenter/CarCenterStorekeeperApp/Views/Home/Index.cshtml @@ -6,8 +6,7 @@

Главное меню

Комплектации - @* Изделия - Производства *@ + Особенности Личные данные @* Меню отчетов *@ Выйти diff --git a/CarCenter/CarCenterStorekeeperApp/Views/Home/IndexFeature.cshtml b/CarCenter/CarCenterStorekeeperApp/Views/Home/IndexFeature.cshtml new file mode 100644 index 0000000..77bd87d --- /dev/null +++ b/CarCenter/CarCenterStorekeeperApp/Views/Home/IndexFeature.cshtml @@ -0,0 +1,82 @@ +@using CarCenterContracts.ViewModels; + +@model List + +@{ + ViewData["Title"] = "Features"; +} + +
+

Особенности

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

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

+ return; + } +

+ Создать особенность +

+ + + + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + + + + } + +
+ Номер + + Вспомогательное устройтсво + + Цвет кабины + + Тип привода + + Цена + + Изменить изделие + + Удалить изделие +
+ @Html.DisplayFor(modelItem => item.Id) + + @Html.DisplayFor(modelItem => item.HelpDevice) + + @Html.DisplayFor(modelItem => item.CabinColor) + + @Html.DisplayFor(modelItem => item.DriveType) + + @Html.DisplayFor(modelItem => item.Price) + + Изменить + +
+ + +
+
+ } +
\ No newline at end of file