using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Demo.Classes;
namespace Demo.Pages
{
///
/// Логика взаимодействия для PageAgentsList.xaml
///
public partial class PageAgentsList : Page
{
List AgentClear = ClassDataBase.DB.Agent.ToList();
List AgentSales = ClassDataBase.DB.ProductSale.ToList();
public PageAgentsList()
{
InitializeComponent();
LVAgents.ItemsSource = AgentClear;
}
private void TbSalesCount_Loaded(object sender, RoutedEventArgs e)
{
TextBlock tb = (TextBlock)sender;
int id = Convert.ToInt32(tb.Uid);
List salesTemp = new List();
foreach (ProductSale item in ClassDataBase.DB.ProductSale)
{
if (item.AgentID == id)
{
salesTemp.Add(item);
}
}
tb.Text = "Количество продаж: " + salesTemp.Count.ToString();
}
}
}