1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- 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
- {
- /// <summary>
- /// Логика взаимодействия для PageAgentList.xaml
- /// </summary>
- public partial class PageAgentList : Page
- {
- List<Agent> AgentsClear = ClassDataBase.DB.Agent.ToList();
- List<ProductSale> 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<ProductSale> salesTemp = new List<ProductSale>();
- foreach (ProductSale item in ClassDataBase.DB.ProductSale)
- {
- if (item.AgentID == id)
- {
- salesTemp.Add(item);
- }
- }
- tb.Text = "Количество продаж:" + salesTemp.Count.ToString();
- }
- }
- }
|