I hope contracts is done

This commit is contained in:
Никита Волков 2024-05-20 01:11:07 +04:00
parent eb4b90f43f
commit 242c0c3a4e
30 changed files with 560 additions and 0 deletions

View File

@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonnelDepartmentView", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonnelDepartmentDataModels", "PersonnelDepartmentDataModels\PersonnelDepartmentDataModels.csproj", "{CE6C1F1A-D6DB-4AA1-9F79-5A8CCB1C812C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonnelDepartmentContracts", "PersonnelDepartmentContracts\PersonnelDepartmentContracts.csproj", "{BE6B55EA-E7C1-4F66-B481-0CC9435922DD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -21,6 +23,10 @@ Global
{CE6C1F1A-D6DB-4AA1-9F79-5A8CCB1C812C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE6C1F1A-D6DB-4AA1-9F79-5A8CCB1C812C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE6C1F1A-D6DB-4AA1-9F79-5A8CCB1C812C}.Release|Any CPU.Build.0 = Release|Any CPU
{BE6B55EA-E7C1-4F66-B481-0CC9435922DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE6B55EA-E7C1-4F66-B481-0CC9435922DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE6B55EA-E7C1-4F66-B481-0CC9435922DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE6B55EA-E7C1-4F66-B481-0CC9435922DD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BindingModels
{
public class BackUpBinidngModel
{
public string FolderName { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,26 @@
using PersonnelDepartmentDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BindingModels
{
public class DealBindingModel : IDealModel
{
public DateTime DateFrom { get; set; }
public DateTime DateTo { get; set; }
public int PositionId { get; set; }
public int EmployeeId { get; set; }
public int DepartmentId { get; set; }
public int TypeId { get; set; }
public int Id { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using PersonnelDepartmentDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BindingModels
{
public class DepartmentBindingModel : IDepartmentModel
{
public string Name { get; set; } = string.Empty;
public long Telephone { get; set; }
public int Id { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using PersonnelDepartmentDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BindingModels
{
public class EmployeeBindingModel : IEmployeeModel
{
public string FirstName { get ;set; } = string.Empty;
public string LastName { get; set; } = string.Empty;
public string Patronymic { get; set; } = string.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using PersonnelDepartmentDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BindingModels
{
public class PositionBindingModel : IPositionModel
{
public string Name { get; set; } = string.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using PersonnelDepartmentDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BindingModels
{
public class TypeBindingModel : ITypeModel
{
public string Name { get; set; } = string.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using PersonnelDepartmentContracts.BindingModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BusinessLogicContracts
{
public interface IBackUpLogic
{
void CreateBackUp(BackUpBinidngModel model);
}
}

View File

@ -0,0 +1,24 @@
using PersonnelDepartmentContracts.BindingModels;
using PersonnelDepartmentContracts.SearchModels;
using PersonnelDepartmentContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BusinessLogicContracts
{
public interface IDealLogic
{
List<DealViewModel>? ReadList(DealSearchModel? model);
DealViewModel? ReadElement(DealSearchModel model);
bool Create(DealBindingModel model);
bool Update(DealBindingModel model);
bool Delete(DealBindingModel model);
string SetTest(int count);
string GetTest(int count);
string DiffGetTest(int count);
bool ClearList();
}
}

View File

@ -0,0 +1,20 @@
using PersonnelDepartmentContracts.BindingModels;
using PersonnelDepartmentContracts.SearchModels;
using PersonnelDepartmentContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BusinessLogicContracts
{
public interface IDepartmentLogic
{
List<DepartmentViewModel>? ReadList(DepartmentSearchModel? model);
DepartmentViewModel? ReadElement(DepartmentSearchModel model);
bool Create(DepartmentBindingModel model);
bool Update(DepartmentBindingModel model);
bool Delete(DepartmentBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using PersonnelDepartmentContracts.BindingModels;
using PersonnelDepartmentContracts.SearchModels;
using PersonnelDepartmentContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BusinessLogicContracts
{
public interface IEmployeeLogic
{
List<EmployeeViewModel>? ReadList(EmployeeSearchModel? model);
EmployeeViewModel? ReadElement(EmployeeSearchModel model);
bool Create(EmployeeBindingModel model);
bool Update(EmployeeBindingModel model);
bool Delete(EmployeeBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using PersonnelDepartmentContracts.BindingModels;
using PersonnelDepartmentContracts.SearchModels;
using PersonnelDepartmentContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BusinessLogicContracts
{
public interface IPositionLogic
{
List<PositionViewModel>? ReadList(PositionSearchModel? model);
PositionViewModel? ReadElement(PositionSearchModel model);
bool Create(PositionBindingModel model);
bool Update(PositionBindingModel model);
bool Delete(PositionBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using PersonnelDepartmentContracts.BindingModels;
using PersonnelDepartmentContracts.SearchModels;
using PersonnelDepartmentContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.BusinessLogicContracts
{
public interface ITypeLogic
{
List<TypeViewModel>? ReadList(TypeSearchModel? model);
TypeViewModel? ReadElement(TypeSearchModel model);
bool Create(TypeBindingModel model);
bool Update(TypeBindingModel model);
bool Delete(TypeBindingModel model);
}
}

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.SearchModels
{
public class DealSearchModel
{
public int? Id { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
public int? PositionId { get; set; }
public int? EmployeeId { get; set; }
public int? DepartmentId { get; set; }
public int? TypeId { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.SearchModels
{
public class DepartmentSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
public long? Telephone { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.SearchModels
{
public class EmployeeSearchModel
{
public int? Id { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? Patronymic { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.SearchModels
{
public class PositionSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.SearchModels
{
public class TypeSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.StoragesContracts
{
public interface IBackUpInfo
{
List<T>? GetList<T>() where T : class, new();
Type? GetTypeByModelInterface(string modelInterfaceName);
}
}

View File

@ -0,0 +1,25 @@
using PersonnelDepartmentContracts.BindingModels;
using PersonnelDepartmentContracts.SearchModels;
using PersonnelDepartmentContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.StoragesContracts
{
public interface IDealStorage
{
List<DealViewModel> GetFullList();
List<DealViewModel> GetFilteredList(DealSearchModel model);
DealViewModel? GetElement(DealSearchModel model);
DealViewModel? Insert(DealBindingModel model);
DealViewModel? Update(DealBindingModel model);
DealViewModel? Delete(DealBindingModel model);
string SetTest(int count);
string GetTest(int count);
string DiffGetTest(int count);
bool ClearList();
}
}

View File

@ -0,0 +1,21 @@
using PersonnelDepartmentContracts.BindingModels;
using PersonnelDepartmentContracts.SearchModels;
using PersonnelDepartmentContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.StoragesContracts
{
public interface IDepartmentStorage
{
List<DepartmentViewModel> GetFullList();
List<DepartmentViewModel> GetFilteredList(DepartmentSearchModel model);
DepartmentViewModel? GetElement(DepartmentSearchModel model);
DepartmentViewModel? Insert(DepartmentBindingModel model);
DepartmentViewModel? Update(DepartmentBindingModel model);
DepartmentViewModel? Delete(DepartmentBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using PersonnelDepartmentContracts.BindingModels;
using PersonnelDepartmentContracts.SearchModels;
using PersonnelDepartmentContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.StoragesContracts
{
public interface IEmployeeStorage
{
List<EmployeeViewModel> GetFullList();
List<EmployeeViewModel> GetFilteredList(EmployeeSearchModel model);
EmployeeViewModel? GetElement(EmployeeSearchModel model);
EmployeeViewModel? Insert(EmployeeBindingModel model);
EmployeeViewModel? Update(EmployeeBindingModel model);
EmployeeViewModel? Delete(EmployeeBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using PersonnelDepartmentContracts.BindingModels;
using PersonnelDepartmentContracts.SearchModels;
using PersonnelDepartmentContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.StoragesContracts
{
public interface IPositionStorage
{
List<PositionViewModel> GetFullList();
List<PositionViewModel> GetFilteredList(PositionSearchModel model);
PositionViewModel? GetElement(PositionSearchModel model);
PositionViewModel? Insert(PositionBindingModel model);
PositionViewModel? Update(PositionBindingModel model);
PositionViewModel? Delete(PositionBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using PersonnelDepartmentContracts.BindingModels;
using PersonnelDepartmentContracts.SearchModels;
using PersonnelDepartmentContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelTypeContracts.StoragesContracts
{
public interface ITypeStorage
{
List<TypeViewModel> GetFullList();
List<TypeViewModel> GetFilteredList(TypeSearchModel model);
TypeViewModel? GetElement(TypeSearchModel model);
TypeViewModel? Insert(TypeBindingModel model);
TypeViewModel? Update(TypeBindingModel model);
TypeViewModel? Delete(TypeBindingModel model);
}
}

View File

@ -0,0 +1,32 @@
using PersonnelDepartmentDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.ViewModels
{
public class DealViewModel : IDealModel
{
[DisplayName("Дата с")]
public DateTime DateFrom { get; set; }
[DisplayName("Дата по")]
public DateTime DateTo { get; set; }
public int PositionId { get; set; }
[DisplayName("Должность")]
public string PositionName { get; set; } = string.Empty;
public int EmployeeId { get; set; }
[DisplayName("ФИО Сотрудника")]
public string EmployeeName { get; set; } = string.Empty;
public int DepartmentId { get; set; }
[DisplayName("Отдел")]
public string DepartmentName { get; set; } = string.Empty;
public int TypeId { get; set; }
[DisplayName("Тип договора")]
public string TypeName { get; set; } = string.Empty;
[DisplayName("Номер")]
public int Id { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using PersonnelDepartmentDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.ViewModels
{
public class DepartmentViewModel : IDepartmentModel
{
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
[DisplayName("Контактный телефон")]
public long Telephone { get; set; }
[DisplayName("Код")]
public int Id { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using PersonnelDepartmentDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.ViewModels
{
public class EmployeeViewModel : IEmployeeModel
{
[DisplayName("Имя")]
public string FirstName { get; set; } = string.Empty;
[DisplayName("Фамилия")]
public string LastName { get; set; } = string.Empty;
[DisplayName("Отчество")]
public string Patronymic { get; set; } = string.Empty;
[DisplayName("Код")]
public int Id { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using PersonnelDepartmentDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.ViewModels
{
public class PositionViewModel : IPositionModel
{
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
[DisplayName("Код")]
public int Id { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using PersonnelDepartmentDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonnelDepartmentContracts.ViewModels
{
public class TypeViewModel : ITypeModel
{
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
[DisplayName("Код")]
public int Id { get; set; }
}
}