From 73bed7238e3c2cdac780035506e78e15c1271318 Mon Sep 17 00:00:00 2001 From: abazov73 <92822431+abazov73@users.noreply.github.com> Date: Sun, 26 Mar 2023 19:14:28 +0400 Subject: [PATCH] Created project with contracts for construction company + naming fix in models projects --- ConstructionCompany/ConstructionCompany.sln | 10 ++++-- .../BindingModels/EmployeeBindingModel.cs | 18 ++++++++++ .../BindingModels/MaterialBindingModel.cs | 18 ++++++++++ .../BindingModels/OrderBindingModel.cs | 29 ++++++++++++++++ .../BindingModels/PositionBindingModel.cs | 18 ++++++++++ .../BusinessLogicContracts/IEmployeeModel.cs | 20 +++++++++++ .../BusinessLogicContracts/IMaterialLogic.cs | 20 +++++++++++ .../BusinessLogicContracts/IOrderLogic.cs | 20 +++++++++++ .../BusinessLogicContracts/IPositionLogic.cs | 20 +++++++++++ .../ConstructionCompanyContracts.csproj | 13 +++++++ .../SearchModels/EmployeeSearchModel.cs | 14 ++++++++ .../SearchModels/MaterialSearchModel.cs | 14 ++++++++ .../SearchModels/OrderSearchModel.cs | 13 +++++++ .../SearchModels/PositionSearchModel.cs | 14 ++++++++ .../StorageContracts/IEmployeeStorage.cs | 21 ++++++++++++ .../StorageContracts/IMaterialStorage.cs | 21 ++++++++++++ .../StorageContracts/IOrderStorage.cs | 21 ++++++++++++ .../StorageContracts/IPositionStorage.cs | 21 ++++++++++++ .../ViewModels/EmployeeViewModel.cs | 22 ++++++++++++ .../ViewModels/MaterialViewModel.cs | 19 +++++++++++ .../ViewModels/OrderViewModel.cs | 34 +++++++++++++++++++ .../ViewModels/PositionViewModel.cs | 19 +++++++++++ .../Models/IEmployeeModel.cs | 2 +- .../Models/IMaterialModel.cs | 2 +- .../Models/IOrderModel.cs | 4 +-- .../Models/IPositionModel.cs | 2 +- 26 files changed, 422 insertions(+), 7 deletions(-) create mode 100644 ConstructionCompany/ConstructionCompanyContracts/BindingModels/EmployeeBindingModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/BindingModels/MaterialBindingModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/BindingModels/OrderBindingModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/BindingModels/PositionBindingModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IEmployeeModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IMaterialLogic.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IOrderLogic.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IPositionLogic.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/ConstructionCompanyContracts.csproj create mode 100644 ConstructionCompany/ConstructionCompanyContracts/SearchModels/EmployeeSearchModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/SearchModels/MaterialSearchModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/SearchModels/OrderSearchModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/SearchModels/PositionSearchModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IEmployeeStorage.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IMaterialStorage.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IOrderStorage.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IPositionStorage.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/ViewModels/EmployeeViewModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/ViewModels/MaterialViewModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/ViewModels/OrderViewModel.cs create mode 100644 ConstructionCompany/ConstructionCompanyContracts/ViewModels/PositionViewModel.cs diff --git a/ConstructionCompany/ConstructionCompany.sln b/ConstructionCompany/ConstructionCompany.sln index 6590f9e..79d8a4e 100644 --- a/ConstructionCompany/ConstructionCompany.sln +++ b/ConstructionCompany/ConstructionCompany.sln @@ -3,9 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32825.248 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConstructionCompanyView", "ConstructionCompanyView\ConstructionCompanyView.csproj", "{E6C11D11-F20B-4A39-8FDA-82C75463ACBE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConstructionCompanyView", "ConstructionCompanyView\ConstructionCompanyView.csproj", "{E6C11D11-F20B-4A39-8FDA-82C75463ACBE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConstructionCompanyDataModels", "ConstructionCompanyDataModels\ConstructionCompanyDataModels.csproj", "{78CB5CC6-B587-41DD-B595-13138E6351C8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConstructionCompanyDataModels", "ConstructionCompanyDataModels\ConstructionCompanyDataModels.csproj", "{78CB5CC6-B587-41DD-B595-13138E6351C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConstructionCompanyContracts", "ConstructionCompanyContracts\ConstructionCompanyContracts.csproj", "{CFB66158-7025-4605-9739-C4A2F07D2EB6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,6 +23,10 @@ Global {78CB5CC6-B587-41DD-B595-13138E6351C8}.Debug|Any CPU.Build.0 = Debug|Any CPU {78CB5CC6-B587-41DD-B595-13138E6351C8}.Release|Any CPU.ActiveCfg = Release|Any CPU {78CB5CC6-B587-41DD-B595-13138E6351C8}.Release|Any CPU.Build.0 = Release|Any CPU + {CFB66158-7025-4605-9739-C4A2F07D2EB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFB66158-7025-4605-9739-C4A2F07D2EB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFB66158-7025-4605-9739-C4A2F07D2EB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFB66158-7025-4605-9739-C4A2F07D2EB6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ConstructionCompany/ConstructionCompanyContracts/BindingModels/EmployeeBindingModel.cs b/ConstructionCompany/ConstructionCompanyContracts/BindingModels/EmployeeBindingModel.cs new file mode 100644 index 0000000..c9afa1c --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/BindingModels/EmployeeBindingModel.cs @@ -0,0 +1,18 @@ +using ConstructionCompanyDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.BindingModels +{ + public class EmployeeBindingModel : IEmployeeModel + { + public string EmployeeName { get; set; } = string.Empty; + + public int PositionID { get; set; } + + public int Id {get; set; } + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/BindingModels/MaterialBindingModel.cs b/ConstructionCompany/ConstructionCompanyContracts/BindingModels/MaterialBindingModel.cs new file mode 100644 index 0000000..b015043 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/BindingModels/MaterialBindingModel.cs @@ -0,0 +1,18 @@ +using ConstructionCompanyDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.BindingModels +{ + public class MaterialBindingModel : IMaterialModel + { + public string MaterialName { get; set; } = string.Empty; + + public int Quantity { get; set; } + + public int Id { get; set; } + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/BindingModels/OrderBindingModel.cs b/ConstructionCompany/ConstructionCompanyContracts/BindingModels/OrderBindingModel.cs new file mode 100644 index 0000000..b8a3e6c --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/BindingModels/OrderBindingModel.cs @@ -0,0 +1,29 @@ +using ConstructionCompanyDataModels.Enums; +using ConstructionCompanyDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.BindingModels +{ + public class OrderBindingModel : IOrderModel + { + public string Description { get; set; } = string.Empty; + + public string Adress { get; set; } = string.Empty; + + public double Price => throw new NotImplementedException(); + + public OrderStatus Status => throw new NotImplementedException(); + + public string CustomerNumber { get; set; } = string.Empty; + + public DateTime DateBegin { get; set; } = DateTime.Now.Date; + + public DateTime? DateEnd { get; set; } + + public int Id { get; set; } + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/BindingModels/PositionBindingModel.cs b/ConstructionCompany/ConstructionCompanyContracts/BindingModels/PositionBindingModel.cs new file mode 100644 index 0000000..157f74f --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/BindingModels/PositionBindingModel.cs @@ -0,0 +1,18 @@ +using ConstructionCompanyDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.BindingModels +{ + public class PositionBindingModel : IPositionModel + { + public string PositionName { get; set; } = string.Empty; + + public double Salary { get; set; } + + public int Id { get; set; } + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IEmployeeModel.cs b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IEmployeeModel.cs new file mode 100644 index 0000000..2dfa3af --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IEmployeeModel.cs @@ -0,0 +1,20 @@ +using ConstructionCompanyContracts.BindingModels; +using ConstructionCompanyContracts.SearchModels; +using ConstructionCompanyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.BusinessLogicContracts +{ + public interface IEmployeeModel + { + List? ReadList(EmployeeSearchModel? model); + EmployeeViewModel? ReadElement(EmployeeSearchModel model); + bool Create(EmployeeBindingModel model); + bool Update(EmployeeBindingModel model); + bool Delete(EmployeeBindingModel model); + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IMaterialLogic.cs b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IMaterialLogic.cs new file mode 100644 index 0000000..4e3ea15 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IMaterialLogic.cs @@ -0,0 +1,20 @@ +using ConstructionCompanyContracts.BindingModels; +using ConstructionCompanyContracts.SearchModels; +using ConstructionCompanyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.BusinessLogicContracts +{ + public interface IMaterialLogic + { + List? ReadList(MaterialSearchModel? model); + MaterialViewModel? ReadElement(MaterialSearchModel model); + bool Create(MaterialBindingModel model); + bool Update(MaterialBindingModel model); + bool Delete(MaterialBindingModel model); + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IOrderLogic.cs b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IOrderLogic.cs new file mode 100644 index 0000000..72a32a0 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IOrderLogic.cs @@ -0,0 +1,20 @@ +using ConstructionCompanyContracts.BindingModels; +using ConstructionCompanyContracts.SearchModels; +using ConstructionCompanyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.BusinessLogicContracts +{ + public interface IOrderLogic + { + List? ReadList(OrderSearchModel? model); + OrderViewModel? ReadElement(OrderSearchModel model); + bool CreateOrder(OrderBindingModel model); + bool TakeOrderInWork(OrderBindingModel model); + bool FinishOrder(OrderBindingModel model); + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IPositionLogic.cs b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IPositionLogic.cs new file mode 100644 index 0000000..771bfe2 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/BusinessLogicContracts/IPositionLogic.cs @@ -0,0 +1,20 @@ +using ConstructionCompanyContracts.BindingModels; +using ConstructionCompanyContracts.SearchModels; +using ConstructionCompanyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.BusinessLogicContracts +{ + public interface IPositionLogic + { + List? ReadList(PositionSearchModel? model); + PositionViewModel? ReadElement(PositionSearchModel model); + bool Create(PositionBindingModel model); + bool Update(PositionBindingModel model); + bool Delete(PositionBindingModel model); + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/ConstructionCompanyContracts.csproj b/ConstructionCompany/ConstructionCompanyContracts/ConstructionCompanyContracts.csproj new file mode 100644 index 0000000..fe5ca8f --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/ConstructionCompanyContracts.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/ConstructionCompany/ConstructionCompanyContracts/SearchModels/EmployeeSearchModel.cs b/ConstructionCompany/ConstructionCompanyContracts/SearchModels/EmployeeSearchModel.cs new file mode 100644 index 0000000..08287f1 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/SearchModels/EmployeeSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.SearchModels +{ + public class EmployeeSearchModel + { + public int? Id { get; set; } + public string? EmployeeName { get; set; } + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/SearchModels/MaterialSearchModel.cs b/ConstructionCompany/ConstructionCompanyContracts/SearchModels/MaterialSearchModel.cs new file mode 100644 index 0000000..65766d7 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/SearchModels/MaterialSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.SearchModels +{ + public class MaterialSearchModel + { + public int? Id { get; set; } + public string? MaterialName { get; set; } + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/SearchModels/OrderSearchModel.cs b/ConstructionCompany/ConstructionCompanyContracts/SearchModels/OrderSearchModel.cs new file mode 100644 index 0000000..e441d2c --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/SearchModels/OrderSearchModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.SearchModels +{ + public class OrderSearchModel + { + public int? Id { get; set; } + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/SearchModels/PositionSearchModel.cs b/ConstructionCompany/ConstructionCompanyContracts/SearchModels/PositionSearchModel.cs new file mode 100644 index 0000000..cb3a020 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/SearchModels/PositionSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.SearchModels +{ + public class PositionSearchModel + { + public int? Id { get; set; } + public string? PositionName { get; set; } + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IEmployeeStorage.cs b/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IEmployeeStorage.cs new file mode 100644 index 0000000..822b84c --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IEmployeeStorage.cs @@ -0,0 +1,21 @@ +using ConstructionCompanyContracts.BindingModels; +using ConstructionCompanyContracts.SearchModels; +using ConstructionCompanyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.StorageContracts +{ + public interface IEmployeeStorage + { + List GetFullList(); + List GetFilteredList(EmployeeSearchModel model); + EmployeeViewModel? GetElement(EmployeeSearchModel model); + EmployeeViewModel? Insert(EmployeeBindingModel model); + EmployeeViewModel? Update(EmployeeBindingModel model); + EmployeeViewModel? Delete(EmployeeBindingModel model); + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IMaterialStorage.cs b/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IMaterialStorage.cs new file mode 100644 index 0000000..93d4f9d --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IMaterialStorage.cs @@ -0,0 +1,21 @@ +using ConstructionCompanyContracts.BindingModels; +using ConstructionCompanyContracts.SearchModels; +using ConstructionCompanyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.StorageContracts +{ + public interface IMaterialStorage + { + List GetFullList(); + List GetFilteredList(MaterialSearchModel model); + MaterialViewModel? GetElement(MaterialSearchModel model); + MaterialViewModel? Insert(MaterialBindingModel model); + MaterialViewModel? Update(MaterialBindingModel model); + MaterialViewModel? Delete(MaterialBindingModel model); + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IOrderStorage.cs b/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IOrderStorage.cs new file mode 100644 index 0000000..5c8b1a0 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IOrderStorage.cs @@ -0,0 +1,21 @@ +using ConstructionCompanyContracts.BindingModels; +using ConstructionCompanyContracts.SearchModels; +using ConstructionCompanyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.StorageContracts +{ + public interface IOrderStorage + { + List GetFullList(); + List GetFilteredList(OrderSearchModel model); + OrderViewModel? GetElement(OrderSearchModel model); + OrderViewModel? Insert(OrderBindingModel model); + OrderViewModel? Update(OrderBindingModel model); + OrderViewModel? Delete(OrderBindingModel model); + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IPositionStorage.cs b/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IPositionStorage.cs new file mode 100644 index 0000000..b6ba2d1 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/StorageContracts/IPositionStorage.cs @@ -0,0 +1,21 @@ +using ConstructionCompanyContracts.BindingModels; +using ConstructionCompanyContracts.SearchModels; +using ConstructionCompanyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.StorageContracts +{ + public interface IPositionStorage + { + List GetFullList(); + List GetFilteredList(PositionSearchModel model); + PositionViewModel? GetElement(PositionSearchModel model); + PositionViewModel? Insert(PositionBindingModel model); + PositionViewModel? Update(PositionBindingModel model); + PositionViewModel? Delete(PositionBindingModel model); + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/ViewModels/EmployeeViewModel.cs b/ConstructionCompany/ConstructionCompanyContracts/ViewModels/EmployeeViewModel.cs new file mode 100644 index 0000000..92c1bd0 --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/ViewModels/EmployeeViewModel.cs @@ -0,0 +1,22 @@ +using ConstructionCompanyDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.ViewModels +{ + public class EmployeeViewModel : IEmployeeModel + { + [DisplayName("ФИО")] + public string EmployeeName {get; set;} = string.Empty; + + public int PositionID {get; set;} + [DisplayName("Должность")] + public string PositionName { get; set;} = string.Empty; + + public int Id { get; set;} + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/ViewModels/MaterialViewModel.cs b/ConstructionCompany/ConstructionCompanyContracts/ViewModels/MaterialViewModel.cs new file mode 100644 index 0000000..82d5e7a --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/ViewModels/MaterialViewModel.cs @@ -0,0 +1,19 @@ +using ConstructionCompanyDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.ViewModels +{ + public class MaterialViewModel : IMaterialModel + { + [DisplayName("Название материала")] + public string MaterialName { get; set; } = string.Empty; + [DisplayName("Количество")] + public int Quantity {get; set; } + public int Id { get; set; } + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/ViewModels/OrderViewModel.cs b/ConstructionCompany/ConstructionCompanyContracts/ViewModels/OrderViewModel.cs new file mode 100644 index 0000000..a9fa24e --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/ViewModels/OrderViewModel.cs @@ -0,0 +1,34 @@ +using ConstructionCompanyDataModels.Enums; +using ConstructionCompanyDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.ViewModels +{ + public class OrderViewModel : IOrderModel + { + [DisplayName("Описание")] + public string Description {get;set;} = string.Empty; + [DisplayName("Адрес")] + public string Adress {get;set;} = string.Empty; + [DisplayName("Стоимость")] + public double Price { get; set; } + [DisplayName("Статус")] + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + [DisplayName("Телефон заказчика")] + public string CustomerNumber { get; set; } = string.Empty; + [DisplayName("Дата создания")] + public DateTime DateBegin { get; set; } = DateTime.Now.Date; + [DisplayName("Дата выполнения")] + public DateTime? DateEnd { get; set; } + [DisplayName("Номер")] + public int Id { get; set; } + + public Dictionary OrderEmployees { get; set; } = new(); + public Dictionary OrderMaterials { get; set; } = new(); + } +} diff --git a/ConstructionCompany/ConstructionCompanyContracts/ViewModels/PositionViewModel.cs b/ConstructionCompany/ConstructionCompanyContracts/ViewModels/PositionViewModel.cs new file mode 100644 index 0000000..bee78df --- /dev/null +++ b/ConstructionCompany/ConstructionCompanyContracts/ViewModels/PositionViewModel.cs @@ -0,0 +1,19 @@ +using ConstructionCompanyDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConstructionCompanyContracts.ViewModels +{ + public class PositionViewModel : IPositionModel + { + [DisplayName("Название должности")] + public string PositionName { get; set; } = string.Empty; + [DisplayName("Зарплата")] + public double Salary { get; set; } + public int Id { get; set; } + } +} diff --git a/ConstructionCompany/ConstructionCompanyDataModels/Models/IEmployeeModel.cs b/ConstructionCompany/ConstructionCompanyDataModels/Models/IEmployeeModel.cs index 9c5ff2b..8fea8d6 100644 --- a/ConstructionCompany/ConstructionCompanyDataModels/Models/IEmployeeModel.cs +++ b/ConstructionCompany/ConstructionCompanyDataModels/Models/IEmployeeModel.cs @@ -8,7 +8,7 @@ namespace ConstructionCompanyDataModels.Models { public interface IEmployeeModel : IId { - string Name { get; } + string EmployeeName { get; } int PositionID { get; } } } diff --git a/ConstructionCompany/ConstructionCompanyDataModels/Models/IMaterialModel.cs b/ConstructionCompany/ConstructionCompanyDataModels/Models/IMaterialModel.cs index fc2fab0..8e98284 100644 --- a/ConstructionCompany/ConstructionCompanyDataModels/Models/IMaterialModel.cs +++ b/ConstructionCompany/ConstructionCompanyDataModels/Models/IMaterialModel.cs @@ -8,7 +8,7 @@ namespace ConstructionCompanyDataModels.Models { public interface IMaterialModel : IId { - string Name { get; } + string MaterialName { get; } int Quantity { get; } } } diff --git a/ConstructionCompany/ConstructionCompanyDataModels/Models/IOrderModel.cs b/ConstructionCompany/ConstructionCompanyDataModels/Models/IOrderModel.cs index fe6d1b9..b7fa590 100644 --- a/ConstructionCompany/ConstructionCompanyDataModels/Models/IOrderModel.cs +++ b/ConstructionCompany/ConstructionCompanyDataModels/Models/IOrderModel.cs @@ -14,7 +14,7 @@ namespace ConstructionCompanyDataModels.Models double Price { get; } OrderStatus Status { get; } string CustomerNumber { get; } - DateOnly DateBegin { get; } - DateOnly? DateEnd { get; } + DateTime DateBegin { get; } + DateTime? DateEnd { get; } } } diff --git a/ConstructionCompany/ConstructionCompanyDataModels/Models/IPositionModel.cs b/ConstructionCompany/ConstructionCompanyDataModels/Models/IPositionModel.cs index 8b565cd..957fb4b 100644 --- a/ConstructionCompany/ConstructionCompanyDataModels/Models/IPositionModel.cs +++ b/ConstructionCompany/ConstructionCompanyDataModels/Models/IPositionModel.cs @@ -8,7 +8,7 @@ namespace ConstructionCompanyDataModels.Models { public interface IPositionModel : IId { - string Name { get; } + string PositionName { get; } double Salary { get; } } }