DateTime replaced Timestamp, StockController methods

This commit is contained in:
Dimitar Byalkov
2021-03-18 21:42:28 +02:00
parent 541b001d31
commit bdd0d5256f
7 changed files with 48 additions and 45 deletions

View File

@@ -8,7 +8,7 @@ namespace Business.Business.Sales
{
ICollection<T> GetAll();
T Get(int id);
ICollection<T> GetByTime(byte[] startPeriod, byte[] endPeriod);
ICollection<T> GetByTime(DateTime time);
void Add(int productId, double Amount);
void Add(string productName, double Amount);
void Delete(int id);

View File

@@ -8,11 +8,30 @@ using Models.Models;
namespace Business.Business.Sales
{
public class StockController : IStockController<Product>
public class StockController : ISalesController<Product>
{
private LuminousContext context;
Product ISalesController<Product>.Get(int id)
{
return context.Product.Find(id);
}
ICollection<Product> ISalesController<Product>.GetByTime(DateTime time)
{
throw new NotImplementedException();
}
void ISalesController<Product>.Add(int productId, double Amount)
{
throw new NotImplementedException();
}
void ISalesController<Product>.Add(string productName, double Amount)
{
throw new NotImplementedException();
}
void ISalesController<Product>.Delete(int id)
{
throw new NotImplementedException();
}
public ICollection<Product> GetAll()
{
using (context = new LuminousContext())
@@ -21,15 +40,6 @@ namespace Business.Business.Sales
}
}
public Product GetById(int id)
{
using (context = new LuminousContext())
{
return context.Product.Find(id);
}
}
public void AddProduct(Product product)
{
using (context = new LuminousContext())
@@ -41,8 +51,7 @@ namespace Business.Business.Sales
}
}
public void LoadProductById(int id)
public void LoadProduct(int id)
{
using (context = new LuminousContext())
{
@@ -55,7 +64,7 @@ namespace Business.Business.Sales
}
}
public void LoadProductByName(Product product)
public void LoadProduct(Product product)
{
using (context = new LuminousContext())
{
@@ -93,11 +102,6 @@ namespace Business.Business.Sales
}
}
}
public Product GetByName(string name)
{
throw new NotImplementedException();
}
}
}