forked from slavaxom9k/PIBD-23_Fomichev_V.S._MagicCarpet
Проект и модели
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\MagicCarpetContracts\MagicCarpetContracts.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
21
MagicCarpetProject/MagicCarpetDatabase/Models/Client.cs
Normal file
21
MagicCarpetProject/MagicCarpetDatabase/Models/Client.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetDatabase.Models;
|
||||||
|
|
||||||
|
internal class Client
|
||||||
|
{
|
||||||
|
public required string Id { get; set; }
|
||||||
|
|
||||||
|
public required string FIO { get; set; }
|
||||||
|
|
||||||
|
public required string PhoneNumber { get; set; }
|
||||||
|
|
||||||
|
public double DiscountSize { get; set; }
|
||||||
|
[ForeignKey("ClientId")]
|
||||||
|
public List<Sale>? Sales { get; set; }
|
||||||
|
}
|
||||||
29
MagicCarpetProject/MagicCarpetDatabase/Models/Employee.cs
Normal file
29
MagicCarpetProject/MagicCarpetDatabase/Models/Employee.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetDatabase.Models;
|
||||||
|
|
||||||
|
internal class Employee
|
||||||
|
{
|
||||||
|
public required string Id { get; set; }
|
||||||
|
|
||||||
|
public required string FIO { get; set; }
|
||||||
|
|
||||||
|
public string Email { get; set; }
|
||||||
|
|
||||||
|
public required string PostId { get; set; }
|
||||||
|
|
||||||
|
public DateTime BirthDate { get; set; }
|
||||||
|
|
||||||
|
public DateTime EmploymentDate { get; set; }
|
||||||
|
|
||||||
|
public bool IsDeleted { get; set; }
|
||||||
|
[ForeignKey("EmployeeId")]
|
||||||
|
public List<Salary>? Salaries { get; set; }
|
||||||
|
[ForeignKey("EmployeeId")]
|
||||||
|
public List<Sale>? Sales { get; set; }
|
||||||
|
}
|
||||||
20
MagicCarpetProject/MagicCarpetDatabase/Models/Post.cs
Normal file
20
MagicCarpetProject/MagicCarpetDatabase/Models/Post.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using MagicCarpetContracts.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetDatabase.Models;
|
||||||
|
|
||||||
|
internal class Post
|
||||||
|
{
|
||||||
|
public required string Id { get; set; }
|
||||||
|
public required string PostId { get; set; }
|
||||||
|
public required string PostName { get; set; }
|
||||||
|
public PostType PostType { get; set; }
|
||||||
|
public double Salary { get; set; }
|
||||||
|
public bool IsActual { get; set; }
|
||||||
|
public DateTime ChangeDate { get; set; }
|
||||||
|
}
|
||||||
15
MagicCarpetProject/MagicCarpetDatabase/Models/Salary.cs
Normal file
15
MagicCarpetProject/MagicCarpetDatabase/Models/Salary.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetDatabase.Models;
|
||||||
|
|
||||||
|
internal class Salary
|
||||||
|
{
|
||||||
|
public required string Id { get; set; } = Guid.NewGuid().ToString();
|
||||||
|
public required string EmployeeId { get; set; }
|
||||||
|
public DateTime SalaryDate { get; set; }
|
||||||
|
public double EmployeeSalary { get; set; }
|
||||||
|
}
|
||||||
32
MagicCarpetProject/MagicCarpetDatabase/Models/Sale.cs
Normal file
32
MagicCarpetProject/MagicCarpetDatabase/Models/Sale.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
using MagicCarpetContracts.DataModels;
|
||||||
|
using MagicCarpetContracts.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetDatabase.Models;
|
||||||
|
|
||||||
|
internal class Sale
|
||||||
|
{
|
||||||
|
public required string Id { get; set; }
|
||||||
|
|
||||||
|
public required string EmployeeId { get; set; }
|
||||||
|
|
||||||
|
public string? ClientId { get; set; }
|
||||||
|
|
||||||
|
public DateTime SaleDate { get; set; }
|
||||||
|
public double Sum { get; private set; }
|
||||||
|
|
||||||
|
public DiscountType DiscountType { get; set; }
|
||||||
|
|
||||||
|
public double Discount { get; set; }
|
||||||
|
|
||||||
|
public bool IsCancel { get; set; }
|
||||||
|
public Employee? Employee { get; set; }
|
||||||
|
public Client? Client { get; set; }
|
||||||
|
[ForeignKey("SaleId")]
|
||||||
|
public List<SaleTour>? SaleTours { get; set; }
|
||||||
|
}
|
||||||
18
MagicCarpetProject/MagicCarpetDatabase/Models/SaleTour.cs
Normal file
18
MagicCarpetProject/MagicCarpetDatabase/Models/SaleTour.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetDatabase.Models;
|
||||||
|
|
||||||
|
internal class SaleTour
|
||||||
|
{
|
||||||
|
public required string SaleId { get; set; }
|
||||||
|
|
||||||
|
public required string TourId { get; set; }
|
||||||
|
|
||||||
|
public int Count { get; set; }
|
||||||
|
public Sale? Sale { get; set; }
|
||||||
|
public Tour? Tour { get; set; }
|
||||||
|
}
|
||||||
23
MagicCarpetProject/MagicCarpetDatabase/Models/Tour.cs
Normal file
23
MagicCarpetProject/MagicCarpetDatabase/Models/Tour.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using MagicCarpetContracts.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetDatabase.Models;
|
||||||
|
|
||||||
|
internal class Tour
|
||||||
|
{
|
||||||
|
public required string Id { get; set; } = Guid.NewGuid().ToString();
|
||||||
|
public required string TourName { get; set; }
|
||||||
|
public string TourCountry { get; set; }
|
||||||
|
public double Price { get; set; }
|
||||||
|
public TourType Type { get; set; }
|
||||||
|
[ForeignKey("TourId")]
|
||||||
|
public List<SaleTour>? SaleTours { get; set; }
|
||||||
|
[ForeignKey("TourId")]
|
||||||
|
public List<TourHistory>? TourHistories { get; set; }
|
||||||
|
}
|
||||||
16
MagicCarpetProject/MagicCarpetDatabase/Models/TourHistory.cs
Normal file
16
MagicCarpetProject/MagicCarpetDatabase/Models/TourHistory.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetDatabase.Models;
|
||||||
|
|
||||||
|
internal class TourHistory
|
||||||
|
{
|
||||||
|
public required string Id { get; set; } = Guid.NewGuid().ToString();
|
||||||
|
public required string TourId { get; set; }
|
||||||
|
public double OldPrice { get; set; }
|
||||||
|
public DateTime ChangeDate { get; set; }
|
||||||
|
public Tour? Tour { get; set; }
|
||||||
|
}
|
||||||
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicCarpetTests", "MagicCa
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicCarpetBusinessLogic", "MagicCarpetBusinessLogic\MagicCarpetBusinessLogic.csproj", "{688F9182-851F-4CF8-97CD-9B6F1E43D758}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicCarpetBusinessLogic", "MagicCarpetBusinessLogic\MagicCarpetBusinessLogic.csproj", "{688F9182-851F-4CF8-97CD-9B6F1E43D758}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicCarpetDatabase", "MagicCarpetDatabase\MagicCarpetDatabase.csproj", "{C69B43B2-8680-42D7-A111-306E2E8225FE}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -27,6 +29,10 @@ Global
|
|||||||
{688F9182-851F-4CF8-97CD-9B6F1E43D758}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{688F9182-851F-4CF8-97CD-9B6F1E43D758}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{688F9182-851F-4CF8-97CD-9B6F1E43D758}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{688F9182-851F-4CF8-97CD-9B6F1E43D758}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{688F9182-851F-4CF8-97CD-9B6F1E43D758}.Release|Any CPU.Build.0 = Release|Any CPU
|
{688F9182-851F-4CF8-97CD-9B6F1E43D758}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{C69B43B2-8680-42D7-A111-306E2E8225FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C69B43B2-8680-42D7-A111-306E2E8225FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C69B43B2-8680-42D7-A111-306E2E8225FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C69B43B2-8680-42D7-A111-306E2E8225FE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
Reference in New Issue
Block a user