Модели + контракты

This commit is contained in:
Марат Заргаров 2023-04-08 12:47:51 +04:00
parent 15f06ee8c1
commit effd31dcb8
52 changed files with 1012 additions and 0 deletions

31
CarCenter/CarCenter.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarCenterContracts", "CarCenterContracts\CarCenterContracts.csproj", "{AB1C6688-AF33-416D-9D4A-D8EDF252678B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarCenterDataModels", "CarCenterDataModels\CarCenterDataModels.csproj", "{C924311C-ABF3-44A1-A006-8197A11FB29A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AB1C6688-AF33-416D-9D4A-D8EDF252678B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB1C6688-AF33-416D-9D4A-D8EDF252678B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB1C6688-AF33-416D-9D4A-D8EDF252678B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB1C6688-AF33-416D-9D4A-D8EDF252678B}.Release|Any CPU.Build.0 = Release|Any CPU
{C924311C-ABF3-44A1-A006-8197A11FB29A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C924311C-ABF3-44A1-A006-8197A11FB29A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C924311C-ABF3-44A1-A006-8197A11FB29A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C924311C-ABF3-44A1-A006-8197A11FB29A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0861E450-FDCE-4819-9489-9CE16E4FD2B7}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,24 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BindingModels
{
public class BossBindingModel : IBossModel
{
public string Login { get; set; } = String.Empty;
public string Password { get; set; } = String.Empty;
public string Name { get; set; } = String.Empty;
public string Surname { get; set; } = String.Empty;
public string? Patronymic { get; set; } = String.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BindingModels
{
public class CarBindingModel : ICarModel
{
public String Name { get; set; }
public int Id { get; set; }
public Dictionary<int, IPresaleModel> CarPresales { get; set; } = new();
public Dictionary<int, IConfigurationModel> CarConfigurations { get; set; } = new();
public int EmployeeId { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BindingModels
{
public class ConfigurationBindingModel : IConfigurationModel
{
public string Name { get; set; } = String.Empty;
public int Id { get; set; }
public int BossId { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BindingModels
{
public class EmployeeBindingModel : IEmployeeModel
{
public string Login { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string Surname { get; set; } = string.Empty;
public string? Patronymic { get; set; } = string.Empty;
public int Id {get; set; }
}
}

View File

@ -0,0 +1,18 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BindingModels
{
public class PresaleBindingModel : IPresaleModel
{
public int EmployeeId { get; set; }
public DateTime PresaleDate { get; set; } = DateTime.Now;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BindingModels
{
public class ReceiptBindingModel : IReceiptModel
{
public float Sum { get; set; }
public DateTime ReceiptDate { get; set; } = DateTime.Now.Date;
public int BossId { get; set; }
public int ConfigurationId { get; set; }
public int Id { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BindingModels
{
public class SaleBindingModel : ISaleModel
{
public int Id { get; set; }
public float Sum { get; set; }
public DateTime SaleDateTime { get; set; } = DateTime.Now;
public int CarId { get; set; }
public int ReceiptId { get; set; }
public int ConfigurationId { get; set; }
public int EmployeeId { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BindingModels
{
public class TypeOfJobBindingModel : ITypeOfJobModel
{
public string Name { get; set; } = String.Empty;
public Dictionary<int, IConfigurationModel> TypeOfJobConfigurations { get; set; } = new();
public int Id { get; set; }
public int BossId { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BusinessLogicsContracts
{
public interface IBossLogic
{
List<BossViewModel>? ReadList(BossSearchModel? model);
BossViewModel? ReadElement(BossSearchModel model);
bool Create(BossBindingModel model);
bool Update(BossBindingModel model);
bool Delete(BossBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BusinessLogicsContracts
{
public interface ICarLogic
{
List<CarViewModel>? ReadList(CarSearchModel? model);
CarViewModel? ReadElement(CarSearchModel model);
bool Create(CarBindingModel model);
bool Update(CarBindingModel model);
bool Delete(CarBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BusinessLogicsContracts
{
public interface IConfigurationLogic
{
List<ConfigurationViewModel>? ReadList(ConfigurationSearchModel? model);
ConfigurationViewModel? ReadElement(ConfigurationSearchModel model);
bool Create(ConfigurationBindingModel model);
bool Update(ConfigurationBindingModel model);
bool Delete(ConfigurationBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BusinessLogicsContracts
{
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 CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BusinessLogicsContracts
{
public interface IPresaleLogic
{
List<PresaleViewModel>? ReadList(PresaleSearchModel? model);
PresaleViewModel? ReadElement(PresaleSearchModel model);
bool Create(PresaleBindingModel model);
bool Update(PresaleBindingModel model);
bool Delete(PresaleBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BusinessLogicsContracts
{
public interface IReceiptLogic
{
List<ReceiptViewModel>? ReadList(ReceiptSearchModel? model);
ReceiptViewModel? ReadElement(ReceiptSearchModel model);
bool Create(ReceiptBindingModel model);
bool Update(ReceiptBindingModel model);
bool Delete(ReceiptBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BusinessLogicsContracts
{
public interface ISaleLogic
{
List<SaleViewModel>? ReadList(SaleSearchModel? model);
SaleViewModel? ReadElement(SaleSearchModel model);
bool Create(SaleBindingModel model);
bool Update(SaleBindingModel model);
bool Delete(SaleBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.BusinessLogicsContracts
{
public interface ITypeOfJobLogic
{
List<TypeOfJobViewModel>? ReadList(TypeOfJobSearchModel? model);
TypeOfJobViewModel? ReadElement(TypeOfJobSearchModel model);
bool Create(TypeOfJobBindingModel model);
bool Update(TypeOfJobBindingModel model);
bool Delete(TypeOfJobBindingModel model);
}
}

View File

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Новая папка\**" />
<EmbeddedResource Remove="Новая папка\**" />
<None Remove="Новая папка\**" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CarCenterDataModels\CarCenterDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.SearchModels
{
public class BossSearchModel
{
public int? Id { get; set; }
public string? Login { get; set; }
public string? Password { 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 CarCenterContracts.SearchModels
{
public class CarSearchModel
{
public int? Id { get; set; }
public int? EmployeeId { 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 CarCenterContracts.SearchModels
{
public class ConfigurationSearchModel
{
public int? Id { get; set; }
public int? BossId { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.SearchModels
{
public class EmployeeSearchModel
{
public int? Id { get; set; }
public string? Login { get; set; }
public string? Password { 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 CarCenterContracts.SearchModels
{
public class PresaleSearchModel
{
public int? Id { get; set; }
public int? EmployeeId { 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 CarCenterContracts.SearchModels
{
public class ReceiptSearchModel
{
public int? Id { get; set; }
public int? BossId { 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 CarCenterContracts.SearchModels
{
public class SaleSearchModel
{
public int? Id { get; set; }
public int? EmployeeId { 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 CarCenterContracts.SearchModels
{
public class TypeOfJobSearchModel
{
public int? Id { get; set; }
public int? BossId { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.StoragesContracts
{
public interface IBossStorage
{
List<BossViewModel> GetFullList();
List<BossViewModel> GetFilteredList(BossSearchModel model);
BossViewModel? GetElement(BossSearchModel model);
BossViewModel? Insert(BossBindingModel model);
BossViewModel? Update(BossBindingModel model);
BossViewModel? Delete(BossBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.StoragesContracts
{
public interface ICarStorage
{
List<CarViewModel> GetFullList();
List<CarViewModel> GetFilteredList(CarSearchModel model);
CarViewModel? GetElement(CarSearchModel model);
CarViewModel? Insert(CarBindingModel model);
CarViewModel? Update(CarBindingModel model);
CarViewModel? Delete(CarBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.StoragesContracts
{
public interface IConfigurationStorage
{
List<ConfigurationViewModel> GetFullList();
List<ConfigurationViewModel> GetFilteredList(ConfigurationSearchModel model);
ConfigurationViewModel? GetElement(ConfigurationSearchModel model);
ConfigurationViewModel? Insert(ConfigurationBindingModel model);
ConfigurationViewModel? Update(ConfigurationBindingModel model);
ConfigurationViewModel? Delete(ConfigurationBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.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 CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.StoragesContracts
{
public interface IPresaleStorage
{
List<PresaleViewModel> GetFullList();
List<PresaleViewModel> GetFilteredList(PresaleSearchModel model);
PresaleViewModel? GetElement(PresaleSearchModel model);
PresaleViewModel? Insert(PresaleBindingModel model);
PresaleViewModel? Update(PresaleBindingModel model);
PresaleViewModel? Delete(PresaleBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CarCenterContracts.ViewModels;
namespace CarCenterContracts.StoragesContracts
{
public interface IReceiptStorage
{
List<ReceiptViewModel> GetFullList();
List<ReceiptViewModel> GetFilteredList(ReceiptSearchModel model);
ReceiptViewModel? GetElement(ReceiptSearchModel model);
ReceiptViewModel? Insert(ReceiptBindingModel model);
ReceiptViewModel? Update(ReceiptBindingModel model);
ReceiptViewModel? Delete(ReceiptBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using CarCenterContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.StoragesContracts
{
public interface ISaleStorage
{
List<SaleViewModel> GetFullList();
List<SaleViewModel> GetFilteredList(SaleSearchModel model);
SaleViewModel? GetElement(SaleSearchModel model);
SaleViewModel? Insert(SaleBindingModel model);
SaleViewModel? Update(SaleBindingModel model);
SaleViewModel? Delete(SaleBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using CarCenterContracts.BindingModels;
using CarCenterContracts.SearchModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CarCenterContracts.ViewModels;
namespace CarCenterContracts.StoragesContracts
{
public interface ITypeOfJobStorage
{
List<TypeOfJobViewModel> GetFullList();
List<TypeOfJobViewModel> GetFilteredList(TypeOfJobSearchModel model);
TypeOfJobViewModel? GetElement(TypeOfJobSearchModel model);
TypeOfJobViewModel? Insert(TypeOfJobBindingModel model);
TypeOfJobViewModel? Update(TypeOfJobBindingModel model);
TypeOfJobViewModel? Delete(TypeOfJobBindingModel model);
}
}

View File

@ -0,0 +1,26 @@
using CarCenterContracts.BusinessLogicsContracts;
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class BossViewModel : IBossModel
{
[DisplayName("Логин")]
public string Login { get; set; } = String.Empty;
public string Password { get; set; } = String.Empty;
[DisplayName("Фамилия")]
public string Surname { get; set; } = string.Empty;
[DisplayName("Имя")]
public string Name { get; set; } = string.Empty;
[DisplayName("Отчество")]
public string? Patronymic { get; set; } = String.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class CarViewModel : ICarModel
{
[DisplayName("Номер машины")]
public int Id { get; set; }
[DisplayName("Название машины")]
public String Name { get; set; }
public Dictionary<int, IPresaleModel> CarPresales { get; set; } = new();
public Dictionary<int, IConfigurationModel> CarConfigurations { get; set; } = new();
public int EmployeeId { get; set; }
[DisplayName("ФИО работника")]
public string EmployeeName { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,21 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class ConfigurationViewModel : IConfigurationModel
{
[DisplayName("Название комплектации")]
public string Name { get; set; } = string.Empty;
[DisplayName("Номер комплектации")]
public int Id { get; set; }
public int BossId { get; set; }
[DisplayName("ФИО начальника")]
public string BossName { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,26 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class EmployeeViewModel : IEmployeeModel
{
[DisplayName("Логин")]
public string Login { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
[DisplayName("Фамилия")]
public string Surname { get; set; } = string.Empty;
[DisplayName("Имя")]
public string Name {get; set; } = string.Empty;
[DisplayName("Отчество")]
public string? Patronymic {get; set; } = string.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class PresaleViewModel : IPresaleModel
{
[DisplayName("Дата предпродажи")]
public DateTime PresaleDate {get;set;} = DateTime.Now;
[DisplayName("Номер работника")]
public int EmployeeId { get; set; }
[DisplayName("ФИО работника")]
public string EmployeeName { get; set; } = string.Empty;
[DisplayName("Номер предпродажи")]
public int Id {get;set;}
}
}

View File

@ -0,0 +1,27 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class ReceiptViewModel : IReceiptModel
{
[DisplayName("Сумма поступления")]
public float Sum { get; set; }
[DisplayName("Дата поступления")]
public DateTime ReceiptDate { get; set; } = DateTime.Now.Date;
public int BossId { get; set; }
[DisplayName("ФИО начальника")]
public string BossName { get; set; } = string.Empty;
public int ConfigurationId { get; set; }
[DisplayName("Название комплектации")]
public string ConfigurationName { get; set; } = string.Empty;
[DisplayName("Номер поступления")]
public int Id { get; set; }
}
}

View File

@ -0,0 +1,31 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class SaleViewModel : ISaleModel
{
[DisplayName("Номер продажи")]
public int Id { get; set; }
[DisplayName("Сумма")]
public float Sum {get; set;}
[DisplayName("Дата и время продажи")]
public DateTime SaleDateTime {get; set;} = DateTime.Now;
[DisplayName("Номер машины")]
public int CarId {get; set;}
[DisplayName("Номер поступления")]
public int ReceiptId {get; set;}
public int ConfigurationId { get; set; }
[DisplayName("Название комплектации")]
public string ConfigurationName { get; set; } = string.Empty;
public int EmployeeId { get; set; }
[DisplayName("ФИО работника")]
public string EmployeeName { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,22 @@
using CarCenterDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterContracts.ViewModels
{
public class TypeOfJobViewModel : ITypeOfJobModel
{
[DisplayName("Название вида работы")]
public string Name { get; set; } = string.Empty;
public Dictionary<int, IConfigurationModel> TypeOfJobConfigurations { get; set; } = new();
[DisplayName("Номер вида работы")]
public int Id { get; set; }
public int BossId { get; set; }
[DisplayName("ФИО начальника")]
public string BossFIO { get; set; } = string.Empty;
}
}

View File

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

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterDataModels
{
public interface IId
{
int Id { get; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterDataModels.Models
{
public interface IBossModel : IId
{
string Login { get; }
string Password { get; }
string Name { get; }
string Surname { get; }
string? Patronymic { get; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterDataModels.Models
{
public interface ICarModel : IId
{
string Name { get; }
Dictionary<int, IPresaleModel> CarPresales { get; }
Dictionary<int, IConfigurationModel> CarConfigurations { get; }
int EmployeeId { get; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterDataModels.Models
{
public interface IConfigurationModel : IId
{
string Name { get; }
int BossId { get; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterDataModels.Models
{
public interface IEmployeeModel : IId
{
string Login { get; }
string Password { get; }
string Name { get; }
string Surname { get; }
string? Patronymic { get; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterDataModels.Models
{
public interface IPresaleModel : IId
{
DateTime PresaleDate { get; }
int EmployeeId { get; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterDataModels.Models
{
public interface IReceiptModel : IId
{
DateTime ReceiptDate { get;}
float Sum { get; }
int BossId { get; }
int ConfigurationId { get; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterDataModels.Models
{
public interface ISaleModel : IId
{
float Sum { get; }
DateTime SaleDateTime { get; }
int CarId { get; }
int EmployeeId { get; }
int ReceiptId { get; }
int ConfigurationId { get; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarCenterDataModels.Models
{
public interface ITypeOfJobModel : IId
{
string Name { get;}
int BossId { get;}
Dictionary<int, IConfigurationModel> TypeOfJobConfigurations { get; }
}
}