Преглед изворни кода

Реализована фильтрация и сортировка

ra5um1st пре 2 година
родитељ
комит
5c156bd498

+ 0 - 6
EX.sln

@@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 16
 VisualStudioVersion = 16.0.30907.101
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF.Core", "EX\WPF.Core.csproj", "{91919F4B-2F53-43AD-ACAD-7F8F0E14E055}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF.Framework", "WPF.Framework\WPF.Framework.csproj", "{478F17AC-242B-44F5-812B-DD35A68F8F61}"
 EndProject
 Global
@@ -13,10 +11,6 @@ Global
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{91919F4B-2F53-43AD-ACAD-7F8F0E14E055}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{91919F4B-2F53-43AD-ACAD-7F8F0E14E055}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{91919F4B-2F53-43AD-ACAD-7F8F0E14E055}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{91919F4B-2F53-43AD-ACAD-7F8F0E14E055}.Release|Any CPU.Build.0 = Release|Any CPU
 		{478F17AC-242B-44F5-812B-DD35A68F8F61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{478F17AC-242B-44F5-812B-DD35A68F8F61}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{478F17AC-242B-44F5-812B-DD35A68F8F61}.Release|Any CPU.ActiveCfg = Release|Any CPU

+ 31 - 0
WPF.Framework/Commands/Base/LambdaCommad.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+
+namespace WPF.Framework.Commands.Base
+{
+    class LambdaCommad : ICommand
+    {
+        private readonly Action<object> execute;
+        private readonly Func<object, bool> canExecute;
+
+        public LambdaCommad(Action<object> execute, Func<object, bool> canExecute = null)
+        {
+            this.execute = execute;
+            this.canExecute = canExecute;
+        }
+
+        public event EventHandler CanExecuteChanged
+        {
+            add => CommandManager.RequerySuggested += value;
+            remove => CommandManager.RequerySuggested -= value;
+        }
+
+        public bool CanExecute(object parameter) => canExecute == null || canExecute(parameter);
+
+        public void Execute(object parameter) => execute(parameter);
+    }
+}

+ 32 - 0
WPF.Framework/Converters/ListSortDirectionToStringConverter.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace WPF.Framework.Converters
+{
+    class ListSortDirectionToStringConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            var direction = (ListSortDirection)value;
+            if (direction == ListSortDirection.Ascending)
+            {
+                return "/\\";
+            }
+            else
+            {
+                return "\\/";
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 29 - 16
WPF.Framework/MainWindow.xaml

@@ -3,7 +3,7 @@
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-        xmlns:local="clr-namespace:WPF.Framework" xmlns:viewmodels="clr-namespace:WPF.Framework.ViewModels"
+        xmlns:local="clr-namespace:WPF.Framework" xmlns:viewmodels="clr-namespace:WPF.Framework.ViewModels" xmlns:converters="clr-namespace:WPF.Framework.Converters"
         mc:Ignorable="d"
         Title="Приятный шелест" Height="450" Width="800"
         Icon="Resources/Приятный шелест.ico">
@@ -11,7 +11,7 @@
         <viewmodels:AgentsViewModel/>
     </Window.DataContext>
     <Window.Resources>
-        
+        <converters:ListSortDirectionToStringConverter x:Key="ListSortDirectionToStringConverter"/>
     </Window.Resources>
     
     <Grid>
@@ -29,6 +29,7 @@
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="auto"/>
                 <ColumnDefinition Width="2*"/>
+                <ColumnDefinition Width="auto"/>
                 <ColumnDefinition Width="1*"/>
                 <ColumnDefinition Width="1*"/>
             </Grid.ColumnDefinitions>
@@ -44,18 +45,28 @@
             <TextBox Grid.Column="1"
                      VerticalAlignment="Center"
                      Margin="5"
-                     Padding="2"/>
-            <ComboBox Grid.Column="2"
+                     Padding="2"
+                     Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"/>
+            <Button Grid.Column="2"
+                    Padding="4 2"
+                    VerticalAlignment="Center"
+                    Content="{Binding CurrentListSortDirection, Converter={StaticResource ListSortDirectionToStringConverter}, FallbackValue='/\\'}"
+                    Command="{Binding ListDirectionCommand}">
+            </Button>
+            <ComboBox Grid.Column="3"
                       VerticalAlignment="Center"
                       Margin="5"
                       SelectedIndex="0"
+                      SelectedValue="{Binding CurrentSortingAgentProperty}"
                       ItemsSource="{Binding AgentsSortingDictionary}"
                       SelectedValuePath="Key"
                       DisplayMemberPath="Value"/>
-            <ComboBox Grid.Column="3"
+            <ComboBox Grid.Column="4"
                       VerticalAlignment="Center"
                       Margin="5"
-                      ItemsSource="{Binding AgentTypeFilterDictionary}"
+                      SelectedIndex="0"
+                      SelectedValue="{Binding CurrentAgentTypeFilter}"
+                      ItemsSource="{Binding AgentTypesFilterDictionary}"
                       SelectedValuePath="Key"
                       DisplayMemberPath="Value"/>
         </Grid>
@@ -71,17 +82,19 @@
                                 <ColumnDefinition Width="5*"/>
                                 <ColumnDefinition Width="auto"/>
                             </Grid.ColumnDefinitions>
-                            <Image Grid.Column="0"
-                                   Source="{Binding Logo, FallbackValue='Resource/no_picture.png'}"/>
-                            <StackPanel Grid.Column="1">
-                                <StackPanel Orientation="Horizontal">
-                                    <TextBlock Text="{Binding AgentType.Title, StringFormat='{}{0} | '}"/>
-                                    <TextBlock Text="{Binding Title}"/>
+                                <Image Grid.Column="0"
+                                   Source="{Binding Logo, FallbackValue='Resource/no_picture.png', TargetNullValue='Resource/no_picture.png'}"
+                                   Width="150"/>
+                                <StackPanel Grid.Column="1"
+                                            Margin="10">
+                                    <StackPanel Orientation="Horizontal">
+                                        <TextBlock Text="{Binding AgentType.Title, StringFormat='{}{0} | '}"/>
+                                        <TextBlock Text="{Binding Title}"/>
+                                    </StackPanel>
+                                    <TextBlock Text="{Binding ProductSaledLastYear, StringFormat='{}{0} продаж за год', FallbackValue='Продажи не найдены'}"/>
+                                    <TextBlock Text="{Binding Phone}"/>
+                                    <TextBlock Text="{Binding Priority, StringFormat='Приоритетность: {0}'}"/>
                                 </StackPanel>
-                                <TextBlock Text="{Binding ProductSaledLastYear, StringFormat='{}{0} продаж за год', FallbackValue='Продажи не найдены'}"/>
-                                <TextBlock Text="{Binding Phone}"/>
-                                <TextBlock Text="{Binding Priority, StringFormat='Приоритетность: {0}'}"/>
-                            </StackPanel>
                             <TextBlock Grid.Column="2"
                                        Text="{Binding Discount, StringFormat='{}{0} %', FallbackValue='Скидка не найдена'}"
                                        FontSize="24"

+ 49 - 0
WPF.Framework/Models/Agent.cs

@@ -11,6 +11,7 @@ namespace WPF.Framework.Models
 {
     using System;
     using System.Collections.Generic;
+    using System.ComponentModel.DataAnnotations.Schema;
     using WPF.Framework.Models.Repository.Base;
 
     public partial class Agent : IEntity
@@ -35,6 +36,54 @@ namespace WPF.Framework.Models
         public string Logo { get; set; }
         public int Priority { get; set; }
     
+        [NotMapped]
+        public int ProductSaledLastYear
+        {
+            get
+            {
+                int count = 0;
+                foreach (var item in ProductSale)
+                {
+                    if((DateTime.Now - item.SaleDate).TotalDays >= 365)
+                    {
+                        count += item.ProductCount;
+                    }
+                }
+                return count;
+            }
+        }
+
+        [NotMapped]
+        public int Discount
+        {
+            get
+            {
+                int value = 0;
+                foreach (var item in ProductSale)
+                {
+                    value += item.ProductCount * item.ProductCount;
+                }
+                if (value >= 10000 && value < 50000)
+                {
+                    return 5;
+                }
+                if (value >= 50000 && value < 150000)
+                {
+                    return 10;
+                }
+                if (value >= 150000 && value < 500000)
+                {
+                    return 20;
+                }
+                if (value > 500000)
+                {
+                    return 25;
+                }
+                return 0;
+            }
+        }
+
+
         public virtual AgentType AgentType { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<AgentPriorityHistory> AgentPriorityHistory { get; set; }

+ 3 - 2
WPF.Framework/Models/AgentType.cs

@@ -11,8 +11,9 @@ namespace WPF.Framework.Models
 {
     using System;
     using System.Collections.Generic;
-    
-    public partial class AgentType
+    using WPF.Framework.Models.Repository.Base;
+
+    public partial class AgentType : IEntity
     {
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public AgentType()

+ 136 - 0
WPF.Framework/ViewModels/AgentsViewModel.cs

@@ -5,6 +5,8 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Data;
+using System.Windows.Input;
+using WPF.Framework.Commands.Base;
 using WPF.Framework.Models;
 using WPF.Framework.Models.Repository;
 using WPF.Framework.Models.Repository.Base;
@@ -16,17 +18,151 @@ namespace WPF.Framework.ViewModels
         public AgentsViewModel()
         {
             agentRepository = new AgentRepository(new AgentsDbContext());
+            agentTypeRepository = new Repository<AgentType>(new AgentsDbContext());
             agentList = agentRepository.Items.ToList();
             agentsCollectionViewSource = new CollectionViewSource()
             {
                 Source = agentList
             };
+            SortingDirectionsDictionary = new Dictionary<ListSortDirection, string>()
+            {
+                { ListSortDirection.Ascending, "По возрастанию" },
+                { ListSortDirection.Descending, "По убыванию" }
+            };
+            AgentTypesFilterDictionary = InitializeAgentTypesFilterDictionary();
+            AgentsSortingDictionary = InitializeAgentsSortingDictionary();
+
+            CurrentListSortDirection = ListSortDirection.Ascending;
+            CurrentSortingAgentProperty = AgentsSortingDictionary.First().Key;
+            CurrentAgentTypeFilter = AgentTypesFilterDictionary.First().Key;
+
+            agentsCollectionViewSource.Filter += OnSearchFilter;
+            agentsCollectionViewSource.Filter += OnAgentTypesFilter;
+
+            ListDirectionCommand = new LambdaCommad(OnListDirectionCommandExecuted);
         }
 
         private IRepository<Agent> agentRepository;
+        private IRepository<AgentType> agentTypeRepository;
         private List<Agent> agentList;
         private CollectionViewSource agentsCollectionViewSource;
 
+        private string searchText = "";
+        public string SearchText
+        {
+            get => searchText;
+            set => Set(ref searchText, ref value);
+        }
+
+        private ListSortDirection currentListSortDirection;
+        public ListSortDirection CurrentListSortDirection
+        {
+            get => currentListSortDirection;
+            set
+            {
+                if (Set(ref currentListSortDirection, ref value))
+                {
+                    agentsCollectionViewSource.SortDescriptions.Clear();
+                    agentsCollectionViewSource.SortDescriptions.Add(new SortDescription(CurrentSortingAgentProperty, value));
+                    AgentsCollectionView.Refresh();
+                }
+            }
+        }
+
+        private AgentType currentAgentTypeFilter;
+        public AgentType CurrentAgentTypeFilter
+        {
+            get => currentAgentTypeFilter;
+            set
+            {
+                if (Set(ref currentAgentTypeFilter, ref value))
+                {
+                    AgentsCollectionView.Refresh();
+                }
+            }
+        }
+
+        private string currentSortingAgentProperty;
+        public string CurrentSortingAgentProperty
+        {
+            get => currentSortingAgentProperty;
+            set
+            {
+                if (Set(ref currentSortingAgentProperty, ref value))
+                {
+                    agentsCollectionViewSource.SortDescriptions.Clear();
+                    agentsCollectionViewSource.SortDescriptions.Add(new SortDescription(value, CurrentListSortDirection));
+                    AgentsCollectionView.Refresh();
+                }
+            }
+        }
+
+        public Dictionary<ListSortDirection, string> SortingDirectionsDictionary { get; }
+        public Dictionary<AgentType, string> AgentTypesFilterDictionary { get; }
+        public Dictionary<string, string> AgentsSortingDictionary { get; }
         public ICollectionView AgentsCollectionView => agentsCollectionViewSource.View;
+
+        private void OnAgentTypesFilter(object sender, FilterEventArgs e)
+        {
+            if (e.Item == null)
+            {
+                return;
+            }
+
+            Agent agent = (Agent)e.Item;
+            if (agent.AgentType.ID != CurrentAgentTypeFilter.ID)
+            {
+                e.Accepted = false;
+            }
+        }
+
+        private void OnSearchFilter(object sender, FilterEventArgs e)
+        {
+            if(e.Item == null)
+            {
+                return;
+            }
+
+            Agent agent = (Agent)e.Item;
+            if(!agent.Title.Contains(SearchText) || !agent.Email.Contains(SearchText) || !agent.Phone.Contains(SearchText))
+            {
+                e.Accepted = false;
+            }
+        }
+
+        public ICommand ListDirectionCommand { get; }
+        private void OnListDirectionCommandExecuted(object obj)
+        {
+            if (CurrentListSortDirection == ListSortDirection.Descending)
+            {
+                CurrentListSortDirection = ListSortDirection.Ascending;
+            }
+            else
+            {
+                CurrentListSortDirection = ListSortDirection.Descending;
+            }
+        }
+
+
+
+        private Dictionary<AgentType, string> InitializeAgentTypesFilterDictionary()
+        {
+            Dictionary<AgentType, string> dictionaty = new Dictionary<AgentType, string>();
+            foreach (var item in agentTypeRepository.Items)
+            {
+                dictionaty.Add(item, item.Title);
+            }
+            return dictionaty;
+        }
+        private Dictionary<string, string> InitializeAgentsSortingDictionary()
+        {
+            Dictionary<string, string> dictionaty = new Dictionary<string, string>()
+            {
+                { nameof(Agent.Title), "Название" },
+                { nameof(Agent.Discount), "Размер скидки" },
+                { nameof(Agent.Priority), "Приоритет" },
+            };
+            return dictionaty;
+        }
     }
 }

+ 1 - 1
WPF.Framework/ViewModels/Base/ViewModel.cs

@@ -30,7 +30,7 @@ namespace WPF.Framework.ViewModels
 
         protected bool Set<T>(ref T field, ref T value, [CallerMemberName] string propertyName = null)
         {
-            if (field.Equals(value))
+            if (object.Equals(field, value))
             {
                 return false;
             }

+ 401 - 133
WPF.Framework/WPF.Framework.csproj

@@ -64,6 +64,8 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
+    <Compile Include="Commands\Base\LambdaCommad.cs" />
+    <Compile Include="Converters\ListSortDirectionToStringConverter.cs" />
     <Compile Include="Models\Agent.cs">
       <DependentUpon>DatabaseModel.tt</DependentUpon>
     </Compile>
@@ -175,138 +177,402 @@
     <None Include="App.config" />
   </ItemGroup>
   <ItemGroup>
-    <Resource Include="agents\agent_1.png" />
-    <Resource Include="agents\agent_10.png" />
-    <Resource Include="agents\agent_100.png" />
-    <Resource Include="agents\agent_101.png" />
-    <Resource Include="agents\agent_102.png" />
-    <Resource Include="agents\agent_103.png" />
-    <Resource Include="agents\agent_104.png" />
-    <Resource Include="agents\agent_105.png" />
-    <Resource Include="agents\agent_106.png" />
-    <Resource Include="agents\agent_107.png" />
-    <Resource Include="agents\agent_108.png" />
-    <Resource Include="agents\agent_109.png" />
-    <Resource Include="agents\agent_11.png" />
-    <Resource Include="agents\agent_110.png" />
-    <Resource Include="agents\agent_111.png" />
-    <Resource Include="agents\agent_112.png" />
-    <Resource Include="agents\agent_113.png" />
-    <Resource Include="agents\agent_114.png" />
-    <Resource Include="agents\agent_115.png" />
-    <Resource Include="agents\agent_116.png" />
-    <Resource Include="agents\agent_117.png" />
-    <Resource Include="agents\agent_118.png" />
-    <Resource Include="agents\agent_119.png" />
-    <Resource Include="agents\agent_12.png" />
-    <Resource Include="agents\agent_120.png" />
-    <Resource Include="agents\agent_121.png" />
-    <Resource Include="agents\agent_122.png" />
-    <Resource Include="agents\agent_123.png" />
-    <Resource Include="agents\agent_124.png" />
-    <Resource Include="agents\agent_125.png" />
-    <Resource Include="agents\agent_126.png" />
-    <Resource Include="agents\agent_127.png" />
-    <Resource Include="agents\agent_128.png" />
-    <Resource Include="agents\agent_129.png" />
-    <Resource Include="agents\agent_13.png" />
-    <Resource Include="agents\agent_130.png" />
-    <Resource Include="agents\agent_14.png" />
-    <Resource Include="agents\agent_15.png" />
-    <Resource Include="agents\agent_16.png" />
-    <Resource Include="agents\agent_17.png" />
-    <Resource Include="agents\agent_18.png" />
-    <Resource Include="agents\agent_19.png" />
-    <Resource Include="agents\agent_2.png" />
-    <Resource Include="agents\agent_20.png" />
-    <Resource Include="agents\agent_21.png" />
-    <Resource Include="agents\agent_22.png" />
-    <Resource Include="agents\agent_23.png" />
-    <Resource Include="agents\agent_24.png" />
-    <Resource Include="agents\agent_25.png" />
-    <Resource Include="agents\agent_26.png" />
-    <Resource Include="agents\agent_27.png" />
-    <Resource Include="agents\agent_28.png" />
-    <Resource Include="agents\agent_29.png" />
-    <Resource Include="agents\agent_3.png" />
-    <Resource Include="agents\agent_30.png" />
-    <Resource Include="agents\agent_31.png" />
-    <Resource Include="agents\agent_32.png" />
-    <Resource Include="agents\agent_33.png" />
-    <Resource Include="agents\agent_34.png" />
-    <Resource Include="agents\agent_35.png" />
-    <Resource Include="agents\agent_36.png" />
-    <Resource Include="agents\agent_37.png" />
-    <Resource Include="agents\agent_38.png" />
-    <Resource Include="agents\agent_39.png" />
-    <Resource Include="agents\agent_4.png" />
-    <Resource Include="agents\agent_40.png" />
-    <Resource Include="agents\agent_41.png" />
-    <Resource Include="agents\agent_42.png" />
-    <Resource Include="agents\agent_43.png" />
-    <Resource Include="agents\agent_44.png" />
-    <Resource Include="agents\agent_45.png" />
-    <Resource Include="agents\agent_46.png" />
-    <Resource Include="agents\agent_47.png" />
-    <Resource Include="agents\agent_48.png" />
-    <Resource Include="agents\agent_49.png" />
-    <Resource Include="agents\agent_5.png" />
-    <Resource Include="agents\agent_50.png" />
-    <Resource Include="agents\agent_51.png" />
-    <Resource Include="agents\agent_52.png" />
-    <Resource Include="agents\agent_53.png" />
-    <Resource Include="agents\agent_54.png" />
-    <Resource Include="agents\agent_55.png" />
-    <Resource Include="agents\agent_56.png" />
-    <Resource Include="agents\agent_57.png" />
-    <Resource Include="agents\agent_58.png" />
-    <Resource Include="agents\agent_59.png" />
-    <Resource Include="agents\agent_6.png" />
-    <Resource Include="agents\agent_60.png" />
-    <Resource Include="agents\agent_61.png" />
-    <Resource Include="agents\agent_62.png" />
-    <Resource Include="agents\agent_63.png" />
-    <Resource Include="agents\agent_64.png" />
-    <Resource Include="agents\agent_65.png" />
-    <Resource Include="agents\agent_66.png" />
-    <Resource Include="agents\agent_67.png" />
-    <Resource Include="agents\agent_68.png" />
-    <Resource Include="agents\agent_69.png" />
-    <Resource Include="agents\agent_7.png" />
-    <Resource Include="agents\agent_70.png" />
-    <Resource Include="agents\agent_71.png" />
-    <Resource Include="agents\agent_72.png" />
-    <Resource Include="agents\agent_73.png" />
-    <Resource Include="agents\agent_74.png" />
-    <Resource Include="agents\agent_75.png" />
-    <Resource Include="agents\agent_76.png" />
-    <Resource Include="agents\agent_77.png" />
-    <Resource Include="agents\agent_78.png" />
-    <Resource Include="agents\agent_79.png" />
-    <Resource Include="agents\agent_8.png" />
-    <Resource Include="agents\agent_80.png" />
-    <Resource Include="agents\agent_81.png" />
-    <Resource Include="agents\agent_82.png" />
-    <Resource Include="agents\agent_83.png" />
-    <Resource Include="agents\agent_84.png" />
-    <Resource Include="agents\agent_85.png" />
-    <Resource Include="agents\agent_86.png" />
-    <Resource Include="agents\agent_87.png" />
-    <Resource Include="agents\agent_88.png" />
-    <Resource Include="agents\agent_89.png" />
-    <Resource Include="agents\agent_9.png" />
-    <Resource Include="agents\agent_90.png" />
-    <Resource Include="agents\agent_91.png" />
-    <Resource Include="agents\agent_92.png" />
-    <Resource Include="agents\agent_93.png" />
-    <Resource Include="agents\agent_94.png" />
-    <Resource Include="agents\agent_95.png" />
-    <Resource Include="agents\agent_96.png" />
-    <Resource Include="agents\agent_97.png" />
-    <Resource Include="agents\agent_98.png" />
-    <Resource Include="agents\agent_99.png" />
-    <Resource Include="Resources\Приятный шелест.ico" />
-    <Resource Include="Resources\Приятный шелест.png" />
+    <Content Include="agents\agent_1.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_10.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_100.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_101.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_102.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_103.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_104.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_105.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_106.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_107.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_108.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_109.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_11.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_110.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_111.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_112.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_113.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_114.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_115.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_116.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_117.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_118.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_119.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_12.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_120.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_121.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_122.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_123.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_124.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_125.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_126.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_127.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_128.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_129.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_13.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_130.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_14.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_15.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_16.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_17.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_18.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_19.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_2.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_20.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_21.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_22.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_23.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_24.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_25.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_26.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_27.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_28.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_29.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_3.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_30.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_31.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_32.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_33.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_34.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_35.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_36.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_37.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_38.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_39.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_4.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_40.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_41.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_42.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_43.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_44.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_45.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_46.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_47.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_48.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_49.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_5.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_50.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_51.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_52.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_53.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_54.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_55.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_56.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_57.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_58.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_59.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_6.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_60.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_61.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_62.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_63.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_64.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_65.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_66.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_67.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_68.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_69.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_7.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_70.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_71.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_72.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_73.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_74.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_75.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_76.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_77.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_78.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_79.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_8.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_80.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_81.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_82.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_83.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_84.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_85.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_86.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_87.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_88.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_89.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_9.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_90.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_91.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_92.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_93.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_94.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_95.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_96.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_97.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_98.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="agents\agent_99.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Resources\Приятный шелест.ico">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Resources\Приятный шелест.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
   </ItemGroup>
   <ItemGroup>
     <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
@@ -322,7 +588,9 @@
       <DependentUpon>DatabaseModel.edmx</DependentUpon>
       <LastGenOutput>DatabaseModel.cs</LastGenOutput>
     </Content>
-    <Resource Include="Resources\no_picture.png" />
+    <Content Include="Resources\no_picture.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>