пу пу пу
This commit is contained in:
parent
2b14114195
commit
4786396747
@ -36,7 +36,7 @@ namespace StorehouseDatabaseImplement.Implements
|
||||
public List<SaleViewModel> GetFullList()
|
||||
{
|
||||
using var context = new StorehouseDatabase();
|
||||
return context.Sales.Select(x => x.GetViewModel).ToList();
|
||||
return context.Sales.Include(x => x.Product).Include(x => x.Client).Select(x => x.GetViewModel).ToList();
|
||||
}
|
||||
|
||||
public SaleViewModel? Insert(SaleBindingModel model)
|
||||
|
@ -36,7 +36,7 @@ namespace StorehouseDatabaseImplement.Implements
|
||||
public List<SupplyViewModel> GetFullList()
|
||||
{
|
||||
using var context = new StorehouseDatabase();
|
||||
return context.Supplys.Select(x => x.GetViewModel).ToList();
|
||||
return context.Supplys.Include(x => x.Product).Include(x => x.Provider).Select(x => x.GetViewModel).ToList();
|
||||
}
|
||||
|
||||
public SupplyViewModel? Insert(SupplyBindingModel model)
|
||||
|
@ -11,8 +11,8 @@ using StorehouseDatabaseImplement;
|
||||
namespace StorehouseDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(StorehouseDatabase))]
|
||||
[Migration("20240513082325_InitialMigra")]
|
||||
partial class InitialMigra
|
||||
[Migration("20240515061146_FirstMigration")]
|
||||
partial class FirstMigration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
@ -5,7 +5,7 @@
|
||||
namespace StorehouseDatabaseImplement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialMigra : Migration
|
||||
public partial class FirstMigration : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
@ -48,9 +48,9 @@ namespace StorehouseDatabaseImplement.Models
|
||||
{
|
||||
Id = Id,
|
||||
ClientId = ClientId,
|
||||
ClientFIO = Client.ClientFIO,
|
||||
ClientFIO = Client.ClientFIO ?? string.Empty,
|
||||
ProductId = ProductId,
|
||||
ProductName = Product.ProductName,
|
||||
ProductName = Product.ProductName ?? string.Empty,
|
||||
SaleNum = SaleNum,
|
||||
};
|
||||
}
|
||||
|
@ -48,9 +48,9 @@ namespace StorehouseDatabaseImplement.Models
|
||||
{
|
||||
Id = Id,
|
||||
ProviderId = ProviderId,
|
||||
ProviderFIO = Provider.ProviderFIO,
|
||||
ProviderFIO = Provider.ProviderFIO ?? string.Empty,
|
||||
ProductId = ProductId,
|
||||
ProductName = Product.ProductName,
|
||||
ProductName = Product.ProductName ?? string.Empty,
|
||||
SupplyNum = SupplyNum,
|
||||
};
|
||||
}
|
||||
|
@ -91,8 +91,8 @@ namespace StorehouseView
|
||||
{
|
||||
var operationResult = _logicO.Create(new SaleBindingModel
|
||||
{
|
||||
ProductId = Convert.ToInt32(comboBoxWood.SelectedIndex) + 1,
|
||||
ClientId = Convert.ToInt32(comboBoxClient.SelectedIndex) + 1,
|
||||
ProductId = Convert.ToInt32(comboBoxWood.SelectedValue),
|
||||
ClientId = Convert.ToInt32(comboBoxClient.SelectedValue),
|
||||
SaleNum = Convert.ToInt32(textBoxCount.Text)
|
||||
});
|
||||
if (!operationResult)
|
||||
|
@ -91,11 +91,10 @@ namespace StorehouseView
|
||||
{
|
||||
var operationResult = _logicO.Create(new SupplyBindingModel
|
||||
{
|
||||
ProductId = Convert.ToInt32(comboBoxWood.SelectedIndex) + 1,
|
||||
ProviderId = Convert.ToInt32(comboBoxClient.SelectedIndex) + 1,
|
||||
ProductId = Convert.ToInt32(comboBoxWood.SelectedValue),
|
||||
ProviderId = Convert.ToInt32(comboBoxClient.SelectedValue),
|
||||
SupplyNum = Convert.ToInt32(textBoxCount.Text)
|
||||
});
|
||||
_logicW.ChangeNum((ProductBindingModel)comboBoxWood.SelectedValue, Convert.ToInt32(textBoxCount.Text));
|
||||
if (!operationResult)
|
||||
{
|
||||
throw new Exception("Ошибка при создании заказа. Дополнительная информация в логах.");
|
||||
|
Loading…
Reference in New Issue
Block a user