From 58f90fd353d54378348c22d75ed814d7709b0d46 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: Sun, 28 Apr 2024 11:34:35 +0400 Subject: [PATCH] ViewModels --- .../CarCenterContracts.csproj | 2 +- .../ViewModels/BundlingViewModel.cs | 24 +++++++++++++++ .../ViewModels/CarViewModel.cs | 30 +++++++++++++++++++ .../ViewModels/FeatureViewModel.cs | 24 +++++++++++++++ .../ViewModels/StorekeeperViewModel.cs | 27 +++++++++++++++++ 5 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 CarCenter/CarCenterContracts/ViewModels/BundlingViewModel.cs create mode 100644 CarCenter/CarCenterContracts/ViewModels/CarViewModel.cs create mode 100644 CarCenter/CarCenterContracts/ViewModels/FeatureViewModel.cs create mode 100644 CarCenter/CarCenterContracts/ViewModels/StorekeeperViewModel.cs diff --git a/CarCenter/CarCenterContracts/CarCenterContracts.csproj b/CarCenter/CarCenterContracts/CarCenterContracts.csproj index ac912f3..550335b 100644 --- a/CarCenter/CarCenterContracts/CarCenterContracts.csproj +++ b/CarCenter/CarCenterContracts/CarCenterContracts.csproj @@ -7,7 +7,7 @@ - + diff --git a/CarCenter/CarCenterContracts/ViewModels/BundlingViewModel.cs b/CarCenter/CarCenterContracts/ViewModels/BundlingViewModel.cs new file mode 100644 index 0000000..6ae3596 --- /dev/null +++ b/CarCenter/CarCenterContracts/ViewModels/BundlingViewModel.cs @@ -0,0 +1,24 @@ +using CarCenterDataModels.Enums; +using CarCenterDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CarCenterContracts.ViewModels +{ + public class BundlingViewModel : IBundlingModel + { + public int Id { get; set; } + [DisplayName("Пакет оборудования")] + public EquipmentPackage EquipmentPackage { get; set; } + [DisplayName("Пакет шин")] + public TirePackage TirePackage { get; set; } + [DisplayName("Пакет инструментов")] + public ToolKit ToolKit { get; set; } + [DisplayName("Цена")] + public double Price { get; set; } + } +} diff --git a/CarCenter/CarCenterContracts/ViewModels/CarViewModel.cs b/CarCenter/CarCenterContracts/ViewModels/CarViewModel.cs new file mode 100644 index 0000000..429ace7 --- /dev/null +++ b/CarCenter/CarCenterContracts/ViewModels/CarViewModel.cs @@ -0,0 +1,30 @@ +using CarCenterDataModels.Enums; +using CarCenterDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CarCenterContracts.ViewModels +{ + public class CarViewModel : ICarModel + { + public int Id { get; set; } + [DisplayName("Марка")] + public CarBrand CarBrand { get; set; } + [DisplayName("Модель")] + public string Model { get; set; } = string.Empty; + [DisplayName("Класс")] + public CarClass CarClass { get; set; } + [DisplayName("Год выпуска")] + public int Year { get; set; } + [DisplayName("Цена")] + public double Price { get; set; } + [DisplayName("VIN-номер")] + public long VINnumber { get; set; } + public int FeatureID { get; set; } + public Dictionary CarBundlings { get; set; } = new(); + } +} diff --git a/CarCenter/CarCenterContracts/ViewModels/FeatureViewModel.cs b/CarCenter/CarCenterContracts/ViewModels/FeatureViewModel.cs new file mode 100644 index 0000000..2e3bc94 --- /dev/null +++ b/CarCenter/CarCenterContracts/ViewModels/FeatureViewModel.cs @@ -0,0 +1,24 @@ +using CarCenterDataModels.Enums; +using CarCenterDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CarCenterContracts.ViewModels +{ + public class FeatureViewModel : IFeatureModel + { + public int Id { get; set; } + [DisplayName("Вспомогательные устройства")] + public HelpDevices HelpDevice { get; set; } + [DisplayName("Цвет салона")] + public string CabinColor { get; set; } = string.Empty; + [DisplayName("Тип привода")] + public DriveTypes DriveType { get; set; } + [DisplayName("Цена")] + public double Price { get; set; } + } +} diff --git a/CarCenter/CarCenterContracts/ViewModels/StorekeeperViewModel.cs b/CarCenter/CarCenterContracts/ViewModels/StorekeeperViewModel.cs new file mode 100644 index 0000000..5aa2c5c --- /dev/null +++ b/CarCenter/CarCenterContracts/ViewModels/StorekeeperViewModel.cs @@ -0,0 +1,27 @@ +using CarCenterDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CarCenterContracts.ViewModels +{ + public class StorekeeperViewModel : IStorekeeperModel + { + public int Id { get; set; } + [DisplayName("Имя")] + public string Name { get; set; } = string.Empty; + [DisplayName("Фамилия")] + public string Surname { get; set; } = string.Empty; + [DisplayName("Отчество")] + public string? Patronymic { get; set; } + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + [DisplayName("Почта")] + public string Email { get; set; } = string.Empty; + [DisplayName("Номер телефона")] + public long PhoneNumber { get; set; } + } +}