using Demo1.Classes;
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;
namespace Demo1.Pages
{
///
/// Логика взаимодействия для PageAgentList.xaml
///
public partial class PageAgentList : Page
{
List AgentsClear = ClassDataBase.DB.Agent.ToList();
List ProductSales = ClassDataBase.DB.ProductSale.ToList();
public PageAgentList()
{
InitializeComponent();
LVAgents.ItemsSource = AgentsClear;
}
private void TBSales_Count_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();
}
}
}