commiting recent changes
This commit is contained in:
@@ -4,4 +4,8 @@
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Models\Models.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LuminousSales.Data;
|
||||
|
||||
namespace LuminousSales.Business
|
||||
{
|
||||
public class DealsBusiness
|
||||
{
|
||||
private DealContext dealContext;
|
||||
|
||||
}
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LuminousSales.Data;
|
||||
|
||||
namespace LuminousSales.Business
|
||||
{
|
||||
public class PermissionsBusiness
|
||||
{
|
||||
private PermissionContext permissionContext;
|
||||
}
|
||||
}
|
@@ -1,66 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using LuminousSales.Data;
|
||||
using LuminousSales.Data.Model;
|
||||
|
||||
namespace LuminousSales.Business
|
||||
{
|
||||
public class ProductBusiness
|
||||
{
|
||||
private ProductContext productContext;
|
||||
|
||||
public List<Product> GetAll()
|
||||
{
|
||||
using (productContext = new ProductContext())
|
||||
{
|
||||
return productContext.Products.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public Product Get(int id)
|
||||
{
|
||||
using (productContext = new ProductContext())
|
||||
{
|
||||
return productContext.Products.Find(id);
|
||||
}
|
||||
}
|
||||
|
||||
public void Buy(Product product)
|
||||
{
|
||||
using (productContext = new ProductContext())
|
||||
{
|
||||
productContext.Products.Add(product);
|
||||
productContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public void Update(Product product)
|
||||
{
|
||||
using (productContext = new ProductContext())
|
||||
{
|
||||
var item = productContext.Products.Find(product.Id);
|
||||
if (item != null)
|
||||
{
|
||||
productContext.Entry(item).CurrentValues.SetValues(product);
|
||||
productContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Sell(int id)
|
||||
{
|
||||
using (productContext = new ProductContext())
|
||||
{
|
||||
var product = productContext.Products.Find(id);
|
||||
if (product != null)
|
||||
{
|
||||
productContext.Products.Remove(product);
|
||||
productContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LuminousSales.Data;
|
||||
|
||||
namespace LuminousSales.Business
|
||||
{
|
||||
public class RolesBusiness
|
||||
{
|
||||
private RoleContext roleContext;
|
||||
}
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LuminousSales.Data;
|
||||
|
||||
namespace LuminousSales.Business
|
||||
{
|
||||
public class RolesToPermissionBusiness
|
||||
{
|
||||
private RolesToPermissionContext rolesToPermissionContext;
|
||||
|
||||
}
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LuminousSales.Data;
|
||||
|
||||
namespace LuminousSales.Business
|
||||
{
|
||||
public class StocksBusiness
|
||||
{
|
||||
private StockContext stockContext;
|
||||
}
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LuminousSales.Data;
|
||||
|
||||
namespace LuminousSales.Business
|
||||
{
|
||||
public class UsersBusiness
|
||||
{
|
||||
private UserContext userContext;
|
||||
}
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LuminousSales.Data;
|
||||
|
||||
namespace LuminousSales.Business
|
||||
{
|
||||
public class UsersToRolesBusiness
|
||||
{
|
||||
private UsersToRolesContext usersToRolesContext;
|
||||
}
|
||||
}
|
@@ -9,6 +9,8 @@ namespace LuminousSales.Data
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DbSet<Role> Roles { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,11 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.12" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.12" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.12">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user