From 5f7f40f1a499f63d541d51395c137fa3f5e86aee Mon Sep 17 00:00:00 2001 From: maxnes3 <112558334+maxnes3@users.noreply.github.com> Date: Mon, 1 May 2023 22:55:10 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogics/DealLogic.cs | 117 ++++++++++++++++++ .../BusinessLogics/DepartmentLogic.cs | 103 +++++++++++++++ .../BusinessLogics/EmployeeLogic.cs | 109 ++++++++++++++++ .../BusinessLogics/PositionLogic.cs | 97 +++++++++++++++ .../BusinessLogics/TypeLogic.cs | 98 +++++++++++++++ .../PersonnelDepartmentBusinessLogic.csproj | 5 + .../PersonnelDepartmentContracts.csproj | 4 - .../SearchModels/DealSearchModel.cs | 6 +- .../SearchModels/DepartmentSearchModel.cs | 2 + .../StoragesContracts/IDealStorage.cs | 9 +- .../StoragesContracts/IDepartmentStorage.cs | 9 +- .../StoragesContracts/IEmployeeStorage.cs | 9 +- .../StoragesContracts/IPositionStorage.cs | 9 +- .../StoragesContracts/ITypeStorage.cs | 9 +- ...ersonnelDepartmentDatabaseImplement.csproj | 5 + .../PersonnelDepartmentView.sln | 12 ++ 16 files changed, 577 insertions(+), 26 deletions(-) create mode 100644 PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/DealLogic.cs create mode 100644 PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/DepartmentLogic.cs create mode 100644 PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/EmployeeLogic.cs create mode 100644 PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/PositionLogic.cs create mode 100644 PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/TypeLogic.cs diff --git a/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/DealLogic.cs b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/DealLogic.cs new file mode 100644 index 0000000..2260055 --- /dev/null +++ b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/DealLogic.cs @@ -0,0 +1,117 @@ +using PersonnelDepartmentContracts.BindingModels; +using PersonnelDepartmentContracts.BusinessLogicContracts; +using PersonnelDepartmentContracts.SearchModels; +using PersonnelDepartmentContracts.StoragesContracts; +using PersonnelDepartmentContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PersonnelDepartmentBusinessLogic.BusinessLogics +{ + public class DealLogic : IDealLogic + { + private readonly IDealStorage _dealStorage; + + public DealLogic(IDealStorage dealStorage) + { + _dealStorage = dealStorage ?? throw new ArgumentNullException(nameof(dealStorage)); + } + + public bool Create(DealBindingModel model) + { + CheckModel(model); + if (_dealStorage.Insert(model) == null) + { + return false; + } + return true; + } + + public bool Delete(DealBindingModel model) + { + CheckModel(model); + if (_dealStorage.Delete(model) == null) + { + return false; + } + return true; + } + + public DealViewModel? ReadElement(DealSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + var element = _dealStorage.GetElement(model); + if (element == null) + { + return null; + } + return element; + } + + public List? ReadList(DealSearchModel? model) + { + var list = model == null ? _dealStorage.GetFullList() : _dealStorage.GetFilteredList(model); + if (list == null) + { + return null; + } + return list; + } + + public bool Update(DealBindingModel model) + { + CheckModel(model); + if (_dealStorage.Update(model) == null) + { + return false; + } + return true; + } + + private void CheckModel(DealBindingModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (model.DepartmentId < 0) + { + throw new ArgumentNullException("Некорректный идентификатор отдела", + nameof(model.DepartmentId)); + } + if (model.EmployeeId < 0) + { + throw new ArgumentNullException("Некорректный идентификатор сотрудника", + nameof(model.EmployeeId)); + } + if (model.PositionId < 0) + { + throw new ArgumentNullException("Некорректный идентификатор должности", + nameof(model.PositionId)); + } + if (model.TypeId < 0) + { + throw new ArgumentNullException("Некорректный идентификатор типа договора", + nameof(model.TypeId)); + } + if (_dealStorage.GetElement(new DealSearchModel + { + DateFrom = model.DateFrom, + DateTo = model.DateTo, + DepartmentId = model.DepartmentId, + EmployeeId = model.EmployeeId, + PositionId = model.PositionId, + TypeId = model.TypeId + }) != null) + { + throw new InvalidOperationException("Договор с такими атрибутами уже есть"); + } + } + } +} diff --git a/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/DepartmentLogic.cs b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/DepartmentLogic.cs new file mode 100644 index 0000000..ec768e1 --- /dev/null +++ b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/DepartmentLogic.cs @@ -0,0 +1,103 @@ +using PersonnelDepartmentContracts.BindingModels; +using PersonnelDepartmentContracts.BusinessLogicContracts; +using PersonnelDepartmentContracts.SearchModels; +using PersonnelDepartmentContracts.StoragesContracts; +using PersonnelDepartmentContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PersonnelDepartmentBusinessLogic.BusinessLogics +{ + public class DepartmentLogic : IDepartmentLogic + { + private readonly IDepartmentStorage _departmentStorage; + + public DepartmentLogic(IDepartmentStorage departmentStorage) + { + _departmentStorage = departmentStorage ?? throw new ArgumentNullException(nameof(departmentStorage)); + } + + public bool Create(DepartmentBindingModel model) + { + CheckModel(model); + if (_departmentStorage.Insert(model) == null) + { + return false; + } + return true; + } + + public bool Delete(DepartmentBindingModel model) + { + CheckModel(model); + if (_departmentStorage.Delete(model) == null) + { + return false; + } + return true; + } + + public DepartmentViewModel? ReadElement(DepartmentSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + var element = _departmentStorage.GetElement(model); + if (element == null) + { + return null; + } + return element; + } + + public List? ReadList(DepartmentSearchModel? model) + { + var list = model == null ? _departmentStorage.GetFullList() : _departmentStorage.GetFilteredList(model); + if (list == null) + { + return null; + } + return list; + } + + public bool Update(DepartmentBindingModel model) + { + CheckModel(model); + if (_departmentStorage.Update(model) == null) + { + return false; + } + return true; + } + + private void CheckModel(DepartmentBindingModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (string.IsNullOrEmpty(model.Name)) + { + throw new ArgumentException("Отсутвует название", + nameof(model.Name)); + } + if (model.Telephone < 0) + { + throw new ArgumentException("Некоректный контактный телефон", + nameof(model.Telephone)); + } + if (_departmentStorage.GetElement(new DepartmentSearchModel + { + Name = model.Name, + Telephone = model.Telephone + }) != null) + { + throw new InvalidOperationException("Отдел с такими атрибутами уже есть"); + } + } + } +} diff --git a/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/EmployeeLogic.cs b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/EmployeeLogic.cs new file mode 100644 index 0000000..949f0c0 --- /dev/null +++ b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/EmployeeLogic.cs @@ -0,0 +1,109 @@ +using PersonnelDepartmentContracts.BindingModels; +using PersonnelDepartmentContracts.BusinessLogicContracts; +using PersonnelDepartmentContracts.SearchModels; +using PersonnelDepartmentContracts.StoragesContracts; +using PersonnelDepartmentContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PersonnelDepartmentBusinessLogic.BusinessLogics +{ + public class EmployeeLogic : IEmployeeLogic + { + private readonly IEmployeeStorage _employeeStorage; + + public EmployeeLogic(IEmployeeStorage employeeStorage) + { + _employeeStorage = employeeStorage ?? throw new ArgumentNullException(nameof(employeeStorage)); + } + + public bool Create(EmployeeBindingModel model) + { + CheckModel(model); + if (_employeeStorage.Insert(model) == null) + { + return false; + } + return true; + } + + public bool Delete(EmployeeBindingModel model) + { + CheckModel(model); + if (_employeeStorage.Delete(model) == null) + { + return false; + } + return true; + } + + public EmployeeViewModel? ReadElement(EmployeeSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + var element = _employeeStorage.GetElement(model); + if (element == null) + { + return null; + } + return element; + } + + public List? ReadList(EmployeeSearchModel? model) + { + var list = model == null ? _employeeStorage.GetFullList() : _employeeStorage.GetFilteredList(model); + if (list == null) + { + return null; + } + return list; + } + + public bool Update(EmployeeBindingModel model) + { + CheckModel(model); + if (_employeeStorage.Update(model) == null) + { + return false; + } + return true; + } + + private void CheckModel(EmployeeBindingModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (string.IsNullOrEmpty(model.FirstName)) + { + throw new ArgumentException("Отсутвует имя сотрудника", + nameof(model.FirstName)); + } + if (string.IsNullOrEmpty(model.LastName)) + { + throw new ArgumentException("Отсутвует фамилия сотрудника", + nameof(model.LastName)); + } + if (string.IsNullOrEmpty(model.Patronymic)) + { + throw new ArgumentException("Отсутвует отчество сотрудника", + nameof(model.Patronymic)); + } + if (_employeeStorage.GetElement(new EmployeeSearchModel + { + FirstName = model.FirstName, + LastName = model.LastName, + Patronymic = model.Patronymic + }) != null) + { + throw new InvalidOperationException("Сотрудник с такими атрибутами уже есть"); + } + } + } +} diff --git a/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/PositionLogic.cs b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/PositionLogic.cs new file mode 100644 index 0000000..72a3230 --- /dev/null +++ b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/PositionLogic.cs @@ -0,0 +1,97 @@ +using PersonnelDepartmentContracts.BindingModels; +using PersonnelDepartmentContracts.BusinessLogicContracts; +using PersonnelDepartmentContracts.SearchModels; +using PersonnelDepartmentContracts.StoragesContracts; +using PersonnelDepartmentContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PersonnelDepartmentBusinessLogic.BusinessLogics +{ + public class PositionLogic : IPositionLogic + { + private readonly IPositionStorage _positionStorage; + + public PositionLogic(IPositionStorage positionStorage) + { + _positionStorage = positionStorage ?? throw new ArgumentNullException(nameof(positionStorage)); + } + + public bool Create(PositionBindingModel model) + { + CheckModel(model); + if (_positionStorage.Insert(model) == null) + { + return false; + } + return true; + } + + public bool Delete(PositionBindingModel model) + { + CheckModel(model); + if (_positionStorage.Delete(model) == null) + { + return false; + } + return true; + } + + public PositionViewModel? ReadElement(PositionSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + var element = _positionStorage.GetElement(model); + if (element == null) + { + return null; + } + return element; + } + + public List? ReadList(PositionSearchModel? model) + { + var list = model == null ? _positionStorage.GetFullList() : _positionStorage.GetFilteredList(model); + if (list == null) + { + return null; + } + return list; + } + + public bool Update(PositionBindingModel model) + { + CheckModel(model); + if (_positionStorage.Update(model) == null) + { + return false; + } + return true; + } + + private void CheckModel(PositionBindingModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (string.IsNullOrEmpty(model.Name)) + { + throw new ArgumentException("Отсутвует имя сотрудника", + nameof(model.Name)); + } + if (_positionStorage.GetElement(new PositionSearchModel + { + Name = model.Name + }) != null) + { + throw new InvalidOperationException("Сотрудник с такими атрибутами уже есть"); + } + } + } +} diff --git a/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/TypeLogic.cs b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/TypeLogic.cs new file mode 100644 index 0000000..48a6c15 --- /dev/null +++ b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/BusinessLogics/TypeLogic.cs @@ -0,0 +1,98 @@ +using PersonnelDepartmentContracts.BindingModels; +using PersonnelDepartmentContracts.BusinessLogicContracts; +using PersonnelDepartmentContracts.SearchModels; +using PersonnelDepartmentContracts.StoragesContracts; +using PersonnelDepartmentContracts.ViewModels; +using PersonnelTypeContracts.StoragesContracts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PersonnelDepartmentBusinessLogic.BusinessLogics +{ + public class TypeLogic : ITypeLogic + { + private readonly ITypeStorage _typeStorage; + + public TypeLogic(ITypeStorage typeStorage) + { + _typeStorage = typeStorage ?? throw new ArgumentNullException(nameof(typeStorage)); + } + + public bool Create(TypeBindingModel model) + { + CheckModel(model); + if (_typeStorage.Insert(model) == null) + { + return false; + } + return true; + } + + public bool Delete(TypeBindingModel model) + { + CheckModel(model); + if (_typeStorage.Delete(model) == null) + { + return false; + } + return true; + } + + public TypeViewModel? ReadElement(TypeSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + var element = _typeStorage.GetElement(model); + if (element == null) + { + return null; + } + return element; + } + + public List? ReadList(TypeSearchModel? model) + { + var list = model == null ? _typeStorage.GetFullList() : _typeStorage.GetFilteredList(model); + if (list == null) + { + return null; + } + return list; + } + + public bool Update(TypeBindingModel model) + { + CheckModel(model); + if (_typeStorage.Update(model) == null) + { + return false; + } + return true; + } + + private void CheckModel(TypeBindingModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (string.IsNullOrEmpty(model.Name)) + { + throw new ArgumentException("Отсутвует имя сотрудника", + nameof(model.Name)); + } + if (_typeStorage.GetElement(new TypeSearchModel + { + Name = model.Name + }) != null) + { + throw new InvalidOperationException("Сотрудник с такими атрибутами уже есть"); + } + } + } +} diff --git a/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/PersonnelDepartmentBusinessLogic.csproj b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/PersonnelDepartmentBusinessLogic.csproj index 132c02c..441056a 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/PersonnelDepartmentBusinessLogic.csproj +++ b/PersonnelDepartmentView/PersonnelDepartmentBusinessLogic/PersonnelDepartmentBusinessLogic.csproj @@ -6,4 +6,9 @@ enable + + + + + diff --git a/PersonnelDepartmentView/PersonnelDepartmentContracts/PersonnelDepartmentContracts.csproj b/PersonnelDepartmentView/PersonnelDepartmentContracts/PersonnelDepartmentContracts.csproj index 6338db9..550831a 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentContracts/PersonnelDepartmentContracts.csproj +++ b/PersonnelDepartmentView/PersonnelDepartmentContracts/PersonnelDepartmentContracts.csproj @@ -10,8 +10,4 @@ - - - - diff --git a/PersonnelDepartmentView/PersonnelDepartmentContracts/SearchModels/DealSearchModel.cs b/PersonnelDepartmentView/PersonnelDepartmentContracts/SearchModels/DealSearchModel.cs index 5cc36ef..a204d92 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentContracts/SearchModels/DealSearchModel.cs +++ b/PersonnelDepartmentView/PersonnelDepartmentContracts/SearchModels/DealSearchModel.cs @@ -9,9 +9,11 @@ namespace PersonnelDepartmentContracts.SearchModels public class DealSearchModel { public int? Id { get; set; } - public DateTime? DateFrom { get; set; } - public DateTime? DateTo { get; set; } + public int? PositionId { get; set; } + public int? EmployeeId { get; set; } + public int? DepartmentId { get; set; } + public int? TypeId { get; set; } } } diff --git a/PersonnelDepartmentView/PersonnelDepartmentContracts/SearchModels/DepartmentSearchModel.cs b/PersonnelDepartmentView/PersonnelDepartmentContracts/SearchModels/DepartmentSearchModel.cs index 09a483f..0fbbcb0 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentContracts/SearchModels/DepartmentSearchModel.cs +++ b/PersonnelDepartmentView/PersonnelDepartmentContracts/SearchModels/DepartmentSearchModel.cs @@ -11,5 +11,7 @@ namespace PersonnelDepartmentContracts.SearchModels public int? Id { get; set; } public string? Name { get; set; } + + public int? Telephone { get; set; } } } diff --git a/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IDealStorage.cs b/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IDealStorage.cs index 0d63411..9428b61 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IDealStorage.cs +++ b/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IDealStorage.cs @@ -1,4 +1,5 @@ -using PersonnelDepartmentContracts.SearchModels; +using PersonnelDepartmentContracts.BindingModels; +using PersonnelDepartmentContracts.SearchModels; using PersonnelDepartmentContracts.ViewModels; using System; using System.Collections.Generic; @@ -13,8 +14,8 @@ namespace PersonnelDepartmentContracts.StoragesContracts List GetFullList(); List GetFilteredList(DealSearchModel model); DealViewModel? GetElement(DealSearchModel model); - DealViewModel? Insert(DealSearchModel model); - DealViewModel? Update(DealSearchModel model); - DealViewModel? Delete(DealSearchModel model); + DealViewModel? Insert(DealBindingModel model); + DealViewModel? Update(DealBindingModel model); + DealViewModel? Delete(DealBindingModel model); } } diff --git a/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IDepartmentStorage.cs b/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IDepartmentStorage.cs index e7f5e02..887fa33 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IDepartmentStorage.cs +++ b/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IDepartmentStorage.cs @@ -1,4 +1,5 @@ -using PersonnelDepartmentContracts.SearchModels; +using PersonnelDepartmentContracts.BindingModels; +using PersonnelDepartmentContracts.SearchModels; using PersonnelDepartmentContracts.ViewModels; using System; using System.Collections.Generic; @@ -13,8 +14,8 @@ namespace PersonnelDepartmentContracts.StoragesContracts List GetFullList(); List GetFilteredList(DepartmentSearchModel model); DepartmentViewModel? GetElement(DepartmentSearchModel model); - DepartmentViewModel? Insert(DepartmentSearchModel model); - DepartmentViewModel? Update(DepartmentSearchModel model); - DepartmentViewModel? Delete(DepartmentSearchModel model); + DepartmentViewModel? Insert(DepartmentBindingModel model); + DepartmentViewModel? Update(DepartmentBindingModel model); + DepartmentViewModel? Delete(DepartmentBindingModel model); } } diff --git a/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IEmployeeStorage.cs b/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IEmployeeStorage.cs index 3048eb5..9c469ca 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IEmployeeStorage.cs +++ b/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IEmployeeStorage.cs @@ -1,4 +1,5 @@ -using PersonnelDepartmentContracts.SearchModels; +using PersonnelDepartmentContracts.BindingModels; +using PersonnelDepartmentContracts.SearchModels; using PersonnelDepartmentContracts.ViewModels; using System; using System.Collections.Generic; @@ -13,8 +14,8 @@ namespace PersonnelDepartmentContracts.StoragesContracts List GetFullList(); List GetFilteredList(EmployeeSearchModel model); EmployeeViewModel? GetElement(EmployeeSearchModel model); - EmployeeViewModel? Insert(EmployeeSearchModel model); - EmployeeViewModel? Update(EmployeeSearchModel model); - EmployeeViewModel? Delete(EmployeeSearchModel model); + EmployeeViewModel? Insert(EmployeeBindingModel model); + EmployeeViewModel? Update(EmployeeBindingModel model); + EmployeeViewModel? Delete(EmployeeBindingModel model); } } diff --git a/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IPositionStorage.cs b/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IPositionStorage.cs index 24ee2d8..581f355 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IPositionStorage.cs +++ b/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/IPositionStorage.cs @@ -1,4 +1,5 @@ -using PersonnelDepartmentContracts.SearchModels; +using PersonnelDepartmentContracts.BindingModels; +using PersonnelDepartmentContracts.SearchModels; using PersonnelDepartmentContracts.ViewModels; using System; using System.Collections.Generic; @@ -13,8 +14,8 @@ namespace PersonnelDepartmentContracts.StoragesContracts List GetFullList(); List GetFilteredList(PositionSearchModel model); PositionViewModel? GetElement(PositionSearchModel model); - PositionViewModel? Insert(PositionSearchModel model); - PositionViewModel? Update(PositionSearchModel model); - PositionViewModel? Delete(PositionSearchModel model); + PositionViewModel? Insert(PositionBindingModel model); + PositionViewModel? Update(PositionBindingModel model); + PositionViewModel? Delete(PositionBindingModel model); } } diff --git a/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/ITypeStorage.cs b/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/ITypeStorage.cs index 195a4dd..9147ead 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/ITypeStorage.cs +++ b/PersonnelDepartmentView/PersonnelDepartmentContracts/StoragesContracts/ITypeStorage.cs @@ -1,4 +1,5 @@ -using PersonnelDepartmentContracts.SearchModels; +using PersonnelDepartmentContracts.BindingModels; +using PersonnelDepartmentContracts.SearchModels; using PersonnelDepartmentContracts.ViewModels; using System; using System.Collections.Generic; @@ -13,8 +14,8 @@ namespace PersonnelTypeContracts.StoragesContracts List GetFullList(); List GetFilteredList(TypeSearchModel model); TypeViewModel? GetElement(TypeSearchModel model); - TypeViewModel? Insert(TypeSearchModel model); - TypeViewModel? Update(TypeSearchModel model); - TypeViewModel? Delete(TypeSearchModel model); + TypeViewModel? Insert(TypeBindingModel model); + TypeViewModel? Update(TypeBindingModel model); + TypeViewModel? Delete(TypeBindingModel model); } } diff --git a/PersonnelDepartmentView/PersonnelDepartmentDatabaseImplement/PersonnelDepartmentDatabaseImplement.csproj b/PersonnelDepartmentView/PersonnelDepartmentDatabaseImplement/PersonnelDepartmentDatabaseImplement.csproj index 132c02c..f2d1325 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentDatabaseImplement/PersonnelDepartmentDatabaseImplement.csproj +++ b/PersonnelDepartmentView/PersonnelDepartmentDatabaseImplement/PersonnelDepartmentDatabaseImplement.csproj @@ -6,4 +6,9 @@ enable + + + + + diff --git a/PersonnelDepartmentView/PersonnelDepartmentView.sln b/PersonnelDepartmentView/PersonnelDepartmentView.sln index 0f29dd5..f6ff564 100644 --- a/PersonnelDepartmentView/PersonnelDepartmentView.sln +++ b/PersonnelDepartmentView/PersonnelDepartmentView.sln @@ -9,6 +9,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonnelDepartmentDataMode EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonnelDepartmentContracts", "PersonnelDepartmentContracts\PersonnelDepartmentContracts.csproj", "{9A959A51-26F5-4B67-B54E-CD271E12C944}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonnelDepartmentBusinessLogic", "PersonnelDepartmentBusinessLogic\PersonnelDepartmentBusinessLogic.csproj", "{2FF36159-F497-49BD-B18E-7E33504ED44E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonnelDepartmentDatabaseImplement", "PersonnelDepartmentDatabaseImplement\PersonnelDepartmentDatabaseImplement.csproj", "{347F10C9-CD2A-473D-AA4F-F1BAD304B396}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +31,14 @@ Global {9A959A51-26F5-4B67-B54E-CD271E12C944}.Debug|Any CPU.Build.0 = Debug|Any CPU {9A959A51-26F5-4B67-B54E-CD271E12C944}.Release|Any CPU.ActiveCfg = Release|Any CPU {9A959A51-26F5-4B67-B54E-CD271E12C944}.Release|Any CPU.Build.0 = Release|Any CPU + {2FF36159-F497-49BD-B18E-7E33504ED44E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FF36159-F497-49BD-B18E-7E33504ED44E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FF36159-F497-49BD-B18E-7E33504ED44E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FF36159-F497-49BD-B18E-7E33504ED44E}.Release|Any CPU.Build.0 = Release|Any CPU + {347F10C9-CD2A-473D-AA4F-F1BAD304B396}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {347F10C9-CD2A-473D-AA4F-F1BAD304B396}.Debug|Any CPU.Build.0 = Debug|Any CPU + {347F10C9-CD2A-473D-AA4F-F1BAD304B396}.Release|Any CPU.ActiveCfg = Release|Any CPU + {347F10C9-CD2A-473D-AA4F-F1BAD304B396}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE