add contracts

This commit is contained in:
Zakharov_Rostislav 2024-05-05 22:02:53 +04:00
parent 22f762b60b
commit e9774d6b48
43 changed files with 403 additions and 33 deletions

View File

@ -0,0 +1,20 @@
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.BusinessLogic
{
public interface ICarLogic
{
List<CarView>? ReadList(CarSearch? model);
CarView? ReadElement(CarSearch model);
bool Create(CarDto model);
bool Update(CarDto model);
bool Delete(CarDto model);
}
}

View File

@ -0,0 +1,20 @@
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.BusinessLogic
{
public interface IClientLogic
{
List<ClientView>? ReadList(ClientSearch? model);
ClientView? ReadElement(ClientSearch model);
bool Create(ClientDto model);
bool Update(ClientDto model);
bool Delete(ClientDto model);
}
}

View File

@ -0,0 +1,21 @@
using CarShowroomContracts.Dtos;
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.BusinessLogic
{
public interface IEmployeeLogic
{
List<EmployeeView>? ReadList(EmployeeSearch? model);
EmployeeView? ReadElement(EmployeeSearch model);
bool Create(EmployeeDto model);
bool Update(EmployeeDto model);
bool Delete(EmployeeDto model);
}
}

View File

@ -0,0 +1,20 @@
using CarShowroomContracts.Dtos;
using CarShowroomDataModels.Views;
using CarShowroomDataModels.SearchModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.BusinessLogic
{
public interface IMakeLogic
{
List<MakeView>? ReadList(MakeSearch? model);
MakeView? ReadElement(MakeSearch model);
bool Create(MakeDto model);
bool Update(MakeDto model);
bool Delete(MakeDto model);
}
}

View File

@ -0,0 +1,21 @@
using CarShowroomContracts.Dtos;
using CarShowroomDataModels.Views;
using CarShowroomDataModels.SearchModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CarShowroomDataModels.Dtos;
namespace CarShowroomContracts.BusinessLogic
{
public interface IModelLogic
{
List<ModelView>? ReadList(ModelSearch? model);
ModelView? ReadElement(ModelSearch model);
bool Create(ModelDto model);
bool Update(ModelDto model);
bool Delete(ModelDto model);
}
}

View File

@ -0,0 +1,20 @@
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.BusinessLogic
{
public interface ISaleLogic
{
List<SaleView>? ReadList(SaleSearch? model);
SaleView? ReadElement(SaleSearch model);
bool Create(SaleDto model);
bool Update(SaleDto model);
bool Delete(SaleDto model);
}
}

View File

@ -0,0 +1,20 @@
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ServiceShowroomContracts.BusinessLogic
{
public interface IServiceLogic
{
List<ServiceView>? ReadList(ServiceSearch? model);
ServiceView? ReadElement(ServiceSearch model);
bool Create(ServiceDto model);
bool Update(ServiceDto model);
bool Delete(ServiceDto model);
}
}

View File

@ -1,7 +0,0 @@
namespace CarShowroomContracts
{
public class Class1
{
}
}

View File

@ -0,0 +1,21 @@
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.StorageContracts
{
public interface ICarStorage
{
List<CarView> GetFullList();
List<CarView> GetFilteredList(CarSearch model);
CarView? GetElement(CarSearch model);
CarView? Insert(CarDto model);
CarView? Update(CarDto model);
CarView? Delete(CarDto model);
}
}

View File

@ -0,0 +1,21 @@
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.StorageContracts
{
public interface IClientStorage
{
List<ClientView> GetFullList();
List<ClientView> GetFilteredList(ClientSearch model);
ClientView? GetElement(ClientSearch model);
ClientView? Insert(ClientDto model);
ClientView? Update(ClientDto model);
ClientView? Delete(ClientDto model);
}
}

View File

@ -0,0 +1,21 @@
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.StorageContracts
{
public interface IEmployeeStorage
{
List<EmployeeView> GetFullList();
List<EmployeeView> GetFilteredList(EmployeeSearch model);
EmployeeView? GetElement(EmployeeSearch model);
EmployeeView? Insert(EmployeeDto model);
EmployeeView? Update(EmployeeDto model);
EmployeeView? Delete(EmployeeDto model);
}
}

View File

@ -0,0 +1,21 @@
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.StorageContracts
{
public interface IMakeStorage
{
List<MakeView> GetFullList();
List<MakeView> GetFilteredList(MakeSearch model);
MakeView? GetElement(MakeSearch model);
MakeView? Insert(MakeDto model);
MakeView? Update(MakeDto model);
MakeView? Delete(MakeDto model);
}
}

View File

@ -0,0 +1,21 @@
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.StorageContracts
{
public interface IModelStorage
{
List<ModelView> GetFullList();
List<ModelView> GetFilteredList(ModelSearch model);
ModelView? GetElement(ModelSearch model);
ModelView? Insert(ModelDto model);
ModelView? Update(ModelDto model);
ModelView? Delete(ModelDto model);
}
}

View File

@ -0,0 +1,21 @@
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.StorageContracts
{
public interface ISaleStorage
{
List<SaleView> GetFullList();
List<SaleView> GetFilteredList(SaleSearch model);
SaleView? GetElement(SaleSearch model);
SaleView? Insert(SaleDto model);
SaleView? Update(SaleDto model);
SaleView? Delete(SaleDto model);
}
}

View File

@ -0,0 +1,21 @@
using CarShowroomDataModels.Dtos;
using CarShowroomDataModels.SearchModel;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.StorageContracts
{
public interface IServiceStorage
{
List<ServiceView> GetFullList();
List<ServiceView> GetFilteredList(ServiceSearch model);
ServiceView? GetElement(ServiceSearch model);
ServiceView? Insert(ServiceDto model);
ServiceView? Update(ServiceDto model);
ServiceView? Delete(ServiceDto model);
}
}

View File

@ -6,8 +6,4 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="SearchModel\" />
</ItemGroup>
</Project>

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Dtos
namespace CarShowroomDataModels.Dtos
{
public class CarDto : ICar
{

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Dtos
namespace CarShowroomDataModels.Dtos
{
public class ClientDto : IClient
{

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Dtos
namespace CarShowroomDataModels.Dtos
{
public class EmployeeDto : IEmployee
{

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Dtos
namespace CarShowroomDataModels.Dtos
{
public class MakeDto : IMake
{

View File

@ -5,15 +5,15 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Dtos
namespace CarShowroomDataModels.Dtos
{
public class ModeDto : IModel
public class ModelDto : IModel
{
public int Id { get; set; }
public string Name { get; set; }
public int Price { get; set; }
public int MakeId { get; set; }
public ModeDto(IModel model)
public ModelDto(IModel model)
{
Id = model.Id;
Name = model.Name;

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace CarShowroomDataModels.Dtos
{
internal class SaleDto : ISale
public class SaleDto : ISale
{
public int Id { get; set; }
public DateTime SaleTime { get; set; }

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Dtos
namespace CarShowroomDataModels.Dtos
{
public class ServiceDto : IService
{

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomDataModels.SearchModel
{
public class CarSearch
{
public int? Id;
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomDataModels.SearchModel
{
public class ClientSearch
{
public int? Id;
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomDataModels.SearchModel
{
public class EmployeeSearch
{
public int? Id;
public string? Email;
public string? Password;
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomDataModels.SearchModel
{
public class MakeSearch
{
public int? Id;
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomDataModels.SearchModel
{
public class ModelSearch
{
public int? Id;
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomDataModels.SearchModel
{
public class SaleSearch
{
public int? Id;
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomDataModels.SearchModel
{
public class ServiceSearch
{
public int? Id;
}
}

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Views
namespace CarShowroomDataModels.Views
{
public class CarView : ICar
{

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Views
namespace CarShowroomDataModels.Views
{
public class ClientView : IClient
{

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Views
namespace CarShowroomDataModels.Views
{
public class EmployeeView : IEmployee
{

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Views
namespace CarShowroomDataModels.Views
{
public class MakeView : IMake
{

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Views
namespace CarShowroomDataModels.Views
{
public class ModelView : IModel
{

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarShowroomContracts.Views
namespace CarShowroomDataModels.Views
{
public class ServiceView : IService
{

View File

@ -1,5 +1,5 @@
using CarShowroomContracts.AbstractModels;
using CarShowroomContracts.Views;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

View File

@ -1,5 +1,5 @@
using CarShowroomContracts.AbstractModels;
using CarShowroomContracts.Views;
using CarShowroomDataModels.Views;
using CarShowroomDataModels.Models;
using Microsoft.EntityFrameworkCore;
using System;

View File

@ -1,4 +1,4 @@
using CarShowroomContracts.Views;
using CarShowroomDataModels.Views;
using CarShowroomDataModels.Models;
using Microsoft.EntityFrameworkCore;
using System;

View File

@ -1,5 +1,5 @@
using CarShowroomContracts.AbstractModels;
using CarShowroomContracts.Views;
using CarShowroomDataModels.Views;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;

View File

@ -1,5 +1,5 @@
using CarShowroomContracts.AbstractModels;
using CarShowroomContracts.Views;
using CarShowroomDataModels.Views;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;

View File

@ -1,5 +1,4 @@
using CarShowroomContracts.AbstractModels;
using CarShowroomContracts.Views;
using CarShowroomDataModels.Views;
using System;
using System.Collections.Generic;

View File

@ -1,5 +1,5 @@
using CarShowroomContracts.AbstractModels;
using CarShowroomContracts.Views;
using CarShowroomDataModels.Views;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;