40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
|
using Avalonia;
|
|||
|
using Avalonia.Controls;
|
|||
|
using Avalonia.Markup.Xaml;
|
|||
|
using demka2025_sedelnikov.Context;
|
|||
|
using Microsoft.EntityFrameworkCore;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
|
|||
|
namespace demka2025_sedelnikov;
|
|||
|
|
|||
|
public partial class PartnerProductHistoryWindow : Window
|
|||
|
{
|
|||
|
User8Context context = new User8Context();
|
|||
|
public PartnerProductHistoryWindow(int index)
|
|||
|
{
|
|||
|
InitializeComponent();
|
|||
|
LoadData(index);
|
|||
|
}
|
|||
|
|
|||
|
public void LoadData(int index)
|
|||
|
{
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
var partnerProducts = context.Partnerproducts.Where(pp => pp.PartnerId == index)
|
|||
|
.Include(p => p.Partner)
|
|||
|
.Include(p => p.Product)
|
|||
|
.Where(part => part.PartnerId == index)
|
|||
|
.Select(p => new
|
|||
|
{
|
|||
|
p.Product.Articul,
|
|||
|
p.Product.ProductName,
|
|||
|
p.Quantity,
|
|||
|
p.SellDate
|
|||
|
})
|
|||
|
.ToList();
|
|||
|
PartnerProductHistoryLB.ItemsSource = partnerProducts;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|