Проект и модели

This commit is contained in:
rakhaliullov 2025-03-10 21:13:52 +04:00
parent d806782181
commit 5723f46f66
10 changed files with 168 additions and 1 deletions

View File

@ -0,0 +1,21 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.IO.Pipes;
namespace SoftBedDatabase.Models;
internal class Collect
{
public string Id { get; set; } = Guid.NewGuid().ToString();
public required string WorkerId { get; set; }
public required string FurnitureId { get; set; }
public DateTime SaleDate { get; set; }
public double Sum { get; set; }
public Worker? Worker { get; set; }
public Furniture? Furniture { get; set; }
}

View File

@ -0,0 +1,26 @@
using SoftBedContracts.Enums;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics;
namespace SoftBedDatabase.Models;
internal class Furniture
{
public required string Id { get; set; }
public required string FurnitureName { get; set; }
public FurnitureType FurnitureType { get; set; }
public double Price { get; set; }
public bool IsDeleted { get; set; }
[ForeignKey("FurnitureId")]
public List<FurnitureHistory>? FurnitureHistories { get; set; }
[ForeignKey("FurnitureId")]
public List<FurnitureWorkPiece>? FurnitureWorkPieces { get; set; }
}

View File

@ -0,0 +1,14 @@
namespace SoftBedDatabase.Models;
internal class FurnitureHistory
{
public string Id { get; set; } = Guid.NewGuid().ToString();
public required string FurnitureId { get; set; }
public double OldPrice { get; set; }
public DateTime ChangeDate { get; set; }
public Furniture? Furniture { get; set; }
}

View File

@ -0,0 +1,14 @@
namespace SoftBedDatabase.Models;
internal class FurnitureWorkPiece
{
public required string FurnitureId { get; set; }
public required string WorkPieceId { get; set; }
public int Count { get; set; }
public Furniture? Furniture { get; set; }
public WorkPiece? WorkPiece { get; set; }
}

View File

@ -0,0 +1,20 @@
using SoftBedContracts.Enums;
namespace SoftBedDatabase.Models;
internal class Post
{
public required string Id { get; set; } = Guid.NewGuid().ToString();
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; }
}

View File

@ -0,0 +1,14 @@
namespace SoftBedDatabase.Models;
internal class Salary
{
public string Id { get; set; } = Guid.NewGuid().ToString();
public required string WorkerId { get; set; }
public DateTime SalaryDate { get; set; }
public double WorkerSalary { get; set; }
public Worker? Worker { get; set; }
}

View File

@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace SoftBedDatabase.Models;
internal class WorkPiece
{
public required string Id { get; set; }
public required string Size { get; set; }
public double Weight { get; set; }
[ForeignKey("WorkPieceId")]
public List<FurnitureWorkPiece>? FurnitureWorkPieces { get; set; }
}

View File

@ -0,0 +1,24 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace SoftBedDatabase.Models;
internal class Worker
{
public required string Id { get; set; }
public required string FIO { get; set; }
public required string PostId { get; set; }
public DateTime BirthDate { get; set; }
public DateTime EmploymentDate { get; set; }
public bool IsDeleted { get; set; }
[ForeignKey("WorkerId")]
public List<Salary>? Salaries { get; set; }
[ForeignKey("WorkerId")]
public List<Collect>? Collects { get; set; }
}

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SoftBedContracts\SoftBedContracts.csproj" />
</ItemGroup>
</Project>

View File

@ -7,7 +7,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftBedContracts", "SoftBed
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftBedTests", "SoftBedTests\SoftBedTests.csproj", "{0E56A9DB-177A-4114-B437-DE0F6C9711F4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoftBedBusinessLogic", "SoftBedBusinessLogic\SoftBedBusinessLogic.csproj", "{C64D5EFE-D645-459C-8E48-F42ED08261C4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftBedBusinessLogic", "SoftBedBusinessLogic\SoftBedBusinessLogic.csproj", "{C64D5EFE-D645-459C-8E48-F42ED08261C4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoftBedDatabase", "SoftBedDatabase\SoftBedDatabase.csproj", "{B2480C95-F6DF-48C4-9BE1-FE08CB4DB41A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -27,6 +29,10 @@ Global
{C64D5EFE-D645-459C-8E48-F42ED08261C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C64D5EFE-D645-459C-8E48-F42ED08261C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C64D5EFE-D645-459C-8E48-F42ED08261C4}.Release|Any CPU.Build.0 = Release|Any CPU
{B2480C95-F6DF-48C4-9BE1-FE08CB4DB41A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2480C95-F6DF-48C4-9BE1-FE08CB4DB41A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2480C95-F6DF-48C4-9BE1-FE08CB4DB41A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2480C95-F6DF-48C4-9BE1-FE08CB4DB41A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE