перевод проекта с modelTools на ModuleTools

This commit is contained in:
kotcheshir73 2021-03-28 19:15:55 +04:00
parent 3609c0edc6
commit 9c5dffefbb
69 changed files with 1357 additions and 100 deletions

View File

@ -12,7 +12,7 @@ namespace DatabaseCore
if (optionsBuilder.IsConfigured == false) if (optionsBuilder.IsConfigured == false)
{ {
#if RELEASE #if RELEASE
var connectionString = ModelTools.ServiceProvider.ServiceProviderLoader.GetConfigData("connectionString"); var connectionString = ModuleTools.ServiceProvider.ServiceProviderLoader.GetConfigData("connectionString");
optionsBuilder.UseSqlServer(connectionString); optionsBuilder.UseSqlServer(connectionString);
#endif #endif

View File

@ -14,8 +14,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Security\SecurityBusinessLogic\SecurityBusinessLogic.csproj" /> <ProjectReference Include="..\ModuleTools\ModuleTools.csproj" />
<ProjectReference Include="..\ModelTools\ModelTools.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,4 +1,4 @@
using ModelTools.Attributes; using ModuleTools.Attributes;
using System; using System;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization; using System.Runtime.Serialization;

View File

@ -1,5 +1,5 @@
using ModelTools.Attributes; using ModuleTools.Attributes;
using ModelTools.Enums; using ModuleTools.Enums;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization; using System.Runtime.Serialization;

View File

@ -1,4 +1,4 @@
using ModelTools.Attributes; using ModuleTools.Attributes;
using System.Runtime.Serialization; using System.Runtime.Serialization;
namespace DatabaseCore.Models.Security namespace DatabaseCore.Models.Security

View File

@ -1,4 +1,4 @@
using ModelTools.Attributes; using ModuleTools.Attributes;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization; using System.Runtime.Serialization;

View File

@ -1,4 +1,4 @@
using ModelTools.Attributes; using ModuleTools.Attributes;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;

View File

@ -1,4 +1,4 @@
using ModelTools.Attributes; using ModuleTools.Attributes;
using System; using System;
using System.Runtime.Serialization; using System.Runtime.Serialization;

View File

@ -1,8 +1,7 @@
using DatabaseCore.Models.Security; using DatabaseCore.Models.Security;
using ModelTools.Enums; using ModuleTools.Enums;
using ModelTools.Interfaces; using ModuleTools.Interfaces;
using ModelTools.Models; using ModuleTools.Models;
using SecurityBusinessLogic.BusinessLogics;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -1,9 +1,9 @@
using DesktopTools.Models; using DesktopTools.Models;
using ModelTools.Attributes; using ModuleTools.Attributes;
using ModelTools.BindingModels; using ModuleTools.BindingModels;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Extensions; using ModuleTools.Extensions;
using ModelTools.ViewModels; using ModuleTools.ViewModels;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;

View File

@ -1,4 +1,4 @@
using ModelTools.Enums; using ModuleTools.Enums;
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;

View File

@ -6,7 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ModelTools\ModelTools.csproj" /> <ProjectReference Include="..\ModuleTools\ModuleTools.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -0,0 +1,40 @@
using System;
namespace ModuleTools.Attributes
{
/// <summary>
/// Оописание зависимости сущности от другой сущности (требуется для выстраивания последоватльности сохранения и загрузки данных,
/// применяется к классам-описывающим сущности в хранилище)
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class EntityDependencyAttribute : Attribute
{
/// <summary>
/// Название класса от котрого зависит этот класс
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// Название поле в этом классе, которое ссылает на другой класс (идентификатор)
/// </summary>
public string ColumnName { get; set; }
/// <summary>
/// Описание зависимости
/// </summary>
public string Description { get; set; }
/// <summary>
/// Описание зависимости сущности от другой сущности (требуется для сохранения и загрузки данных)
/// </summary>
/// <param name="className">Название класса от котрого зависит этот класс</param>
/// <param name="columnName">Название поле в этом классе, которое ссылает на другой класс (идентификатор)</param>
/// <param name="description">Описание зависимости</param>
public EntityDependencyAttribute(string className, string columnName, string description)
{
ClassName = className;
ColumnName = columnName;
Description = description;
}
}
}

View File

@ -0,0 +1,33 @@
using System;
namespace ModuleTools.Attributes
{
/// <summary>
/// Оописание класса из базы данных, его назначение (требуется для выстраивания иерархии с описанием классов,
/// применяется к классам-описывающим сущности в хранилище)
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class EntityDescriptionAttribute : Attribute
{
/// <summary>
/// Название сущности, которую описывает класс
/// </summary>
public string EntityName { get; set; }
/// <summary>
/// Описание назначения сущности
/// </summary>
public string Description { get; set; }
/// <summary>
/// Описание класса из базы данных, его назначение
/// </summary>
/// <param name="entityName">Название сущности, которую описывает класс</param>
/// <param name="description">Описание назначения сущности</param>
public EntityDescriptionAttribute(string entityName, string description)
{
EntityName = entityName;
Description = description;
}
}
}

View File

@ -0,0 +1,35 @@
using System;
namespace ModuleTools.Attributes
{
/// <summary>
/// Настройка для полей сущности правил маппинга в классе, который требуется заполнять данными из другого класса
/// (требуется для заполнения свойств объекта значениями одного класса значениями свойств объектов другого класса,
/// применяется при создании класса-описывающего сущность в хранилище из класса SetBindingModel
/// и из класса-описывающего сущность в хранилище в класс ElementViewModel)
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public class MapConfigurationAttribute : Attribute
{
/// <summary>
/// Название свойства с класса, из которого извлекаем данные
/// </summary>
public string PropertyNameFromModel { get; set; }
/// <summary>
/// Сложное свойство (свойствое в другом классе-свойстве)
/// </summary>
public bool IsDifficle { get; set; }
/// <summary>
/// Настройка для полей сущности правил маппинга
/// </summary>
/// <param name="propertyNameFromMModel">Название свойства с класса, из которого извлекаем данные</param>
/// <param name="isDifficle">Сложное свойство (свойствое в другом классе-свойстве)</param>
public MapConfigurationAttribute(string propertyNameFromMModel, bool isDifficle = false)
{
PropertyNameFromModel = propertyNameFromMModel;
IsDifficle = isDifficle;
}
}
}

View File

@ -0,0 +1,51 @@
using System;
namespace ModuleTools.Attributes
{
/// <summary>
/// Настройка отображения свойства класса при табличном выводе списка объектов класса (требуется для автоматизации вывода списка,
/// применяется к классам ElementViewModel)
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public class ViewModelOnListPropertyAttribute : Attribute
{
/// <summary>
/// Название на форме
/// </summary>
public string DisplayName { get; set; }
/// <summary>
/// Скрывать или нет при выводе списка
/// </summary>
public bool IsHide { get; set; }
/// <summary>
/// Ширина колонки
/// </summary>
public int? ColumnWidth { get; set; }
/// <summary>
/// Настройка отображения элемента в контролах
/// </summary>
/// <param name="displayName">Название на форме</param>
/// <param name="isHide">Скрывать или нет</param>
public ViewModelOnListPropertyAttribute(string displayName, bool isHide = false)
{
DisplayName = displayName;
ColumnWidth = null;
IsHide = isHide;
}
/// <summary>
/// Конструктор
/// </summary>
/// <param name="displayName">Название на форме</param>
/// <param name="columnWidth">Ширина колонки</param>
public ViewModelOnListPropertyAttribute(string displayName, int columnWidth)
{
DisplayName = displayName;
ColumnWidth = columnWidth;
IsHide = false;
}
}
}

View File

@ -0,0 +1,20 @@
using System;
namespace ModuleTools.BindingModels
{
/// <summary>
/// Информация для доступа к выполнению операций
/// </summary>
public class AccessBindingModel
{
/// <summary>
/// Пропускать проверку (работает только для получения данных)
/// </summary>
public bool SkipCheck { get; set; }
/// <summary>
/// Идентификатор пользователя, который запрашивает выполнение операции
/// </summary>
public Guid? UserId { get; set; }
}
}

View File

@ -0,0 +1,30 @@
using System;
namespace ModuleTools.BindingModels
{
/// <summary>
/// Получение записи
/// </summary>
public class GetBindingModel : AccessBindingModel
{
/// <summary>
/// Идентификатор получаемой записи (для одной записи)
/// </summary>
public Guid? Id { get; set; }
/// <summary>
/// Номер страницы, которую получаем (для списка)
/// </summary>
public int? PageNumber { get; set; }
/// <summary>
/// Количество записей возвращаемых (для списка)
/// </summary>
public int? PageSize { get; set; }
/// <summary>
/// Иной признак, по которму отбираем записи (для списка)
/// </summary>
public string PageName { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
namespace ModuleTools.BindingModels
{
/// <summary>
/// Сохранение записи по идентификатору
/// </summary>
public class SetBindingModel : AccessBindingModel
{
/// <summary>
/// Идентификатор записи
/// </summary>
public Guid Id { get; set; }
}
}

View File

@ -0,0 +1,226 @@
using ModuleTools.BindingModels;
using ModuleTools.Enums;
using ModuleTools.Interfaces;
using ModuleTools.Models;
using ModuleTools.ViewModels;
using System;
using System.Collections.Generic;
namespace ModuleTools.BusinessLogics
{
/// <summary>
/// Базовый класс для логики сущности
/// </summary>
/// <typeparam name="G"></typeparam>
/// <typeparam name="S"></typeparam>
/// <typeparam name="L"></typeparam>
/// <typeparam name="E"></typeparam>
public abstract class BusinessLogicCore<G, S, L, E>
where G : GetBindingModel
where S : SetBindingModel
where L : ListViewModel<E>
where E : ElementViewModel
{
/// <summary>
/// Перечень ошибок при выполнении операции
/// </summary>
public List<(string Title, string Message)> Errors { get; protected set; }
protected IEntityService<G, S> Service { get; set; }
protected ISecurityManager Security { get; set; }
protected readonly AccessOperation _serviceOperation;
protected readonly string _entity;
public BusinessLogicCore(IEntityService<G, S> service, string entity, AccessOperation serviceOperation)
{
Service = service;
Errors = new List<(string Title, string Message)>();
Security = UnityContainerConfigurator.Resolve<ISecurityManager>();
_entity = entity;
_serviceOperation = serviceOperation;
}
/// <summary>
/// Проверка доступности операции для пользователя
/// </summary>
/// <param name="model"></param>
/// <param name="type"></param>
/// <returns></returns>
protected bool NoAccess(AccessBindingModel model, AccessType type)
{
if (Security.CheckAccess(new SecurityManagerCheckAccessModel(model, _serviceOperation, type, _entity)))
{
return false;
}
Errors.Add(("Ошибка безопасности", Security.ErrorMessage));
return true;
}
/// <summary>
/// Получение списка записей
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public L GetList(G model)
{
Errors.Clear();
try
{
if (NoAccess(model, AccessType.SimpleView) && NoAccess(model, AccessType.FullView))
{
return null;
}
var result = Service.Read(model);
if (!result.IsSucceeded)
{
Errors.AddRange(Errors);
return null;
}
return ConvertToL(result);
}
catch (Exception ex)
{
Errors.Add(("Ошибка получения", ex.Message));
}
return null;
}
/// <summary>
/// Получение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public E GetElement(G model)
{
Errors.Clear();
try
{
if (NoAccess(model, AccessType.SimpleView) && NoAccess(model, AccessType.FullView))
{
return null;
}
var result = Service.Read(model);
if (!result.IsSucceeded)
{
Errors.AddRange(Errors);
return null;
}
return ConvertToE(result);
}
catch (Exception ex)
{
Errors.Add(("Ошибка получения", ex.Message));
}
return null;
}
/// <summary>
/// Создание записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public E Create(S model)
{
Errors.Clear();
try
{
if (NoAccess(model, AccessType.Change))
{
return null;
}
var result = Service.Create(model);
if (!result.IsSucceeded)
{
Errors.AddRange(Errors);
return null;
}
return ConvertToE(result);
}
catch (Exception ex)
{
Errors.Add(("Ошибка создания", ex.Message));
}
return null;
}
/// <summary>
/// Изменение записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public E Update(S model)
{
Errors.Clear();
try
{
if (NoAccess(model, AccessType.Change))
{
return null;
}
var result = Service.Update(model);
if (!result.IsSucceeded)
{
Errors.AddRange(Errors);
return null;
}
return ConvertToE(result);
}
catch (Exception ex)
{
Errors.Add(("Ошибка изменения", ex.Message));
}
return null;
}
/// <summary>
/// Удаление записи
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool Delete(G model)
{
Errors.Clear();
try
{
if (NoAccess(model, AccessType.Delete))
{
return false;
}
var result = Service.Delete(model);
if (!result.IsSucceeded)
{
Errors.AddRange(Errors);
return false;
}
return true;
}
catch (Exception ex)
{
Errors.Add(("Ошибка удаления", ex.Message));
}
return false;
}
/// <summary>
/// Получить список элементов
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
protected abstract L ConvertToL(OperationResultModel model);
/// <summary>
/// Получить элемент
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
protected abstract E ConvertToE(OperationResultModel model);
}
}

View File

@ -0,0 +1,100 @@
using ModuleTools.Attributes;
using System;
using System.Reflection;
namespace ModuleTools.BusinessLogics
{
/// <summary>
/// Маппер сущностей
/// </summary>
public class Mapper
{
/// <summary>
/// Преобразование из одного класса в другой
/// </summary>
/// <typeparam name="From"></typeparam>
/// <typeparam name="To"></typeparam>
/// <param name="obj"></param>
/// <returns></returns>
public static To MapToClass<From, To>(From obj) where To : class => FillObject(obj, (To)Activator.CreateInstance(typeof(To)));
/// <summary>
/// Преобразование из одного класса в другой
/// </summary>
/// <typeparam name="From"></typeparam>
/// <typeparam name="To"></typeparam>
/// <param name="obj"></param>
/// <param name="newObject"></param>
/// <returns></returns>
public static To MapToClass<From, To>(From obj, To newObject) where To : class => FillObject(obj, newObject);
/// <summary>
/// Заполнение объекта
/// </summary>
/// <typeparam name="From"></typeparam>
/// <typeparam name="To"></typeparam>
/// <param name="obj"></param>
/// <param name="newObject"></param>
/// <returns></returns>
private static To FillObject<From, To>(From obj, To newObject)
where To : class
{
if (obj == null)
{
return null;
}
if (newObject == null)
{
return null;
}
var typeFrom = typeof(From);
var typeTo = typeof(To);
var properties = typeTo.GetProperties();
foreach (var property in properties)
{
var customAttribute = property.GetCustomAttribute<MapConfigurationAttribute>();
if (customAttribute != null)
{
object value = obj;
if (customAttribute.IsDifficle)
{
var props = customAttribute.PropertyNameFromModel.Split('.');
foreach (var prop in props)
{
var bindingProperty = value.GetType().GetProperty(prop);
if (bindingProperty != null)
{
value = bindingProperty.GetValue(value);
if (value is null)
{
break;
}
}
else
{
value = null;
break;
}
}
}
else
{
var bindingProperty = typeFrom.GetProperty(customAttribute.PropertyNameFromModel);
if (bindingProperty != null)
{
value = bindingProperty.GetValue(obj);
}
}
if (value is null)
{
continue;
}
property.SetValue(newObject, value);
}
}
return newObject;
}
}
}

View File

@ -0,0 +1,112 @@
using ModuleTools.Extensions;
using ModuleTools.Interfaces;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml.XPath;
namespace ModuleTools.BusinessLogics
{
/// <summary>
/// Загрузчик данных
/// </summary>
public static class ServiceProviderLoader
{
private static readonly string _configFileName = "DepartmentPortal.config";
private static readonly string _pathToImplementationExt = "..\\..\\..\\..\\ImplementationExtensions\\";
private static readonly string _pathToWindowDestopExt = "..\\..\\..\\..\\WindowDestopExtensions\\";
/// <summary>
/// Получение данных с файла настроек
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static string GetConfigData(string key)
{
var fileName = GetFile(_configFileName);
if (!File.Exists(fileName))
{
return string.Empty;
}
var doc = new XPathDocument(fileName);
var nav = doc.CreateNavigator();
var data = nav.SelectDescendants(key, "", false);
data.MoveNext();
return data.Current.Value;
}
/// <summary>
/// Загрузка всех классов-реализаций IImplementationExtension
/// </summary>
/// <returns></returns>
public static List<IImplementationExtension> GetImplementationExtensions()
{
var list = new List<IImplementationExtension>();
if(Directory.Exists(_pathToImplementationExt))
{
var files = Directory.GetFiles(_pathToImplementationExt, "*.dll", SearchOption.AllDirectories);
var loadedFiles = new List<string>();
foreach(var file in files.Distinct())
{
if(loadedFiles.Contains(file.GetFileName()))
{
continue;
}
Assembly asm = Assembly.LoadFrom(file);
foreach (var t in asm.GetExportedTypes())
{
if (t.IsClass && typeof(IImplementationExtension).IsAssignableFrom(t))
{
list.Add((IImplementationExtension)Activator.CreateInstance(t));
}
}
loadedFiles.Add(file.GetFileName());
}
}
return list;
}
/// <summary>
/// Загрузка всех классов-реализаций IWindowDesktopExtension
/// </summary>
/// <returns></returns>
public static List<IWindowDesktopExtension> GetWindowDesktopExtensions()
{
var list = new List<IWindowDesktopExtension>();
if (Directory.Exists(_pathToWindowDestopExt))
{
var files = Directory.GetFiles(_pathToWindowDestopExt, "*.dll", SearchOption.AllDirectories);
var loadedFiles = new List<string>();
foreach (var file in files.Distinct())
{
if (loadedFiles.Contains(file.GetFileName()))
{
continue;
}
Assembly asm = Assembly.LoadFrom(file);
foreach (var t in asm.GetExportedTypes())
{
if (t.IsClass && typeof(IWindowDesktopExtension).IsAssignableFrom(t))
{
list.Add((IWindowDesktopExtension)Activator.CreateInstance(t));
}
}
loadedFiles.Add(file.GetFileName());
}
}
return list;
}
/// <summary>
/// Получение имени файла
/// </summary>
/// <param name="fileName"></param>
/// <returns></returns>
private static string GetFile(string fileName) => Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), fileName);
}
}

View File

@ -0,0 +1,54 @@
using System;
using Unity;
using Unity.Lifetime;
namespace ModuleTools.BusinessLogics
{
/// <summary>
/// Работа с UnityContainer
/// </summary>
public class UnityContainerConfigurator
{
private static IUnityContainer _unityContainer;
public static IUnityContainer Container
{
get
{
if (_unityContainer == null) _unityContainer = new UnityContainer();
return _unityContainer;
}
}
/// <summary>
/// Инициализация сервисов
/// </summary>
public static void InitServices()
{
var ext = ServiceProviderLoader.GetImplementationExtensions();
if (ext.Count == 0)
{
throw new ArgumentNullException("Отсутствуют компоненты для загрузки зависимостей по модулям");
}
// регистрируем в UnityContainaer зависимости
foreach (var e in ext)
{
e.RegisterServices();
}
}
/// <summary>
/// Добавление зависимости
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="U"></typeparam>
public static void PublishService<T, U>() where U : T => Container.RegisterType<T, U>(new HierarchicalLifetimeManager());
/// <summary>
/// Получение класса со всеми зависмостями
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static T Resolve<T>() => Container.Resolve<T>();
}
}

View File

@ -0,0 +1,100 @@
namespace ModuleTools.Enums
{
/// <summary>
/// Операции в системе
/// </summary>
public enum AccessOperation
{
#region Администрирование
Администрирование = 0,
Роли = 1,
Доступы = 2,
Пользователи = 3,
НастройкиСреды = 4,
#endregion
#region База
Кафедра = 100,
Аудитории = 101,
Направления = 102,
Преподаватели = 103, // + должности, звания
Дисциплины = 104, // + Блоки дисциплин
Группы = 105, //
Студенты = 106,
Приказы_студентов = 107,
#endregion
// Меню Учебный процесс
Учебный_процесс = 150,
Учебные_планы = 120,
Видыагрузок = 121,
Учебные_года = 122,
Даты_семестра = 126,
Контингент = 123,
Нормыремени = 124,
Расчет_штатов = 125,
Расчасовки = 127,
Преподавательская_ставка = 128,
Индивидуальный_план = 130,
// Меню Расписание
Расписание = 200,
Расписание_аудитории = 201,
Расписание_группы = 202,
Расписание_преподаватели = 203,
Расписаниеастройки = 204,
Расписание_интервалы_пар = 205,
Расписание_дисциплины = 206,
// Меню Сервис
Сервис = 300,
Генерация_билетов = 301,
// Меню зав лаб
ЗавЛабораторией = 400,
МатериальноТехническиеЦенности = 401,
УстановленоеПО = 402,
// Экзамены - составление билетов и проведение
СоставлениеЭкзаменов = 500,
Ведомости = 501,
ШаблоныБилетов = 502,
// Web-портал
Новости = 600,
Комментарии = 601
}
}

View File

@ -0,0 +1,28 @@
namespace ModuleTools.Enums
{
/// <summary>
/// Тип операции
/// </summary>
public enum AccessType : int
{
/// <summary>
/// Простой просомтр
/// </summary>
SimpleView = 1,
/// <summary>
/// Полный просомтр
/// </summary>
FullView = 2,
/// <summary>
/// Добавление/Изменение
/// </summary>
Change = 4,
/// <summary>
/// Удаление
/// </summary>
Delete = 8
}
}

View File

@ -0,0 +1,38 @@
namespace ModuleTools.Enums
{
/// <summary>
/// Статус результата операции
/// </summary>
public enum ResultServiceStatusCode
{
/// <summary>
/// Успешно
/// </summary>
Success = 200,
/// <summary>
/// Ошибка общая
/// </summary>
Error = 400,
/// <summary>
/// Элемент уже сущствует
/// </summary>
ExsistItem = 401,
/// <summary>
/// Запись удалена
/// </summary>
WasDelete = 402,
/// <summary>
/// Не найдено
/// </summary>
NotFound = 404,
/// <summary>
/// Не найден файл
/// </summary>
FileNotFound = 405
}
}

View File

@ -0,0 +1,28 @@
using System.IO;
namespace ModuleTools.Extensions
{
public static class StringExtension
{
/// <summary>
/// Проверка, что строка пустая
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsEmpty(this string str) => string.IsNullOrEmpty(str);
/// <summary>
/// Проверка, что строка не пустая
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsNotEmpty(this string str) => !string.IsNullOrEmpty(str);
/// <summary>
/// Получение имени файла по полному пути
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string GetFileName(this string str) => (new FileInfo(str)).Name;
}
}

View File

@ -0,0 +1,41 @@
using ModuleTools.BindingModels;
using ModuleTools.Models;
namespace ModuleTools.Interfaces
{
/// <summary>
/// Описание логики для хранилища сущности
/// </summary>
public interface IEntityService<G, S>
where G : GetBindingModel
where S : SetBindingModel
{
/// <summary>
/// Получение списка сущностей
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
OperationResultModel Read(G model);
/// <summary>
/// Создание новой сущности
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
OperationResultModel Create(S model);
/// <summary>
/// Изменение сущности
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
OperationResultModel Update(S model);
/// <summary>
/// Удаление сущности
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
OperationResultModel Delete(G model);
}
}

View File

@ -0,0 +1,13 @@
namespace ModuleTools.Interfaces
{
/// <summary>
/// Интерфейс для регистрации зависимостей в модулях
/// </summary>
public interface IImplementationExtension
{
/// <summary>
/// Регистрация сервисов
/// </summary>
public void RegisterServices();
}
}

View File

@ -0,0 +1,67 @@
using ModuleTools.Models;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace ModuleTools.Interfaces
{
/// <summary>
/// Интерфейс для аутентификации пользователя и проверки доступа к операциям для пользователя
/// </summary>
public interface ISecurityManager
{
/// <summary>
/// Аутентифицированный пользователь
/// </summary>
public Guid? User { get; set; }
/// <summary>
/// Список ролей аутентифицированного пользователь
/// </summary>
public List<Guid> Roles { get; set; }
/// <summary>
/// Выполнена ли аутентификация
/// </summary>
public bool IsAuth { get; }
/// <summary>
/// Сообщение с причиной не получения доступа
/// </summary>
string ErrorMessage { get; set; }
/// <summary>
/// Авторизация пользователя к операции
/// </summary>
/// <param name="model">Данные по операции</param>
/// <returns></returns>
bool CheckAccess(SecurityManagerCheckAccessModel model);
/// <summary>
/// Проверка наличия старотвых данных для работы с ситемой
/// </summary>
void CheckStartDataSource();
/// <summary>
/// Аутентификация пользователя
/// </summary>
/// <param name="login"></param>
/// <param name="password"></param>
/// <returns></returns>
Task LoginAsync(string login, string password);
/// <summary>
/// Выход из системы
/// </summary>
/// <returns></returns>
Task LogoutAsync();
/// <summary>
/// Смена пароля
/// </summary>
/// <param name="login"></param>
/// <param name="oldPassword"></param>
/// <param name="newPassword"></param>
Task ChangePassword(string login, string oldPassword, string newPassword);
}
}

View File

@ -0,0 +1,17 @@
using ModuleTools.Models;
using System.Collections.Generic;
namespace ModuleTools.Interfaces
{
/// <summary>
/// Интерфейс для регистрации контролов для десктопного приложения
/// </summary>
public interface IWindowDesktopExtension
{
/// <summary>
/// Получение списка контролов модуля, доступных для работы по авторизованному пользователю
/// </summary>
/// <returns></returns>
List<WindowDesktopExtensionControlModel> GetListControlEntityList();
}
}

View File

@ -0,0 +1,114 @@
using ModuleTools.Enums;
using System;
using System.Collections.Generic;
namespace ModuleTools.Models
{
/// <summary>
/// Результат любой операции с сущностью
/// </summary>
public class OperationResultModel
{
/// <summary>
/// Успешность операции (количество ошибок = 0)
/// </summary>
public bool IsSucceeded => Errors.Count == 0;
/// <summary>
/// Статус операции
/// </summary>
public ResultServiceStatusCode StatusCode { get; set; }
/// <summary>
/// Спсиок ошибок
/// </summary>
public List<(string Title, string Message)> Errors { get; private set; }
/// <summary>
/// Объект, получаемый по результатам операции
/// </summary>
public object Result { get; private set; }
/// <summary>
/// Конструктор по умолчанию
/// </summary>
public OperationResultModel()
{
Errors = new List<(string Title, string Message)>();
StatusCode = ResultServiceStatusCode.Success;
}
/// <summary>
/// Успешно
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public static OperationResultModel Success(object obj)
{
return new OperationResultModel
{
Result = obj,
Errors = new List<(string Title, string Message)>(),
StatusCode = ResultServiceStatusCode.Success
};
}
/// <summary>
/// Добавление простой ошибки
/// </summary>
/// <param name="model"></param>
/// <param name="key"></param>
/// <param name="value"></param>
public static OperationResultModel Error(string key, string value) => Error(key, value, ResultServiceStatusCode.Error);
/// <summary>
/// Добавление простой ошибки со сменой статуса
/// </summary>
/// <param name="model"></param>
/// <param name="key"></param>
/// <param name="error"></param>
/// <param name="statusCode"></param>
public static OperationResultModel Error(string key, string error, ResultServiceStatusCode statusCode)
{
var model = new OperationResultModel();
model.Errors.Add((key, error));
model.StatusCode = statusCode;
return model;
}
/// <summary>
/// Добавление ошибки
/// </summary>
/// <param name="model"></param>
/// <param name="error"></param>
public static OperationResultModel Error(Exception error) => Error(error, ResultServiceStatusCode.Error);
/// <summary>
/// Добавление ошибки
/// </summary>
/// <param name="model"></param>
/// <param name="error"></param>
/// <param name="statusCode"></param>
public static OperationResultModel Error(Exception error, ResultServiceStatusCode statusCode) => Error("Ошибка", error, statusCode);
/// <summary>
/// Добавление ошибки (включая вложеннные)
/// </summary>
/// <param name="model"></param>
/// <param name="key"></param>
/// <param name="error"></param>
/// <param name="statusCode"></param>
public static OperationResultModel Error(string key, Exception error, ResultServiceStatusCode statusCode)
{
var model = new OperationResultModel();
model.Errors.Add((key, error.Message));
while (error.InnerException != null)
{
error = error.InnerException;
model.Errors.Add(("Inner error:", error.Message));
}
model.StatusCode = statusCode;
return model;
}
}
}

View File

@ -0,0 +1,39 @@
using ModuleTools.BindingModels;
using ModuleTools.Enums;
namespace ModuleTools.Models
{
/// <summary>
/// Данные для проверки доступа
/// </summary>
public class SecurityManagerCheckAccessModel
{
/// <summary>
/// Данные по пользователю
/// </summary>
public AccessBindingModel Model { get; set; }
/// <summary>
/// Операция, которую хотят выполнить
/// </summary>
public AccessOperation Operation { get; set; }
/// <summary>
/// Тип операции
/// </summary>
public AccessType Type { get; set; }
/// <summary>
/// Для какой сущности
/// </summary>
public string Entity { get; set; }
public SecurityManagerCheckAccessModel(AccessBindingModel model, AccessOperation operation, AccessType type, string entity)
{
Model = model;
Operation = operation;
Type = type;
Entity = entity;
}
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ModuleTools.Models
{
public class WindowDesktopExtensionControlModel
{
public Guid Id { get; set; }
public int Order { get; set; }
public string Title { get; set; }
public object Control { get; set; }
}
}

View File

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Unity" Version="5.11.10" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,15 @@
using ModuleTools.Attributes;
using System;
namespace ModuleTools.ViewModels
{
/// <summary>
/// Возвращаемая запись
/// </summary>
public class ElementViewModel
{
[ViewModelOnListProperty("Идентификатор", isHide: true)]
[MapConfiguration("Id")]
public Guid Id { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System.Collections.Generic;
namespace ModuleTools.ViewModels
{
/// <summary>
/// Список возвращаемых значений
/// </summary>
/// <typeparam name="T"></typeparam>
public class ListViewModel<T>
where T : ElementViewModel
{
public int MaxCount { get; set; }
public List<T> List { get; set; }
}
}

View File

@ -7,8 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{6F154F
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabaseCore", "Common\DatabaseCore\DatabaseCore.csproj", "{D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabaseCore", "Common\DatabaseCore\DatabaseCore.csproj", "{D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModelTools", "Common\ModelTools\ModelTools.csproj", "{8BE3C29B-6E9F-4DFC-BAC3-14229D58616F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "Security", "{7DA26C36-778E-4563-9AEC-966E26EA7B2A}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "Security", "{7DA26C36-778E-4563-9AEC-966E26EA7B2A}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityBusinessLogic", "Security\SecurityBusinessLogic\SecurityBusinessLogic.csproj", "{D424B54F-AF26-4A39-8D2B-CF874F31DE42}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityBusinessLogic", "Security\SecurityBusinessLogic\SecurityBusinessLogic.csproj", "{D424B54F-AF26-4A39-8D2B-CF874F31DE42}"
@ -21,6 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityWindowsDesktop", "S
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecurityDatabaseImplementation", "Security\SecurityDatabaseImplementation\SecurityDatabaseImplementation.csproj", "{26FCAAC6-F8F4-4CE6-92FE-1C6C376E5DE6}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecurityDatabaseImplementation", "Security\SecurityDatabaseImplementation\SecurityDatabaseImplementation.csproj", "{26FCAAC6-F8F4-4CE6-92FE-1C6C376E5DE6}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModuleTools", "Common\ModuleTools\ModuleTools.csproj", "{84CD6D9F-9B38-4392-B8A5-4FD32CF54BEC}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -31,10 +31,6 @@ Global
{D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}.Debug|Any CPU.Build.0 = Debug|Any CPU {D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}.Release|Any CPU.ActiveCfg = Release|Any CPU {D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}.Release|Any CPU.Build.0 = Release|Any CPU {D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}.Release|Any CPU.Build.0 = Release|Any CPU
{8BE3C29B-6E9F-4DFC-BAC3-14229D58616F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8BE3C29B-6E9F-4DFC-BAC3-14229D58616F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8BE3C29B-6E9F-4DFC-BAC3-14229D58616F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8BE3C29B-6E9F-4DFC-BAC3-14229D58616F}.Release|Any CPU.Build.0 = Release|Any CPU
{D424B54F-AF26-4A39-8D2B-CF874F31DE42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D424B54F-AF26-4A39-8D2B-CF874F31DE42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D424B54F-AF26-4A39-8D2B-CF874F31DE42}.Debug|Any CPU.Build.0 = Debug|Any CPU {D424B54F-AF26-4A39-8D2B-CF874F31DE42}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D424B54F-AF26-4A39-8D2B-CF874F31DE42}.Release|Any CPU.ActiveCfg = Release|Any CPU {D424B54F-AF26-4A39-8D2B-CF874F31DE42}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -55,17 +51,21 @@ Global
{26FCAAC6-F8F4-4CE6-92FE-1C6C376E5DE6}.Debug|Any CPU.Build.0 = Debug|Any CPU {26FCAAC6-F8F4-4CE6-92FE-1C6C376E5DE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26FCAAC6-F8F4-4CE6-92FE-1C6C376E5DE6}.Release|Any CPU.ActiveCfg = Release|Any CPU {26FCAAC6-F8F4-4CE6-92FE-1C6C376E5DE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26FCAAC6-F8F4-4CE6-92FE-1C6C376E5DE6}.Release|Any CPU.Build.0 = Release|Any CPU {26FCAAC6-F8F4-4CE6-92FE-1C6C376E5DE6}.Release|Any CPU.Build.0 = Release|Any CPU
{84CD6D9F-9B38-4392-B8A5-4FD32CF54BEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84CD6D9F-9B38-4392-B8A5-4FD32CF54BEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84CD6D9F-9B38-4392-B8A5-4FD32CF54BEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84CD6D9F-9B38-4392-B8A5-4FD32CF54BEC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E} {D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E}
{8BE3C29B-6E9F-4DFC-BAC3-14229D58616F} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E}
{D424B54F-AF26-4A39-8D2B-CF874F31DE42} = {7DA26C36-778E-4563-9AEC-966E26EA7B2A} {D424B54F-AF26-4A39-8D2B-CF874F31DE42} = {7DA26C36-778E-4563-9AEC-966E26EA7B2A}
{6B923E2B-85EE-4490-81BA-C7AB5DB582AC} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E} {6B923E2B-85EE-4490-81BA-C7AB5DB582AC} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E}
{40F7C37A-3544-4A6A-893D-D611DE100036} = {7DA26C36-778E-4563-9AEC-966E26EA7B2A} {40F7C37A-3544-4A6A-893D-D611DE100036} = {7DA26C36-778E-4563-9AEC-966E26EA7B2A}
{26FCAAC6-F8F4-4CE6-92FE-1C6C376E5DE6} = {7DA26C36-778E-4563-9AEC-966E26EA7B2A} {26FCAAC6-F8F4-4CE6-92FE-1C6C376E5DE6} = {7DA26C36-778E-4563-9AEC-966E26EA7B2A}
{84CD6D9F-9B38-4392-B8A5-4FD32CF54BEC} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FBA0CB49-EF2D-4538-9D00-FCEDA24879A9} SolutionGuid = {FBA0CB49-EF2D-4538-9D00-FCEDA24879A9}

View File

@ -1,8 +1,7 @@
using DesktopTools.BusinessLogics; using DesktopTools.BusinessLogics;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Extensions; using ModuleTools.Extensions;
using ModelTools.Interfaces; using ModuleTools.Interfaces;
using SecurityBusinessLogic.BusinessLogics;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;

View File

@ -1,5 +1,5 @@
using DesktopTools.Controls; using DesktopTools.Controls;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -1,7 +1,6 @@
using DatabaseCore; using DatabaseCore;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Interfaces; using ModuleTools.Interfaces;
using SecurityBusinessLogic.BusinessLogics;
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;

View File

@ -1,5 +1,5 @@
using ModelTools.BindingModels; using ModuleTools.BindingModels;
using ModelTools.Enums; using ModuleTools.Enums;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;

View File

@ -1,4 +1,4 @@
using ModelTools.BindingModels; using ModuleTools.BindingModels;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace SecurityBusinessLogic.BindingModels namespace SecurityBusinessLogic.BindingModels

View File

@ -1,4 +1,4 @@
using ModelTools.BindingModels; using ModuleTools.BindingModels;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace SecurityBusinessLogic.BindingModels namespace SecurityBusinessLogic.BindingModels

View File

@ -1,4 +1,4 @@
using ModelTools.BindingModels; using ModuleTools.BindingModels;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;

View File

@ -1,6 +1,6 @@
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using ModelTools.Models; using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces; using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -1,6 +1,6 @@
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using ModelTools.Models; using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces; using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -1,6 +1,6 @@
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using ModelTools.Models; using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces; using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -1,6 +1,6 @@
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using ModelTools.Models; using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces; using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -1,4 +1,4 @@
using ModelTools.Interfaces; using ModuleTools.Interfaces;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
namespace SecurityBusinessLogic.Interfaces namespace SecurityBusinessLogic.Interfaces

View File

@ -1,4 +1,4 @@
using ModelTools.Interfaces; using ModuleTools.Interfaces;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
namespace SecurityBusinessLogic.Interfaces namespace SecurityBusinessLogic.Interfaces

View File

@ -1,4 +1,4 @@
using ModelTools.Interfaces; using ModuleTools.Interfaces;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
namespace SecurityBusinessLogic.Interfaces namespace SecurityBusinessLogic.Interfaces

View File

@ -1,4 +1,4 @@
using ModelTools.Interfaces; using ModuleTools.Interfaces;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
namespace SecurityBusinessLogic.Interfaces namespace SecurityBusinessLogic.Interfaces

View File

@ -4,12 +4,12 @@
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\ModelTools\ModelTools.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Enums\" /> <Folder Include="Enums\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\ModuleTools\ModuleTools.csproj" />
</ItemGroup>
</Project> </Project>

View File

@ -1,6 +1,6 @@
using ModelTools.Attributes; using ModuleTools.Attributes;
using ModelTools.Enums; using ModuleTools.Enums;
using ModelTools.ViewModels; using ModuleTools.ViewModels;
using System; using System;
namespace SecurityBusinessLogic.ViewModels namespace SecurityBusinessLogic.ViewModels

View File

@ -1,5 +1,5 @@
using ModelTools.Attributes; using ModuleTools.Attributes;
using ModelTools.ViewModels; using ModuleTools.ViewModels;
namespace SecurityBusinessLogic.ViewModels namespace SecurityBusinessLogic.ViewModels
{ {

View File

@ -1,5 +1,5 @@
using ModelTools.Attributes; using ModuleTools.Attributes;
using ModelTools.ViewModels; using ModuleTools.ViewModels;
namespace SecurityBusinessLogic.ViewModels namespace SecurityBusinessLogic.ViewModels
{ {

View File

@ -1,5 +1,5 @@
using ModelTools.Attributes; using ModuleTools.Attributes;
using ModelTools.ViewModels; using ModuleTools.ViewModels;
using System; using System;
namespace SecurityBusinessLogic.ViewModels namespace SecurityBusinessLogic.ViewModels

View File

@ -1,10 +1,10 @@
using DatabaseCore; using DatabaseCore;
using DatabaseCore.Models.Security; using DatabaseCore.Models.Security;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using ModelTools.Extensions; using ModuleTools.Extensions;
using ModelTools.Models; using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces; using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -1,9 +1,9 @@
using DatabaseCore; using DatabaseCore;
using DatabaseCore.Models.Security; using DatabaseCore.Models.Security;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using ModelTools.Extensions; using ModuleTools.Extensions;
using ModelTools.Models; using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces; using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -1,8 +1,8 @@
using DatabaseCore; using DatabaseCore;
using DatabaseCore.Models.Security; using DatabaseCore.Models.Security;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using ModelTools.Models; using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces; using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -1,8 +1,8 @@
using DatabaseCore; using DatabaseCore;
using DatabaseCore.Models.Security; using DatabaseCore.Models.Security;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using ModelTools.Models; using ModuleTools.Models;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.Interfaces; using SecurityBusinessLogic.Interfaces;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -6,7 +6,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Common\DatabaseCore\DatabaseCore.csproj" /> <ProjectReference Include="..\..\Common\DatabaseCore\DatabaseCore.csproj" />
<ProjectReference Include="..\..\Common\ModelTools\ModelTools.csproj" />
<ProjectReference Include="..\SecurityBusinessLogic\SecurityBusinessLogic.csproj" /> <ProjectReference Include="..\SecurityBusinessLogic\SecurityBusinessLogic.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -1,5 +1,5 @@
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Interfaces; using ModuleTools.Interfaces;
using SecurityBusinessLogic.Interfaces; using SecurityBusinessLogic.Interfaces;
using SecurityImplementation.SecurityDatabaseImplementation; using SecurityImplementation.SecurityDatabaseImplementation;

View File

@ -1,7 +1,7 @@
using DesktopTools.Controls; using DesktopTools.Controls;
using DesktopTools.Models; using DesktopTools.Models;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics; using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -1,7 +1,7 @@
using DesktopTools.Controls; using DesktopTools.Controls;
using DesktopTools.Models; using DesktopTools.Models;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics; using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -1,7 +1,7 @@
using DesktopTools.Controls; using DesktopTools.Controls;
using DesktopTools.Models; using DesktopTools.Models;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics; using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -1,7 +1,7 @@
using DesktopTools.Controls; using DesktopTools.Controls;
using DesktopTools.Models; using DesktopTools.Models;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using SecurityBusinessLogic.BindingModels; using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics; using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels; using SecurityBusinessLogic.ViewModels;

View File

@ -1,9 +1,9 @@
using DesktopTools.Controls; using DesktopTools.Controls;
using ModelTools.BindingModels; using ModuleTools.BindingModels;
using ModelTools.BusinessLogics; using ModuleTools.BusinessLogics;
using ModelTools.Enums; using ModuleTools.Enums;
using ModelTools.Interfaces; using ModuleTools.Interfaces;
using ModelTools.Models; using ModuleTools.Models;
using SecurityBusinessLogic.BusinessLogics; using SecurityBusinessLogic.BusinessLogics;
using SecurityWindowsDesktop.Controls; using SecurityWindowsDesktop.Controls;
using System.Collections.Generic; using System.Collections.Generic;