Созданы репозитории и добавлен атрибут для поставки

This commit is contained in:
Pyro 2024-11-15 02:57:44 +04:00
parent 367073709c
commit b683df9b1f
7 changed files with 99 additions and 1 deletions

View File

@ -6,9 +6,10 @@ public class Supply
public int SupplierId { get; private set; }
public int ComponentId { get; private set; }
public double Weight { get; private set; }
public bool Completed { get; private set; }
public DateTime Date { get; private set; }
public static Supply CreateEntity(int id, int supplierid, int componentid, double weight)
public static Supply CreateEntity(int id, int supplierid, int componentid, double weight, bool completed)
{
return new Supply
{
@ -16,6 +17,7 @@ public class Supply
SupplierId = supplierid,
ComponentId = componentid,
Weight = weight,
Completed = completed,
Date = DateTime.Now
};
}

View File

@ -0,0 +1,16 @@
using ProjectConfectionaryFactory.Entities;
namespace ProjectConfectionaryFactory.Repositories;
public interface IClientRepository
{
IEnumerable<Client> ReadClients();
Client ReadClientById(int id);
void CreateClient(Client client);
void UpdateClient(Client client);
void DeleteClient(int id);
}

View File

@ -0,0 +1,16 @@
using ProjectConfectionaryFactory.Entities;
namespace ProjectConfectionaryFactory.Repositories;
public interface IComponentRepository
{
IEnumerable<Component> ReadComponents();
Component ReadComponentById(int id);
void CreateComponent(Component component);
void UpdateComponent(Component component);
void DeleteComponent(int id);
}

View File

@ -0,0 +1,16 @@
using ProjectConfectionaryFactory.Entities;
namespace ProjectConfectionaryFactory.Repositories;
public interface IOrderRepository
{
IEnumerable<Order> ReadOrders();
Order ReadOrderById(int id);
void CreateOrder(Order order);
void UpdateOrder(Order order);
void DeleteOrder(int id);
}

View File

@ -0,0 +1,16 @@
using ProjectConfectionaryFactory.Entities;
namespace ProjectConfectionaryFactory.Repositories;
public interface IProductRepository
{
IEnumerable<Product> ReadProducts();
Product ReadProductById(int id);
void CreateProduct(Product product);
void UpdateProduct(Product product);
void DeleteProduct(int id);
}

View File

@ -0,0 +1,17 @@
using ProjectConfectionaryFactory.Entities;
namespace ProjectConfectionaryFactory.Repositories;
public interface ISupplierRepository
{
IEnumerable<Supplier> ReadSuppliers();
Supplier ReadSupplierById(int id);
void CreateSupplier(Supplier supplier);
void UpdateSupplier(Supplier supplier);
void DeleteSupplier(int id);
}

View File

@ -0,0 +1,15 @@
using ProjectConfectionaryFactory.Entities;
namespace ProjectConfectionaryFactory.Repositories;
public interface ISupplyRepository
{
IEnumerable<Supply> ReadSupplys();
Supply ReadSupplyById(int id);
void CreateSupply(Supply supply);
void UpdateSupply(Supply supply);
void DeleteSupply(int id);
}