Реализации
This commit is contained in:
parent
e50b4dab9c
commit
cf6d712375
8
Squirrel/GuestBusinessLogicContract.cs
Normal file
8
Squirrel/GuestBusinessLogicContract.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
public class Class1
|
||||||
|
{
|
||||||
|
public Class1()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Squirrel.BusinessLogicsContracts;
|
||||||
|
using Squirrel.DataModels;
|
||||||
|
using Squirrel.StoragesContracts;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SquirelBusinessLogic.Implementations;
|
||||||
|
|
||||||
|
internal class GuestBusinessLogicContract(IGuestStorageContract
|
||||||
|
guestStorageContract, ILogger logger) : IGuestBusinessLogicContract
|
||||||
|
|
||||||
|
{
|
||||||
|
private readonly ILogger _logger = logger;
|
||||||
|
private readonly IGuestStorageContract _guestStorageContract =
|
||||||
|
guestStorageContract;
|
||||||
|
public List<GuestDataModel> GetAllGuests()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public GuestDataModel GetGuestByData(string data)
|
||||||
|
{
|
||||||
|
return new("", "", "", 0);
|
||||||
|
}
|
||||||
|
public void InsertGuest(GuestDataModel guestDataModel)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void UpdateGuest(GuestDataModel guestDataModel)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void DeleteGuest(string id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Squirrel.BusinessLogicsContracts;
|
||||||
|
using Squirrel.DataModels;
|
||||||
|
using Squirrel.Enums;
|
||||||
|
using Squirrel.StoragesContracts;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SquirelBusinessLogic.Implementations;
|
||||||
|
|
||||||
|
internal class PostBusinessLogicContract(IPostStorageContract
|
||||||
|
postStorageContract, ILogger logger) : IPostBusinessLogicContract
|
||||||
|
{
|
||||||
|
private readonly ILogger _logger = logger;
|
||||||
|
private readonly IPostStorageContract _postStorageContract = postStorageContract;
|
||||||
|
public List<PostDataModel> GetAllPosts(bool onlyActive = true)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public List<PostDataModel> GetAllDataOfPost(string postId)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public PostDataModel GetPostByData(string data)
|
||||||
|
{
|
||||||
|
return new("", "", "", PostType.None, 0, true, DateTime.UtcNow);
|
||||||
|
}
|
||||||
|
public void InsertPost(PostDataModel postDataModel)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void UpdatePost(PostDataModel postDataModel)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void DeletePost(string id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void RestorePost(string id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Squirrel.BusinessLogicsContracts;
|
||||||
|
using Squirrel.DataModels;
|
||||||
|
using Squirrel.Enums;
|
||||||
|
using Squirrel.StoragesContracts;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SquirelBusinessLogic.Implementations;
|
||||||
|
|
||||||
|
internal class ProductBusinessLogicContract(IProductStorageContract
|
||||||
|
productStorageContract, ILogger logger) : IProductBusinessLogicContract
|
||||||
|
{
|
||||||
|
private readonly ILogger _logger = logger;
|
||||||
|
|
||||||
|
private readonly IProductStorageContract _productStorageContract = productStorageContract;
|
||||||
|
public List<ProductDataModel> GetAllProducts(bool onlyActive)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ProductHistoryDataModel> GetProductHistoryByProduct(string
|
||||||
|
productId)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public ProductDataModel GetProductByData(string data)
|
||||||
|
{
|
||||||
|
return new("", "", ProductType.None, 0, true);
|
||||||
|
}
|
||||||
|
public void InsertProduct(ProductDataModel productDataModel)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void UpdateProduct(ProductDataModel productDataModel)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void DeleteProduct(string id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Squirrel.BusinessLogicsContracts;
|
||||||
|
using Squirrel.DataModels;
|
||||||
|
using Squirrel.StoragesContracts;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SquirelBusinessLogic.Implementations;
|
||||||
|
|
||||||
|
internal class SalaryBusinessLogicContract(ISalaryStorageContract salaryStorageContract, ISaleStorageContract saleStorageContract, IPostStorageContract
|
||||||
|
postStorageContract, IWorkerStorageContract workerStorageContract, ILogger
|
||||||
|
logger) : ISalaryBusinessLogicContract
|
||||||
|
{
|
||||||
|
private readonly ILogger _logger = logger;
|
||||||
|
private readonly ISalaryStorageContract _salaryStorageContract = salaryStorageContract;
|
||||||
|
private readonly ISaleStorageContract _saleStorageContract = saleStorageContract;
|
||||||
|
private readonly IPostStorageContract _postStorageContract = postStorageContract;
|
||||||
|
private readonly IWorkerStorageContract _workerStorageContract = workerStorageContract;
|
||||||
|
public List<SalaryDataModel> GetAllSalariesByPeriod(DateTime fromDate, DateTime toDate)
|
||||||
|
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public List<SalaryDataModel> GetAllSalariesByPeriodByWorker(DateTime fromDate, DateTime toDate, string workerId)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public void CalculateSalaryByMounth(DateTime date)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Squirrel.BusinessLogicsContracts;
|
||||||
|
using Squirrel.DataModels;
|
||||||
|
using Squirrel.Enums;
|
||||||
|
using Squirrel.StoragesContracts;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SquirelBusinessLogic.Implementations;
|
||||||
|
|
||||||
|
internal class SaleBusinessLogicContract(ISaleStorageContract
|
||||||
|
saleStorageContract, ILogger logger) : ISaleBusinessLogicContract
|
||||||
|
{
|
||||||
|
private readonly ILogger _logger = logger;
|
||||||
|
private readonly ISaleStorageContract _saleStorageContract = saleStorageContract;
|
||||||
|
public List<SaleDataModel> GetAllSalesByPeriod(DateTime fromDate, DateTime toDate)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public List<SaleDataModel> GetAllSalesByWorkerByPeriod(string workerId, DateTime fromDate, DateTime toDate)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public List<SaleDataModel> GetAllSalesByGuestByPeriod(string? guestId, DateTime fromDate, DateTime toDate)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public List<SaleDataModel> GetAllSalesByProductByPeriod(string productId, DateTime fromDate, DateTime toDate)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public SaleDataModel GetSaleByData(string data)
|
||||||
|
{
|
||||||
|
return new("", "", "", 0, DiscountType.None, 0, false, []);
|
||||||
|
}
|
||||||
|
public void InsertSale(SaleDataModel saleDataModel)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CancelSale(string id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Squirrel.BusinessLogicsContracts;
|
||||||
|
using Squirrel.DataModels;
|
||||||
|
using Squirrel.StoragesContracts;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SquirelBusinessLogic.Implementations;
|
||||||
|
|
||||||
|
internal class WorkerBusinessLogicContract(IWorkerStorageContract
|
||||||
|
workerStorageContract, ILogger logger) : IWorkerBusinessLogicContract
|
||||||
|
{
|
||||||
|
private readonly ILogger _logger = logger;
|
||||||
|
private readonly IWorkerStorageContract _workerStorageContract =
|
||||||
|
workerStorageContract;
|
||||||
|
public List<WorkerDataModel> GetAllWorkers(bool onlyActive = true)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public List<WorkerDataModel> GetAllWorkersByPost(string postId, bool
|
||||||
|
onlyActive = true)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public List<WorkerDataModel> GetAllWorkersByBirthDate(DateTime fromDate,
|
||||||
|
DateTime toDate, bool onlyActive = true)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public List<WorkerDataModel> GetAllWorkersByEmploymentDate(DateTime
|
||||||
|
fromDate, DateTime toDate, bool onlyActive = true)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public WorkerDataModel GetWorkerByData(string data)
|
||||||
|
{
|
||||||
|
return new("", "", "", DateTime.Now, DateTime.Now, true);
|
||||||
|
}
|
||||||
|
public void InsertWorker(WorkerDataModel workerDataModel)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void UpdateWorker(WorkerDataModel workerDataModel)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void DeleteWorker(string id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
17
Squirrel/SquirelBusinessLogic/SquirelBusinessLogic.csproj
Normal file
17
Squirrel/SquirelBusinessLogic/SquirelBusinessLogic.csproj
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.2" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Squirrel\Squirrel.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -5,7 +5,9 @@ VisualStudioVersion = 17.11.35303.130
|
|||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squirrel", "Squirrel\Squirrel.csproj", "{16CED5CC-61F1-494B-8B3E-7F6A3BD6F0C3}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squirrel", "Squirrel\Squirrel.csproj", "{16CED5CC-61F1-494B-8B3E-7F6A3BD6F0C3}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SquirrelTests", "SquirrelTests\SquirrelTests.csproj", "{C61A5FF4-E87A-4722-AA58-2E7FC2057217}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SquirrelTests", "SquirrelTests\SquirrelTests.csproj", "{C61A5FF4-E87A-4722-AA58-2E7FC2057217}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SquirelBusinessLogic", "SquirelBusinessLogic\SquirelBusinessLogic.csproj", "{9846600E-25A1-423B-B84E-A87CE0563ED7}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -21,6 +23,10 @@ Global
|
|||||||
{C61A5FF4-E87A-4722-AA58-2E7FC2057217}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{C61A5FF4-E87A-4722-AA58-2E7FC2057217}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C61A5FF4-E87A-4722-AA58-2E7FC2057217}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{C61A5FF4-E87A-4722-AA58-2E7FC2057217}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C61A5FF4-E87A-4722-AA58-2E7FC2057217}.Release|Any CPU.Build.0 = Release|Any CPU
|
{C61A5FF4-E87A-4722-AA58-2E7FC2057217}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{9846600E-25A1-423B-B84E-A87CE0563ED7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{9846600E-25A1-423B-B84E-A87CE0563ED7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{9846600E-25A1-423B-B84E-A87CE0563ED7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{9846600E-25A1-423B-B84E-A87CE0563ED7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -12,6 +12,6 @@ public interface IGuestBusinessLogicContract
|
|||||||
List<GuestDataModel> GetAllGuests();
|
List<GuestDataModel> GetAllGuests();
|
||||||
GuestDataModel GetGuestByData(string data);
|
GuestDataModel GetGuestByData(string data);
|
||||||
void InsertGuest(GuestDataModel guestDataModel);
|
void InsertGuest(GuestDataModel guestDataModel);
|
||||||
void UpdateBuyer(GuestDataModel guestDataModel);
|
void UpdateGuest(GuestDataModel guestDataModel);
|
||||||
void DeleteGuest(string id);
|
void DeleteGuest(string id);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user