рефакторинг, добавлен проект контрактов, применено к безопасности

This commit is contained in:
kotcheshir73 2022-03-19 19:58:10 +04:00
parent 513c14b73d
commit 07060426c4
96 changed files with 653 additions and 419 deletions

View File

@ -11,7 +11,7 @@ using System.Linq;
namespace CoreDatabase
{
public abstract class AbstractGenerticEntityService<G, S, T, L, E> : IGenerticEntityService<G, S>
public abstract class AbstractGenerticEntityService<G, S, T, L, E> : IGenericEntityService<G, S>
where G : GetBindingModel
where S : SetBindingModel
where T : BaseEntity

View File

@ -1,4 +1,9 @@
using ToolsDesktop.BaseControls;
using System;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using System.Xml.Linq;
using ToolsDesktop.BaseControls;
using ToolsDesktop.Enums;
using ToolsDesktop.Helpers;
using ToolsDesktop.Interfaces;
@ -8,13 +13,8 @@ using ToolsModule.BindingModels;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using ToolsModule.Extensions;
using ToolsModule.Interfaces;
using ToolsModule.ViewModels;
using System;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ToolsDesktop.Controls
{
@ -23,7 +23,7 @@ namespace ToolsDesktop.Controls
where S : SetBindingModel, new()
where L : ListViewModel<E>
where E : ElementViewModel
where BL : GenericBusinessLogic<G, S, L, E>
where BL : IGenericEntityLogic<G, S, L, E>
{
/// <summary>
/// Объект бизнес-логики для получения данных

View File

@ -1,4 +1,10 @@
using ToolsDesktop.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using System.Xml.Linq;
using ToolsDesktop.Enums;
using ToolsDesktop.Helpers;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
@ -7,13 +13,8 @@ using ToolsModule.BindingModels;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using ToolsModule.Extensions;
using ToolsModule.Interfaces;
using ToolsModule.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using System.Xml.Linq;
namespace ToolsDesktop.Controls
{
@ -22,7 +23,7 @@ namespace ToolsDesktop.Controls
where S : SetBindingModel, new()
where L : ListViewModel<E>
where E : ElementViewModel
where BL : GenericBusinessLogic<G, S, L, E>
where BL : IGenericEntityLogic<G, S, L, E>
{
/// <summary>
/// Режим работы

View File

@ -13,7 +13,7 @@ namespace ToolsModule.BusinessLogics
/// <typeparam name="S"></typeparam>
/// <typeparam name="L"></typeparam>
/// <typeparam name="E"></typeparam>
public class GenericBusinessLogic<G, S, L, E> : CoreBusinessLogic
public class GenericBusinessLogic<G, S, L, E> : CoreBusinessLogic, IGenericEntityLogic<G, S, L, E>
where G : GetBindingModel
where S : SetBindingModel
where L : ListViewModel<E>
@ -22,14 +22,14 @@ namespace ToolsModule.BusinessLogics
/// <summary>
/// Сервис с хранилищем данных
/// </summary>
protected IGenerticEntityService<G, S> Service { get; set; }
protected IGenericEntityService<G, S> Service { get; set; }
/// <summary>
/// Возможен ли просмотр без авторизации
/// </summary>
protected bool _allowSimpleView = true;
public GenericBusinessLogic(IGenerticEntityService<G, S> service, string entity, AccessOperation serviceOperation)
public GenericBusinessLogic(IGenericEntityService<G, S> service, string entity, AccessOperation serviceOperation)
{
Service = service;
_entity = entity;

View File

@ -0,0 +1,12 @@
using System.Collections.Generic;
namespace ToolsModule.Interfaces
{
public interface IErrors
{
/// <summary>
/// Перечень ошибок при выполнении операции
/// </summary>
List<(string Title, string Message)> Errors { get; }
}
}

View File

@ -0,0 +1,61 @@
using ToolsModule.BindingModels;
using ToolsModule.ViewModels;
namespace ToolsModule.Interfaces
{
/// <summary>
/// Описание действий для логики сущности
/// </summary>
/// <typeparam name="G"></typeparam>
/// <typeparam name="S"></typeparam>
/// <typeparam name="L"></typeparam>
/// <typeparam name="E"></typeparam>
public interface IGenericEntityLogic<G, S, L, E> : IErrors
where G : GetBindingModel
where S : SetBindingModel
where L : ListViewModel<E>
where E : ElementViewModel
{
/// <summary>
/// Получение списка записей
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
L GetList(G model);
/// <summary>
/// Получение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
E GetElement(G model);
/// <summary>
/// Создание записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
E Create(S model);
/// <summary>
/// Изменение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
E Update(S model);
/// <summary>
/// Удаление записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool Delete(G model);
/// <summary>
/// Восстанолвение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
E Restore(G model);
}
}

View File

@ -4,9 +4,9 @@ using ToolsModule.Models;
namespace ToolsModule.Interfaces
{
/// <summary>
/// Описание логики для хранилища сущности
/// Описание действий для хранилища сущности
/// </summary>
public interface IGenerticEntityService<G, S>
public interface IGenericEntityService<G, S>
where G : GetBindingModel
where S : SetBindingModel
{

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение записей учебного плана
/// </summary>
public interface IAcademicPlanRecordService : IGenerticEntityService<AcademicPlanRecordGetBindingModel, AcademicPlanRecordSetBindingModel> { }
public interface IAcademicPlanRecordService : IGenericEntityService<AcademicPlanRecordGetBindingModel, AcademicPlanRecordSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение часов нагрузки записи чебного плана
/// </summary>
public interface IAcademicPlanRecordTimeNormHourService : IGenerticEntityService<AcademicPlanRecordTimeNormHourGetBindingModel, AcademicPlanRecordTimeNormHourSetBindingModel> { }
public interface IAcademicPlanRecordTimeNormHourService : IGenericEntityService<AcademicPlanRecordTimeNormHourGetBindingModel, AcademicPlanRecordTimeNormHourSetBindingModel> { }
}

View File

@ -7,7 +7,7 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение учебных планов
/// </summary>
public interface IAcademicPlanService : IGenerticEntityService<AcademicPlanGetBindingModel, AcademicPlanSetBindingModel>
public interface IAcademicPlanService : IGenericEntityService<AcademicPlanGetBindingModel, AcademicPlanSetBindingModel>
{
/// <summary>
/// Загрузка учебного плана

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение аудиторий
/// </summary>
public interface IClassroomService : IGenerticEntityService<ClassroomGetBindingModel, ClassroomSetBindingModel> { }
public interface IClassroomService : IGenericEntityService<ClassroomGetBindingModel, ClassroomSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение блоков дисциплин
/// </summary>
public interface IDisciplineBlockService : IGenerticEntityService<DisciplineBlockGetBindingModel, DisciplineBlockSetBindingModel> { }
public interface IDisciplineBlockService : IGenericEntityService<DisciplineBlockGetBindingModel, DisciplineBlockSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение дисциплин
/// </summary>
public interface IDisciplineService : IGenerticEntityService<DisciplineGetBindingModel, DisciplineSetBindingModel> { }
public interface IDisciplineService : IGenericEntityService<DisciplineGetBindingModel, DisciplineSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение нправлений обучений
/// </summary>
public interface IEducationDirectionService : IGenerticEntityService<EducationDirectionGetBindingModel, EducationDirectionSetBindingModel> { }
public interface IEducationDirectionService : IGenericEntityService<EducationDirectionGetBindingModel, EducationDirectionSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение связей сотрудников и должностей
/// </summary>
public interface IEmployeePostService : IGenerticEntityService<EmployeePostGetBindingModel, EmployeePostSetBindingModel> { }
public interface IEmployeePostService : IGenericEntityService<EmployeePostGetBindingModel, EmployeePostSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение сотрудников
/// </summary>
public interface IEmployeeService : IGenerticEntityService<EmployeeGetBindingModel, EmployeeSetBindingModel> { }
public interface IEmployeeService : IGenericEntityService<EmployeeGetBindingModel, EmployeeSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение ученых степеней преподавателей
/// </summary>
public interface ILecturerAcademicDegreeService : IGenerticEntityService<LecturerAcademicDegreeGetBindingModel, LecturerAcademicDegreeSetBindingModel> { }
public interface ILecturerAcademicDegreeService : IGenericEntityService<LecturerAcademicDegreeGetBindingModel, LecturerAcademicDegreeSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение ученых званий преподавателей
/// </summary>
public interface ILecturerAcademicRankService : IGenerticEntityService<LecturerAcademicRankGetBindingModel, LecturerAcademicRankSetBindingModel> { }
public interface ILecturerAcademicRankService : IGenericEntityService<LecturerAcademicRankGetBindingModel, LecturerAcademicRankSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение должностей преподавателей
/// </summary>
public interface ILecturerPostService : IGenerticEntityService<LecturerPostGetBindingModel, LecturerPostSetBindingModel> { }
public interface ILecturerPostService : IGenericEntityService<LecturerPostGetBindingModel, LecturerPostSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение преподавателей
/// </summary>
public interface ILecturerService : IGenerticEntityService<LecturerGetBindingModel, LecturerSetBindingModel> { }
public interface ILecturerService : IGenericEntityService<LecturerGetBindingModel, LecturerSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение приказов
/// </summary>
public interface IOrderService : IGenerticEntityService<OrderGetBindingModel, OrderSetBindingModel> { }
public interface IOrderService : IGenericEntityService<OrderGetBindingModel, OrderSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение записей приказов по студентам
/// </summary>
public interface IOrderStudentRecordService : IGenerticEntityService<OrderStudentRecordGetBindingModel, OrderStudentRecordSetBindingModel> { }
public interface IOrderStudentRecordService : IGenericEntityService<OrderStudentRecordGetBindingModel, OrderStudentRecordSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение записей историй синхронизации приказов
/// </summary>
public interface IOrderSyncHistoryRecordService : IGenerticEntityService<OrderSyncHistoryRecordGetBindingModel, OrderSyncHistoryRecordSetBindingModel> { }
public interface IOrderSyncHistoryRecordService : IGenericEntityService<OrderSyncHistoryRecordGetBindingModel, OrderSyncHistoryRecordSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение историй синхронизации приказов
/// </summary>
public interface IOrderSyncHistoryService : IGenerticEntityService<OrderSyncHistoryGetBindingModel, OrderSyncHistorySetBindingModel> { }
public interface IOrderSyncHistoryService : IGenericEntityService<OrderSyncHistoryGetBindingModel, OrderSyncHistorySetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение должностей
/// </summary>
public interface IPostService : IGenerticEntityService<PostGetBindingModel, PostSetBindingModel> { }
public interface IPostService : IGenericEntityService<PostGetBindingModel, PostSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение учебных групп
/// </summary>
public interface IStudentGroupService : IGenerticEntityService<StudentGroupGetBindingModel, StudentGroupSetBindingModel> { }
public interface IStudentGroupService : IGenericEntityService<StudentGroupGetBindingModel, StudentGroupSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение студентов
/// </summary>
public interface IStudentService : IGenerticEntityService<StudentGetBindingModel, StudentSetBindingModel> { }
public interface IStudentService : IGenericEntityService<StudentGetBindingModel, StudentSetBindingModel> { }
}

View File

@ -6,5 +6,5 @@ namespace DepartmentBusinessLogic.Interfaces
/// <summary>
/// Хранение норм времени
/// </summary>
public interface ITimeNormService : IGenerticEntityService<TimeNormGetBindingModel, TimeNormSetBindingModel> { }
public interface ITimeNormService : IGenericEntityService<TimeNormGetBindingModel, TimeNormSetBindingModel> { }
}

View File

@ -25,11 +25,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DepartmentWindowsDesktop",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreModels", "Common\CoreModels\CoreModels.csproj", "{FDF81413-ABAD-4890-A60F-4FEC62DD2A7D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolsModule", "Common\ToolsModule\ToolsModule.csproj", "{26F68044-DA58-4E85-ACD7-FCC0B52B422B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ToolsModule", "Common\ToolsModule\ToolsModule.csproj", "{26F68044-DA58-4E85-ACD7-FCC0B52B422B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolsDesktop", "Common\ToolsDesktop\ToolsDesktop.csproj", "{FF2FD244-613D-4BE7-A6D6-6B71A45C662E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ToolsDesktop", "Common\ToolsDesktop\ToolsDesktop.csproj", "{FF2FD244-613D-4BE7-A6D6-6B71A45C662E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreDatabase", "Common\CoreDatabase\CoreDatabase.csproj", "{C2AADB97-4122-48AB-9E48-6C2A9C33BFE4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreDatabase", "Common\CoreDatabase\CoreDatabase.csproj", "{C2AADB97-4122-48AB-9E48-6C2A9C33BFE4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecurityContract", "Security\SecurityContract\SecurityContract.csproj", "{E9F9B0D8-18F3-40C3-843F-53D2F8B2293E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -81,6 +83,10 @@ Global
{C2AADB97-4122-48AB-9E48-6C2A9C33BFE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2AADB97-4122-48AB-9E48-6C2A9C33BFE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2AADB97-4122-48AB-9E48-6C2A9C33BFE4}.Release|Any CPU.Build.0 = Release|Any CPU
{E9F9B0D8-18F3-40C3-843F-53D2F8B2293E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9F9B0D8-18F3-40C3-843F-53D2F8B2293E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9F9B0D8-18F3-40C3-843F-53D2F8B2293E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9F9B0D8-18F3-40C3-843F-53D2F8B2293E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -96,6 +102,7 @@ Global
{26F68044-DA58-4E85-ACD7-FCC0B52B422B} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E}
{FF2FD244-613D-4BE7-A6D6-6B71A45C662E} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E}
{C2AADB97-4122-48AB-9E48-6C2A9C33BFE4} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E}
{E9F9B0D8-18F3-40C3-843F-53D2F8B2293E} = {7DA26C36-778E-4563-9AEC-966E26EA7B2A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FBA0CB49-EF2D-4538-9D00-FCEDA24879A9}

View File

@ -1,16 +0,0 @@
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
namespace SecurityBusinessLogic.BusinessLogics
{
/// <summary>
/// Логика работы с доступами
/// </summary>
public class AccessBusinessLogic : GenericBusinessLogic<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel>
{
public AccessBusinessLogic(IAccessService service) : base(service, "Доступы", AccessOperation.Доступы) { }
}
}

View File

@ -1,17 +1,18 @@
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using ToolsModule.Extensions;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityContract.BindingModels;
using SecurityContract.Interfaces;
using SecurityContract.Logics;
using System;
using System.IO;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using ToolsModule.Extensions;
namespace SecurityBusinessLogic.BusinessLogics
{
/// <summary>
/// Логика работы с бекапом
/// </summary>
public class BackupBusinessLogic : CoreBusinessLogic
/// <summary>
/// Логика работы с бекапом
/// </summary>
public class BackupBusinessLogic : CoreBusinessLogic, IBackupLogic
{
/// <summary>
/// Серивс для работы с бекапом

View File

@ -1,17 +0,0 @@
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
namespace SecurityBusinessLogic.BusinessLogics
{
/// <summary>
/// Логика работы с общими настройками системы
/// </summary>
public class EnviromentSettingBusinessLogic : GenericBusinessLogic<EnviromentSettingGetBindingModel, EnviromentSettingSetBindingModel,
EnviromentSettingListViewModel, EnviromentSettingViewModel>
{
public EnviromentSettingBusinessLogic(IEnviromentSettingService service) : base(service, "Настройки Среды", AccessOperation.НастройкиСреды) { }
}
}

View File

@ -0,0 +1,17 @@
using SecurityContract.BindingModels;
using SecurityContract.Interfaces.IGenericEntityService;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
namespace SecurityBusinessLogic.BusinessLogics.GenericBusinessLogic
{
/// <summary>
/// Логика работы с доступами
/// </summary>
public class AccessBusinessLogic : GenericBusinessLogic<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel>, IAccessLogic
{
public AccessBusinessLogic(IAccessService service) : base(service, "Доступы", AccessOperation.Доступы) { }
}
}

View File

@ -0,0 +1,18 @@
using SecurityContract.BindingModels;
using SecurityContract.Interfaces.IGenericEntityService;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
namespace SecurityBusinessLogic.BusinessLogics.GenericBusinessLogic
{
/// <summary>
/// Логика работы с общими настройками системы
/// </summary>
public class EnviromentSettingBusinessLogic : GenericBusinessLogic<EnviromentSettingGetBindingModel, EnviromentSettingSetBindingModel,
EnviromentSettingListViewModel, EnviromentSettingViewModel>, IEnviromentSettingLogic
{
public EnviromentSettingBusinessLogic(IEnviromentSettingService service) : base(service, "Настройки Среды", AccessOperation.НастройкиСреды) { }
}
}

View File

@ -0,0 +1,17 @@
using SecurityContract.BindingModels;
using SecurityContract.Interfaces.IGenericEntityService;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
namespace SecurityBusinessLogic.BusinessLogics.GenericBusinessLogic
{
/// <summary>
/// Логика работы с ролями
/// </summary>
public class RoleBusinessLogic : GenericBusinessLogic<RoleGetBindingModel, RoleSetBindingModel, RoleListViewModel, RoleViewModel>, IRoleLogic
{
public RoleBusinessLogic(IRoleService service) : base(service, "Роли", AccessOperation.Роли) { }
}
}

View File

@ -1,17 +1,18 @@
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
using SecurityContract.BindingModels;
using SecurityContract.Interfaces.IGenericEntityService;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using System;
using System.Linq;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
namespace SecurityBusinessLogic.BusinessLogics
namespace SecurityBusinessLogic.BusinessLogics.GenericBusinessLogic
{
/// <summary>
/// Логика работы с пользователями
/// </summary>
public class UserBusinessLogic : GenericBusinessLogic<UserGetBindingModel, UserSetBindingModel, UserListViewModel, UserViewModel>
/// <summary>
/// Логика работы с пользователями
/// </summary>
public class UserBusinessLogic : GenericBusinessLogic<UserGetBindingModel, UserSetBindingModel, UserListViewModel, UserViewModel>, IUserLogic
{
public UserBusinessLogic(IUserService service) : base(service, "Пользователи", AccessOperation.Пользователи) { }

View File

@ -0,0 +1,17 @@
using SecurityContract.BindingModels;
using SecurityContract.Interfaces.IGenericEntityService;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
namespace SecurityBusinessLogic.BusinessLogics.GenericBusinessLogic
{
/// <summary>
/// Логика работы со связями пользователями с ролями
/// </summary>
public class UserRoleBusinessLogic : GenericBusinessLogic<UserRoleGetBindingModel, UserRoleSetBindingModel, UserRoleListViewModel, UserRoleViewModel>, IUserRoleLogic
{
public UserRoleBusinessLogic(IUserRoleService service) : base(service, "Свзяь пользователей с ролями", AccessOperation.ПользователиРоли) { }
}
}

View File

@ -1,16 +0,0 @@
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
namespace SecurityBusinessLogic.BusinessLogics
{
/// <summary>
/// Логика работы с ролями
/// </summary>
public class RoleBusinessLogic : GenericBusinessLogic<RoleGetBindingModel, RoleSetBindingModel, RoleListViewModel, RoleViewModel>
{
public RoleBusinessLogic(IRoleService service) : base(service, "Роли", AccessOperation.Роли) { }
}
}

View File

@ -1,14 +1,15 @@
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using SecurityBusinessLogic.Interfaces;
using SecurityContract.Interfaces;
using SecurityContract.Logics;
using System;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
namespace SecurityBusinessLogic.BusinessLogics
{
/// <summary>
/// Логика синхронизации пользователей
/// </summary>
public class SynchronizationBusinessLogic : CoreBusinessLogic
/// <summary>
/// Логика синхронизации пользователей
/// </summary>
public class SynchronizationBusinessLogic : CoreBusinessLogic, ISynchronizationLogic
{
/// <summary>
/// Серивс для работы с бекапом

View File

@ -1,16 +0,0 @@
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
namespace SecurityBusinessLogic.BusinessLogics
{
/// <summary>
/// Логика работы со связями пользователями с ролями
/// </summary>
public class UserRoleBusinessLogic : GenericBusinessLogic<UserRoleGetBindingModel, UserRoleSetBindingModel, UserRoleListViewModel, UserRoleViewModel>
{
public UserRoleBusinessLogic(IUserRoleService service) : base(service, "Свзяь пользователей с ролями", AccessOperation.ПользователиРоли) { }
}
}

View File

@ -1,10 +0,0 @@
using ToolsModule.Interfaces;
using SecurityBusinessLogic.BindingModels;
namespace SecurityBusinessLogic.Interfaces
{
/// <summary>
/// Хранение доступов
/// </summary>
public interface IAccessService : IGenerticEntityService<AccessGetBindingModel, AccessSetBindingModel> { }
}

View File

@ -1,10 +0,0 @@
using ToolsModule.Interfaces;
using SecurityBusinessLogic.BindingModels;
namespace SecurityBusinessLogic.Interfaces
{
/// <summary>
/// Хранение общих настроек системы
/// </summary>
public interface IEnviromentSettingService : IGenerticEntityService<EnviromentSettingGetBindingModel, EnviromentSettingSetBindingModel> { }
}

View File

@ -1,10 +0,0 @@
using ToolsModule.Interfaces;
using SecurityBusinessLogic.BindingModels;
namespace SecurityBusinessLogic.Interfaces
{
/// <summary>
/// Хранение ролей
/// </summary>
public interface IRoleService : IGenerticEntityService<RoleGetBindingModel, RoleSetBindingModel> { }
}

View File

@ -1,17 +0,0 @@
using ToolsModule.Models;
namespace SecurityBusinessLogic.Interfaces
{
/// <summary>
/// Синхронизация пользователей (преподаватели, сотрудники, студенты)
/// </summary>
public interface ISynchronizationService
{
/// <summary>
/// Синхронизация
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
OperationResultModel RunSynchronization();
}
}

View File

@ -1,10 +0,0 @@
using ToolsModule.Interfaces;
using SecurityBusinessLogic.BindingModels;
namespace SecurityBusinessLogic.Interfaces
{
/// <summary>
/// Хранение связей пользователей с ролями
/// </summary>
public interface IUserRoleService : IGenerticEntityService<UserRoleGetBindingModel, UserRoleSetBindingModel> { }
}

View File

@ -1,10 +0,0 @@
using ToolsModule.Interfaces;
using SecurityBusinessLogic.BindingModels;
namespace SecurityBusinessLogic.Interfaces
{
/// <summary>
/// Хранение пользователей
/// </summary>
public interface IUserService : IGenerticEntityService<UserGetBindingModel, UserSetBindingModel> { }
}

View File

@ -5,11 +5,14 @@
</PropertyGroup>
<ItemGroup>
<Folder Include="Enums\" />
<Compile Remove="Enums\**" />
<EmbeddedResource Remove="Enums\**" />
<None Remove="Enums\**" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\CoreModels\CoreModels.csproj" />
<ProjectReference Include="..\SecurityContract\SecurityContract.csproj" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">

View File

@ -0,0 +1,24 @@
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.BusinessLogics.GenericBusinessLogic;
using SecurityContract.Logics;
using SecurityContract.Logics.IGenericEntityLogic;
using ToolsModule.BusinessLogics;
using ToolsModule.Interfaces;
namespace SecurityBusinessLogic
{
public class SecurityLogicDependencyRegistration : IImplementationExtension
{
public void RegisterServices()
{
DependencyManager.Instance.RegisterType<IAccessLogic, AccessBusinessLogic>();
DependencyManager.Instance.RegisterType<IEnviromentSettingLogic, EnviromentSettingBusinessLogic>();
DependencyManager.Instance.RegisterType<IRoleLogic, RoleBusinessLogic>();
DependencyManager.Instance.RegisterType<IUserLogic, UserBusinessLogic>();
DependencyManager.Instance.RegisterType<IUserRoleLogic, UserRoleBusinessLogic>();
DependencyManager.Instance.RegisterType<IBackupLogic, BackupBusinessLogic>();
DependencyManager.Instance.RegisterType<ISynchronizationLogic, SynchronizationBusinessLogic>();
}
}
}

View File

@ -4,7 +4,7 @@ using ToolsModule.Enums;
using System;
using System.ComponentModel.DataAnnotations;
namespace SecurityBusinessLogic.BindingModels
namespace SecurityContract.BindingModels
{
/// <summary>
/// Получение информации по доступу

View File

@ -1,4 +1,4 @@
namespace SecurityBusinessLogic.BindingModels
namespace SecurityContract.BindingModels
{
/// <summary>
/// Информация по выгрузки/загрузки данных

View File

@ -2,7 +2,7 @@
using ToolsModule.BindingModels;
using System.ComponentModel.DataAnnotations;
namespace SecurityBusinessLogic.BindingModels
namespace SecurityContract.BindingModels
{
/// <summary>
/// Получение общих настроек системы

View File

@ -2,7 +2,7 @@
using ToolsModule.BindingModels;
using System.ComponentModel.DataAnnotations;
namespace SecurityBusinessLogic.BindingModels
namespace SecurityContract.BindingModels
{
/// <summary>
/// Получение роли

View File

@ -3,7 +3,7 @@ using ToolsModule.BindingModels;
using System;
using System.ComponentModel.DataAnnotations;
namespace SecurityBusinessLogic.BindingModels
namespace SecurityContract.BindingModels
{
/// <summary>
/// Получение пользователя

View File

@ -3,7 +3,7 @@ using ToolsModule.BindingModels;
using System;
using System.ComponentModel.DataAnnotations;
namespace SecurityBusinessLogic.BindingModels
namespace SecurityContract.BindingModels
{
/// <summary>
/// Получение связи пользователя с ролью

View File

@ -0,0 +1,25 @@
using SecurityContract.BindingModels;
using ToolsModule.Interfaces;
namespace SecurityContract.Logics
{
/// <summary>
/// Логика работы с бекапом
/// </summary>
public interface IBackupLogic : IErrors
{
/// <summary>
/// Создание бекапа с данными
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool CreateBackUp(BackupBindingModel model);
/// <summary>
/// Восстанволение данных через бекап
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool RestoreBackUp(BackupBindingModel model);
}
}

View File

@ -0,0 +1,11 @@
using SecurityContract.BindingModels;
using SecurityContract.ViewModels;
using ToolsModule.Interfaces;
namespace SecurityContract.Logics.IGenericEntityLogic
{
/// <summary>
/// Логика работы с доступами
/// </summary>
public interface IAccessLogic : IGenericEntityLogic<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel> { }
}

View File

@ -0,0 +1,11 @@
using SecurityContract.BindingModels;
using SecurityContract.ViewModels;
using ToolsModule.Interfaces;
namespace SecurityContract.Logics.IGenericEntityLogic
{
/// <summary>
/// Логика работы с общими настройками системы
/// </summary>
public interface IEnviromentSettingLogic : IGenericEntityLogic<EnviromentSettingGetBindingModel, EnviromentSettingSetBindingModel, EnviromentSettingListViewModel, EnviromentSettingViewModel> { }
}

View File

@ -0,0 +1,11 @@
using SecurityContract.BindingModels;
using SecurityContract.ViewModels;
using ToolsModule.Interfaces;
namespace SecurityContract.Logics.IGenericEntityLogic
{
/// <summary>
/// Логика работы с ролями
/// </summary>
public interface IRoleLogic : IGenericEntityLogic<RoleGetBindingModel, RoleSetBindingModel, RoleListViewModel, RoleViewModel> { }
}

View File

@ -0,0 +1,20 @@
using SecurityContract.BindingModels;
using SecurityContract.ViewModels;
using ToolsModule.Interfaces;
namespace SecurityContract.Logics.IGenericEntityLogic
{
/// <summary>
/// Логика работы с пользователями
/// </summary>
public interface IUserLogic : IGenericEntityLogic<UserGetBindingModel, UserSetBindingModel, UserListViewModel, UserViewModel>
{
/// <summary>
/// Метод получения или создания пользователя для студента/сотрудника/преподавателя
/// </summary>
/// <param name="model"></param>
/// <param name="password"></param>
/// <returns></returns>
UserViewModel GetOrCreateUser(UserGetBindingModel model, string password);
}
}

View File

@ -0,0 +1,11 @@
using SecurityContract.BindingModels;
using SecurityContract.ViewModels;
using ToolsModule.Interfaces;
namespace SecurityContract.Logics.IGenericEntityLogic
{
/// <summary>
/// Логика работы со связями пользователями с ролями
/// </summary>
public interface IUserRoleLogic : IGenericEntityLogic<UserRoleGetBindingModel, UserRoleSetBindingModel, UserRoleListViewModel, UserRoleViewModel> { }
}

View File

@ -0,0 +1,17 @@
using ToolsModule.Interfaces;
namespace SecurityContract.Logics
{
/// <summary>
/// Логика синхронизации пользователей
/// </summary>
public interface ISynchronizationLogic : IErrors
{
/// <summary>
/// Запуск синхронизации
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
bool RunSynchronization();
}
}

View File

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\CoreModels\CoreModels.csproj" />
<ProjectReference Include="..\..\Common\ToolsModule\ToolsModule.csproj" />
</ItemGroup>
</Project>

View File

@ -1,12 +1,12 @@
using ToolsModule.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityContract.BindingModels;
using ToolsModule.Models;
namespace SecurityBusinessLogic.Interfaces
namespace SecurityContract.Interfaces
{
/// <summary>
/// Сервис работы по выгрузке и загрузке данных
/// </summary>
public interface IBackupService
/// <summary>
/// Сервис работы по выгрузке и загрузке данных
/// </summary>
public interface IBackupService
{
/// <summary>
/// Создание бекапа с данными

View File

@ -0,0 +1,10 @@
using SecurityContract.BindingModels;
using ToolsModule.Interfaces;
namespace SecurityContract.Interfaces.IGenericEntityService
{
/// <summary>
/// Хранение доступов
/// </summary>
public interface IAccessService : IGenericEntityService<AccessGetBindingModel, AccessSetBindingModel> { }
}

View File

@ -0,0 +1,10 @@
using SecurityContract.BindingModels;
using ToolsModule.Interfaces;
namespace SecurityContract.Interfaces.IGenericEntityService
{
/// <summary>
/// Хранение общих настроек системы
/// </summary>
public interface IEnviromentSettingService : IGenericEntityService<EnviromentSettingGetBindingModel, EnviromentSettingSetBindingModel> { }
}

View File

@ -0,0 +1,10 @@
using SecurityContract.BindingModels;
using ToolsModule.Interfaces;
namespace SecurityContract.Interfaces.IGenericEntityService
{
/// <summary>
/// Хранение ролей
/// </summary>
public interface IRoleService : IGenericEntityService<RoleGetBindingModel, RoleSetBindingModel> { }
}

View File

@ -0,0 +1,10 @@
using SecurityContract.BindingModels;
using ToolsModule.Interfaces;
namespace SecurityContract.Interfaces.IGenericEntityService
{
/// <summary>
/// Хранение связей пользователей с ролями
/// </summary>
public interface IUserRoleService : IGenericEntityService<UserRoleGetBindingModel, UserRoleSetBindingModel> { }
}

View File

@ -0,0 +1,10 @@
using SecurityContract.BindingModels;
using ToolsModule.Interfaces;
namespace SecurityContract.Interfaces.IGenericEntityService
{
/// <summary>
/// Хранение пользователей
/// </summary>
public interface IUserService : IGenericEntityService<UserGetBindingModel, UserSetBindingModel> { }
}

View File

@ -0,0 +1,17 @@
using ToolsModule.Models;
namespace SecurityContract.Interfaces
{
/// <summary>
/// Синхронизация пользователей (преподаватели, сотрудники, студенты)
/// </summary>
public interface ISynchronizationService
{
/// <summary>
/// Синхронизация
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
OperationResultModel RunSynchronization();
}
}

View File

@ -4,7 +4,7 @@ using ToolsModule.Enums;
using ToolsModule.ViewModels;
using System;
namespace SecurityBusinessLogic.ViewModels
namespace SecurityContract.ViewModels
{
/// <summary>
/// Список достпуов

View File

@ -3,7 +3,7 @@ using ToolsModule.Attributes;
using ToolsModule.Enums;
using ToolsModule.ViewModels;
namespace SecurityBusinessLogic.ViewModels
namespace SecurityContract.ViewModels
{
/// <summary>
/// Список общих настроек системы

View File

@ -3,7 +3,7 @@ using ToolsModule.Attributes;
using ToolsModule.Enums;
using ToolsModule.ViewModels;
namespace SecurityBusinessLogic.ViewModels
namespace SecurityContract.ViewModels
{
/// <summary>
/// Список ролей

View File

@ -4,7 +4,7 @@ using ToolsModule.Enums;
using ToolsModule.ViewModels;
using System;
namespace SecurityBusinessLogic.ViewModels
namespace SecurityContract.ViewModels
{
/// <summary>
/// Список пользователей

View File

@ -4,7 +4,7 @@ using ToolsModule.Enums;
using ToolsModule.ViewModels;
using System;
namespace SecurityBusinessLogic.ViewModels
namespace SecurityContract.ViewModels
{
/// <summary>
/// Список пользователей

View File

@ -1,18 +1,18 @@
using CoreDatabase;
using CoreDatabase.Models.Security;
using Microsoft.EntityFrameworkCore;
using ToolsModule.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
using SecurityContract.BindingModels;
using SecurityContract.Interfaces.IGenericEntityService;
using SecurityContract.ViewModels;
using System.Linq;
using ToolsModule.Models;
namespace SecurityDatabaseImplementation.Implementations
{
/// <summary>
/// Реализация IAccessService
/// </summary>
public class AccessService :
/// <summary>
/// Реализация IAccessService
/// </summary>
public class AccessService :
AbstractGenerticEntityService<AccessGetBindingModel, AccessSetBindingModel, Access, AccessListViewModel, AccessViewModel>,
IAccessService
{

View File

@ -1,10 +1,6 @@
using CoreDatabase;
using ToolsModule.Attributes;
using ToolsModule.Extensions;
using ToolsModule.Interfaces;
using ToolsModule.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityContract.BindingModels;
using SecurityContract.Interfaces;
using System;
using System.Collections.Generic;
using System.IO;
@ -12,13 +8,17 @@ using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization.Json;
using ToolsModule.Attributes;
using ToolsModule.Extensions;
using ToolsModule.Interfaces;
using ToolsModule.Models;
namespace SecurityDatabaseImplementation.Implementations
{
/// <summary>
/// Реализация IBackupService для сохранения в JSON через JsonContract
/// </summary>
public class BackupJsonContractService : IBackupService
/// <summary>
/// Реализация IBackupService для сохранения в JSON через JsonContract
/// </summary>
public class BackupJsonContractService : IBackupService
{
public OperationResultModel CreateBackUp(BackupBindingModel model)
{

View File

@ -1,19 +1,19 @@
using CoreDatabase;
using CoreDatabase.Models.Security;
using Microsoft.EntityFrameworkCore;
using SecurityContract.BindingModels;
using SecurityContract.Interfaces.IGenericEntityService;
using SecurityContract.ViewModels;
using System.Linq;
using ToolsModule.Extensions;
using ToolsModule.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
using System.Linq;
namespace SecurityDatabaseImplementation.Implementations
{
/// <summary>
/// Реализация IEnviromentSettingService
/// </summary>
public class EnviromentSettingService :
/// <summary>
/// Реализация IEnviromentSettingService
/// </summary>
public class EnviromentSettingService :
AbstractGenerticEntityService<EnviromentSettingGetBindingModel, EnviromentSettingSetBindingModel, EnviromentSetting, EnviromentSettingListViewModel, EnviromentSettingViewModel>,
IEnviromentSettingService
{

View File

@ -1,21 +1,21 @@
using CoreDatabase;
using CoreDatabase.Models.Security;
using Microsoft.EntityFrameworkCore;
using SecurityContract.BindingModels;
using SecurityContract.Interfaces.IGenericEntityService;
using SecurityContract.ViewModels;
using System;
using System.Linq;
using ToolsModule.Enums;
using ToolsModule.Extensions;
using ToolsModule.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
using System;
using System.Linq;
namespace SecurityDatabaseImplementation.Implementations
{
/// <summary>
/// Реализация IRoleService
/// </summary>
public class RoleService :
/// <summary>
/// Реализация IRoleService
/// </summary>
public class RoleService :
AbstractGenerticEntityService<RoleGetBindingModel, RoleSetBindingModel, Role, RoleListViewModel, RoleViewModel>,
IRoleService
{

View File

@ -1,12 +1,12 @@
using ToolsModule.Models;
using SecurityBusinessLogic.Interfaces;
using SecurityContract.Interfaces;
using ToolsModule.Models;
namespace SecurityDatabaseImplementation.Implementations
{
/// <summary>
/// Реализация ISynchronizationService
/// </summary>
public class SynchronizationService : ISynchronizationService
/// <summary>
/// Реализация ISynchronizationService
/// </summary>
public class SynchronizationService : ISynchronizationService
{
public OperationResultModel RunSynchronization()
{

View File

@ -1,18 +1,18 @@
using CoreDatabase;
using CoreDatabase.Models.Security;
using Microsoft.EntityFrameworkCore;
using ToolsModule.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
using SecurityContract.BindingModels;
using SecurityContract.Interfaces.IGenericEntityService;
using SecurityContract.ViewModels;
using System.Linq;
using ToolsModule.Models;
namespace SecurityDatabaseImplementation.Implementations
{
/// <summary>
/// Реализация IUserRoleService
/// </summary>
public class UserRoleService :
/// <summary>
/// Реализация IUserRoleService
/// </summary>
public class UserRoleService :
AbstractGenerticEntityService<UserRoleGetBindingModel, UserRoleSetBindingModel, UserRole, UserRoleListViewModel, UserRoleViewModel>,
IUserRoleService
{

View File

@ -2,21 +2,21 @@
using CoreDatabase.Models.Department;
using CoreDatabase.Models.Security;
using Microsoft.EntityFrameworkCore;
using SecurityContract.BindingModels;
using SecurityContract.Interfaces.IGenericEntityService;
using SecurityContract.ViewModels;
using System;
using System.Linq;
using ToolsModule.Enums;
using ToolsModule.Extensions;
using ToolsModule.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels;
using System;
using System.Linq;
namespace SecurityDatabaseImplementation.Implementations
{
/// <summary>
/// Реализация IUserService
/// </summary>
public class UserService :
/// <summary>
/// Реализация IUserService
/// </summary>
public class UserService :
AbstractGenerticEntityService<UserGetBindingModel, UserSetBindingModel, User, UserListViewModel, UserViewModel>,
IUserService
{

View File

@ -6,7 +6,7 @@
<ItemGroup>
<ProjectReference Include="..\..\Common\CoreDatabase\CoreDatabase.csproj" />
<ProjectReference Include="..\SecurityBusinessLogic\SecurityBusinessLogic.csproj" />
<ProjectReference Include="..\SecurityContract\SecurityContract.csproj" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">

View File

@ -1,11 +1,12 @@
using ToolsModule.BusinessLogics;
using ToolsModule.Interfaces;
using SecurityBusinessLogic.Interfaces;
using SecurityContract.Interfaces;
using SecurityContract.Interfaces.IGenericEntityService;
using SecurityDatabaseImplementation.Implementations;
using ToolsModule.BusinessLogics;
using ToolsModule.Interfaces;
namespace SecurityDatabaseImplementation
{
public class SecurityImplementationExtensions : IImplementationExtension
public class SecurityImplementationExtensions : IImplementationExtension
{
public void RegisterServices()
{

View File

@ -1,18 +1,18 @@
using ToolsDesktop.Controls;
using SecurityContract.BindingModels;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using System;
using ToolsDesktop.Controls;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels;
using System;
namespace SecurityWindowsDesktop.EntityControls
{
/// <summary>
/// Реализация контрола для доступа
/// </summary>
public partial class ControlAccessElement :
GenericControlEntityElement<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel, AccessBusinessLogic>,
/// <summary>
/// Реализация контрола для доступа
/// </summary>
public partial class ControlAccessElement :
GenericControlEntityElement<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel, IAccessLogic>,
IGenericControlEntityElement
{
public ControlAccessElement()

View File

@ -1,32 +1,32 @@
using ToolsDesktop.Controls;
using SecurityContract.BindingModels;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using ToolsDesktop.Controls;
using ToolsDesktop.Enums;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
namespace SecurityWindowsDesktop.EntityControls
{
/// <summary>
/// Реализация контрола для списка доступов
/// </summary>
public partial class ControlAccessList :
GenericControlEntityList<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel, AccessBusinessLogic>,
/// <summary>
/// Реализация контрола для списка доступов
/// </summary>
public partial class ControlAccessList :
GenericControlEntityList<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel, IAccessLogic>,
IGenericControlEntityList
{
private readonly RoleBusinessLogic _roleBusinessLogic;
private readonly IRoleLogic _roleLogic;
public ControlAccessList()
{
InitializeComponent();
_roleBusinessLogic = DependencyManager.Instance.Resolve<RoleBusinessLogic>();
_roleLogic = DependencyManager.Instance.Resolve<IRoleLogic>();
Title = "Доступы";
ControlId = new Guid("6eebc4c4-cb86-4368-93e0-33dbdbb7409a");
AccessOperation = AccessOperation.Доступы;
@ -39,7 +39,7 @@ namespace SecurityWindowsDesktop.EntityControls
public ControlViewEntityListConfiguration GetConfigControl() => new()
{
PaginationOn = true,
PageNamesForPagination = _roleBusinessLogic.GetList(new RoleGetBindingModel())?.List?.Select(x =>
PageNamesForPagination = _roleLogic.GetList(new RoleGetBindingModel())?.List?.Select(x =>
new PageNamesForPaginationModel
{
Key = x.Id,

View File

@ -1,18 +1,18 @@
using ToolsDesktop.Controls;
using SecurityContract.BindingModels;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using System;
using ToolsDesktop.Controls;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels;
using System;
namespace SecurityWindowsDesktop.EntityControls
{
/// <summary>
/// Реализация контрола для настройки среды
/// </summary>
public partial class ControlEnviromentSettingElement :
GenericControlEntityElement<EnviromentSettingGetBindingModel, EnviromentSettingSetBindingModel, EnviromentSettingListViewModel, EnviromentSettingViewModel, EnviromentSettingBusinessLogic>,
/// <summary>
/// Реализация контрола для настройки среды
/// </summary>
public partial class ControlEnviromentSettingElement :
GenericControlEntityElement<EnviromentSettingGetBindingModel, EnviromentSettingSetBindingModel, EnviromentSettingListViewModel, EnviromentSettingViewModel, IEnviromentSettingLogic>,
IGenericControlEntityElement
{
public ControlEnviromentSettingElement()

View File

@ -1,21 +1,21 @@
using ToolsDesktop.Controls;
using SecurityContract.BindingModels;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using System;
using System.Collections.Generic;
using ToolsDesktop.Controls;
using ToolsDesktop.Enums;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using ToolsModule.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels;
using System;
using System.Collections.Generic;
namespace SecurityWindowsDesktop.EntityControls
{
/// <summary>
/// Реализация контрола для списка настроек среды
/// </summary>
public partial class ControlEnviromentSettingList :
GenericControlEntityList<EnviromentSettingGetBindingModel, EnviromentSettingSetBindingModel, EnviromentSettingListViewModel, EnviromentSettingViewModel, EnviromentSettingBusinessLogic>,
/// <summary>
/// Реализация контрола для списка настроек среды
/// </summary>
public partial class ControlEnviromentSettingList :
GenericControlEntityList<EnviromentSettingGetBindingModel, EnviromentSettingSetBindingModel, EnviromentSettingListViewModel, EnviromentSettingViewModel, IEnviromentSettingLogic>,
IGenericControlEntityList
{
public ControlEnviromentSettingList()

View File

@ -1,18 +1,18 @@
using ToolsDesktop.Controls;
using SecurityContract.BindingModels;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using System;
using ToolsDesktop.Controls;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels;
using System;
namespace SecurityWindowsDesktop.EntityControls
{
/// <summary>
/// Реализация контрола для роли
/// </summary>
public partial class ControlRoleElement :
GenericControlEntityElement<RoleGetBindingModel, RoleSetBindingModel, RoleListViewModel, RoleViewModel, RoleBusinessLogic>,
/// <summary>
/// Реализация контрола для роли
/// </summary>
public partial class ControlRoleElement :
GenericControlEntityElement<RoleGetBindingModel, RoleSetBindingModel, RoleListViewModel, RoleViewModel, IRoleLogic>,
IGenericControlEntityElement
{
public ControlRoleElement()

View File

@ -1,21 +1,21 @@
using ToolsDesktop.Controls;
using SecurityContract.BindingModels;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using System;
using System.Collections.Generic;
using ToolsDesktop.Controls;
using ToolsDesktop.Enums;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using ToolsModule.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels;
using System;
using System.Collections.Generic;
namespace SecurityWindowsDesktop.EntityControls
{
/// <summary>
/// Реализация контрола для списка ролей
/// </summary>
public partial class ControlRoleList :
GenericControlEntityList<RoleGetBindingModel, RoleSetBindingModel, RoleListViewModel, RoleViewModel, RoleBusinessLogic>,
/// <summary>
/// Реализация контрола для списка ролей
/// </summary>
public partial class ControlRoleList :
GenericControlEntityList<RoleGetBindingModel, RoleSetBindingModel, RoleListViewModel, RoleViewModel, IRoleLogic>,
IGenericControlEntityList
{
public ControlRoleList() : base()

View File

@ -1,18 +1,18 @@
using ToolsDesktop.Controls;
using SecurityContract.BindingModels;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using System;
using ToolsDesktop.Controls;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels;
using System;
namespace SecurityWindowsDesktop.EntityControls
{
/// <summary>
/// Реализация контрола для сотрудника
/// </summary>
public partial class ControlUserElement :
GenericControlEntityElement<UserGetBindingModel, UserSetBindingModel, UserListViewModel, UserViewModel, UserBusinessLogic>,
/// <summary>
/// Реализация контрола для сотрудника
/// </summary>
public partial class ControlUserElement :
GenericControlEntityElement<UserGetBindingModel, UserSetBindingModel, UserListViewModel, UserViewModel, IUserLogic>,
IGenericControlEntityElement
{
public ControlUserElement()

View File

@ -1,20 +1,20 @@
using ToolsDesktop.BaseControls;
using SecurityContract.BindingModels;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using System;
using ToolsDesktop.BaseControls;
using ToolsDesktop.Controls;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using ToolsModule.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels;
using System;
namespace SecurityWindowsDesktop.EntityControls
{
/// <summary>
/// Реализация контрола для списка пользователей
/// </summary>
public partial class ControlUserList :
GenericControlEntityList<UserGetBindingModel, UserSetBindingModel, UserListViewModel, UserViewModel, UserBusinessLogic>,
/// <summary>
/// Реализация контрола для списка пользователей
/// </summary>
public partial class ControlUserList :
GenericControlEntityList<UserGetBindingModel, UserSetBindingModel, UserListViewModel, UserViewModel, IUserLogic>,
IGenericControlEntityList
{
public ControlUserList() : base()

View File

@ -1,18 +1,18 @@
using ToolsDesktop.Controls;
using SecurityContract.BindingModels;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using System;
using ToolsDesktop.Controls;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels;
using System;
namespace SecurityWindowsDesktop.EntityControls
{
/// <summary>
/// Реализация контрола для связи сотрудника с ролью
/// </summary>
public partial class ControlUserRoleElement :
GenericControlEntityElement<UserRoleGetBindingModel, UserRoleSetBindingModel, UserRoleListViewModel, UserRoleViewModel, UserRoleBusinessLogic>,
/// <summary>
/// Реализация контрола для связи сотрудника с ролью
/// </summary>
public partial class ControlUserRoleElement :
GenericControlEntityElement<UserRoleGetBindingModel, UserRoleSetBindingModel, UserRoleListViewModel, UserRoleViewModel, IUserRoleLogic>,
IGenericControlEntityElement
{
public ControlUserRoleElement()

View File

@ -1,21 +1,21 @@
using ToolsDesktop.Controls;
using SecurityContract.BindingModels;
using SecurityContract.Logics.IGenericEntityLogic;
using SecurityContract.ViewModels;
using System;
using System.Collections.Generic;
using ToolsDesktop.Controls;
using ToolsDesktop.Enums;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using ToolsModule.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels;
using System;
using System.Collections.Generic;
namespace SecurityWindowsDesktop.EntityControls
{
/// <summary>
/// Реализация контрола для списка ролей пользователя
/// </summary>
public partial class ControlUserRoleList :
GenericControlEntityList<UserRoleGetBindingModel, UserRoleSetBindingModel, UserRoleListViewModel, UserRoleViewModel, UserRoleBusinessLogic>,
/// <summary>
/// Реализация контрола для списка ролей пользователя
/// </summary>
public partial class ControlUserRoleList :
GenericControlEntityList<UserRoleGetBindingModel, UserRoleSetBindingModel, UserRoleListViewModel, UserRoleViewModel, IUserRoleLogic>,
IGenericControlEntityList
{
public ControlUserRoleList()

View File

@ -11,7 +11,7 @@
<ItemGroup>
<ProjectReference Include="..\..\Common\ToolsDesktop\ToolsDesktop.csproj" />
<ProjectReference Include="..\SecurityBusinessLogic\SecurityBusinessLogic.csproj" />
<ProjectReference Include="..\SecurityContract\SecurityContract.csproj" />
</ItemGroup>
<ItemGroup>

View File

@ -1,25 +1,25 @@
using ToolsDesktop.Helpers;
using SecurityContract.BindingModels;
using SecurityContract.Logics;
using System;
using System.Windows.Forms;
using System.Xml.Linq;
using ToolsDesktop.Helpers;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using System;
using System.Windows.Forms;
using System.Xml.Linq;
namespace SecurityWindowsDesktop.SpecialControls
{
/// <summary>
/// Контрол для работы с бекапом
/// </summary>
public partial class BackupControl : UserControl, IControl
/// <summary>
/// Контрол для работы с бекапом
/// </summary>
public partial class BackupControl : UserControl, IControl
{
/// <summary>
/// Класс с бизнес-логикой работы с бекапом
/// </summary>
private readonly BackupBusinessLogic _businessLogic;
private readonly IBackupLogic _businessLogic;
/// <summary>
/// Событие, вызываемое при закрытии контрола
@ -32,7 +32,7 @@ namespace SecurityWindowsDesktop.SpecialControls
public BackupControl()
{
InitializeComponent();
_businessLogic = DependencyManager.Instance.Resolve<BackupBusinessLogic>();
_businessLogic = DependencyManager.Instance.Resolve<IBackupLogic>();
Title = "Работа с бекапом";
ControlId = new Guid("cc9844e6-5d92-4c89-b817-4c17ec382bc1");
AccessOperation = AccessOperation.РаботасБекапом;

View File

@ -1,24 +1,24 @@
using ToolsDesktop.Helpers;
using SecurityContract.Logics;
using System;
using System.Windows.Forms;
using System.Xml.Linq;
using ToolsDesktop.Helpers;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using ToolsModule.BusinessLogics;
using ToolsModule.Enums;
using SecurityBusinessLogic.BusinessLogics;
using System;
using System.Windows.Forms;
using System.Xml.Linq;
namespace SecurityWindowsDesktop.SpecialControls
{
/// <summary>
/// Контрол для работы с синхронизацией
/// </summary>
public partial class SynchronizationControl : UserControl, IControl
/// <summary>
/// Контрол для работы с синхронизацией
/// </summary>
public partial class SynchronizationControl : UserControl, IControl
{
/// <summary>
/// Класс с бизнес-логикой работы с синхронизацией
/// </summary>
private readonly SynchronizationBusinessLogic _businessLogic;
private readonly ISynchronizationLogic _businessLogic;
/// <summary>
/// Событие, вызываемое при закрытии контрола
@ -31,7 +31,7 @@ namespace SecurityWindowsDesktop.SpecialControls
public SynchronizationControl()
{
InitializeComponent();
_businessLogic = DependencyManager.Instance.Resolve<SynchronizationBusinessLogic>();
_businessLogic = DependencyManager.Instance.Resolve<ISynchronizationLogic>();
Title = "Синхронизация";
ControlId = new Guid("c392818b-9036-4c4b-8a57-8ff935115e6a");
AccessOperation = AccessOperation.Синхронизация;