add Search

This commit is contained in:
Никита Онянов 2025-03-29 22:54:15 +03:00
parent 5d82d26889
commit 14fd7ba50b
22 changed files with 213 additions and 211 deletions

Binary file not shown.

Binary file not shown.

View File

@ -3,28 +3,16 @@
"WorkspaceRootPath": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
},
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\functions\\agenteidtor.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:functions\\agenteidtor.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
},
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\functions\\addproduct.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:functions\\addproduct.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
},
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\functions\\producteditor.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:functions\\producteditor.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
@ -34,70 +22,8 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 4,
"SelectedChildIndex": 1,
"Children": [
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "ProductEditor.axaml",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\ProductEditor.axaml",
"RelativeDocumentMoniker": "Functions\\ProductEditor.axaml",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\ProductEditor.axaml",
"RelativeToolTip": "Functions\\ProductEditor.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-03-28T07:00:07.307Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "AgentEidtor.axaml",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AgentEidtor.axaml",
"RelativeDocumentMoniker": "Functions\\AgentEidtor.axaml",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AgentEidtor.axaml",
"RelativeToolTip": "Functions\\AgentEidtor.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-03-28T07:00:00.816Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "AddProduct.axaml",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AddProduct.axaml",
"RelativeDocumentMoniker": "Functions\\AddProduct.axaml",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AddProduct.axaml",
"RelativeToolTip": "Functions\\AddProduct.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-03-28T06:59:48.941Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "MainWindow.axaml.cs",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml.cs",
"RelativeDocumentMoniker": "MainWindow.axaml.cs",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml.cs",
"RelativeToolTip": "MainWindow.axaml.cs",
"ViewState": "AgIAABUAAAAAAAAAAAAAABUAAAA2AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-03-28T06:21:39.951Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Agent.cs",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Agent.cs",
"RelativeDocumentMoniker": "Models\\Agent.cs",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Agent.cs*",
"RelativeToolTip": "Models\\Agent.cs*",
"ViewState": "AgIAABkAAAAAAAAAAAAAACcAAABoAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-03-28T06:16:39.303Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
@ -108,6 +34,35 @@
"RelativeToolTip": "MainWindow.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-03-28T06:15:56.849Z",
"IsPinned": true,
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "MainWindow.axaml.cs",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml.cs",
"RelativeDocumentMoniker": "MainWindow.axaml.cs",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml.cs",
"RelativeToolTip": "MainWindow.axaml.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAKUAAAAcAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-03-28T06:21:39.951Z",
"IsPinned": true,
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "Agent.cs",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Agent.cs",
"RelativeDocumentMoniker": "Models\\Agent.cs",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Agent.cs",
"RelativeToolTip": "Models\\Agent.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-03-29T17:45:23.338Z",
"IsPinned": true,
"EditorCaption": ""
}
]

View File

@ -2,29 +2,17 @@
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\functions\\addproduct.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:functions\\addproduct.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
},
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:mainwindow.axaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:mainwindow.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
},
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\functions\\agenteidtor.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:functions\\agenteidtor.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
},
{
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\functions\\producteditor.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:functions\\producteditor.axaml||{6D5344A2-2FCD-49DE-A09D-6A14FD1B1224}"
"AbsoluteMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|c:\\users\\vivobook 15x\\desktop\\task21_03\\agents\\models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{1AA52C8A-C24C-4BD8-BEB3-14407C2D8866}|Agents.csproj|solutionrelative:models\\agent.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
@ -34,55 +22,32 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 2,
"SelectedChildIndex": 1,
"Children": [
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "ProductEditor.axaml",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\ProductEditor.axaml",
"RelativeDocumentMoniker": "Functions\\ProductEditor.axaml",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\ProductEditor.axaml",
"RelativeToolTip": "Functions\\ProductEditor.axaml",
"DocumentIndex": 1,
"Title": "MainWindow.axaml",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml",
"RelativeDocumentMoniker": "MainWindow.axaml",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml",
"RelativeToolTip": "MainWindow.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-03-28T07:00:07.307Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "AgentEidtor.axaml",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AgentEidtor.axaml",
"RelativeDocumentMoniker": "Functions\\AgentEidtor.axaml",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AgentEidtor.axaml",
"RelativeToolTip": "Functions\\AgentEidtor.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-03-28T07:00:00.816Z",
"EditorCaption": ""
"WhenOpened": "2025-03-28T06:15:56.849Z",
"IsPinned": true
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "AddProduct.axaml",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AddProduct.axaml",
"RelativeDocumentMoniker": "Functions\\AddProduct.axaml",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Functions\\AddProduct.axaml",
"RelativeToolTip": "Functions\\AddProduct.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-03-28T06:59:48.941Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "MainWindow.axaml.cs",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml.cs",
"RelativeDocumentMoniker": "MainWindow.axaml.cs",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml.cs",
"RelativeToolTip": "MainWindow.axaml.cs",
"ViewState": "AgIAABUAAAAAAAAAAAAAAB8AAAAkAAAAAAAAAA==",
"ViewState": "AgIAAIQAAAAAAAAAAAAAAIkAAAAaAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-03-28T06:21:39.951Z",
"IsPinned": true,
"EditorCaption": ""
},
{
@ -93,22 +58,10 @@
"RelativeDocumentMoniker": "Models\\Agent.cs",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\Models\\Agent.cs",
"RelativeToolTip": "Models\\Agent.cs",
"ViewState": "AgIAABYAAAAAAAAAAAAAACAAAAAAAAAAAAAAAA==",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-03-28T06:16:39.303Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "MainWindow.axaml",
"DocumentMoniker": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml",
"RelativeDocumentMoniker": "MainWindow.axaml",
"ToolTip": "C:\\Users\\VivoBook 15X\\Desktop\\Task21_03\\Agents\\MainWindow.axaml",
"RelativeToolTip": "MainWindow.axaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-03-28T06:15:56.849Z",
"EditorCaption": ""
"WhenOpened": "2025-03-29T17:45:23.338Z",
"IsPinned": true
}
]
}

View File

@ -9,76 +9,100 @@
xmlns:vm="using:Agents.Models">
<DockPanel Background="Blue">
<ScrollViewer>
<StackPanel>
<StackPanel Spacing="15">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="1">
<TextBox Name="search" Width="400" Background="Black" Watermark="ПОИСК"/>
<Button Content="Найти" Background="Yellow" Foreground="Black" Click="Button_search"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Border
Background="Red"
CornerRadius="10"
Padding="20"
Margin="20"
Width="450"
Height="400"
>
<ScrollViewer>
<StackPanel>
<TextBlock Text="Список компаний" HorizontalAlignment="Center" Foreground="Blue"/>
<ListBox Name="ListAgents" SelectionChanged="ListBox_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate x:DataType="vm:Agent">
<StackPanel Background="White" HorizontalAlignment="Center" Width="400" Height="350" Spacing="5">
<StackPanel>
<TextBlock Text="Веберите сортировку списка продуктов компании" HorizontalAlignment="Center" Foreground="White"/>
<ComboBox Name="SortListAgents" HorizontalAlignment="Center" SelectionChanged="SortAg">
<ComboBoxItem>
без. сорт.
</ComboBoxItem>
<ComboBoxItem>
убыв.
</ComboBoxItem>
<ComboBoxItem>
возраст.
</ComboBoxItem>
</ComboBox>
<Border
Background="Red"
CornerRadius="10"
Padding="20"
Margin="20"
Width="450"
Height="400"
>
<ScrollViewer>
<StackPanel>
<TextBlock Text="Список компаний" HorizontalAlignment="Center" Foreground="Blue"/>
<ListBox Name="ListAgents" SelectionChanged="ListBox_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate x:DataType="vm:Agent">
<StackPanel Background="White" HorizontalAlignment="Center" Width="400" Height="350" Spacing="5">
<StackPanel HorizontalAlignment="Left">
<Image
Height="200"
Width="200"
Name="MainImage"
Source="{Binding getLogo}"
/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Название компании: " Foreground="Black"/>
<TextBlock Text="{Binding Title}" Foreground="Black"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="ИНН: " Foreground="Black"/>
<TextBlock Text="{Binding Inn}" Foreground="Black"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="КПП: " Foreground="Black"/>
<TextBlock Text="{Binding Kpp}" Foreground="Black"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Имя директора: " Foreground="Black"/>
<TextBlock Text="{Binding Directorname}" Foreground="Black"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Телефон компании: " Foreground="Black"/>
<TextBlock Text="{Binding Phone}" Foreground="Black"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Адрес: " Foreground="Black"/>
<TextBlock Text="{Binding Address}" Foreground="Black" Width="350" TextWrapping="Wrap"/>
</StackPanel>
<StackPanel HorizontalAlignment="Left">
<Image
Height="200"
Width="200"
Name="MainImage"
Source="{Binding getLogo}"
/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</ScrollViewer>
</Border>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Название компании: " Foreground="Black"/>
<TextBlock Text="{Binding Title}" Foreground="Black"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="ИНН: " Foreground="Black"/>
<TextBlock Text="{Binding Inn}" Foreground="Black"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="КПП: " Foreground="Black"/>
<TextBlock Text="{Binding Kpp}" Foreground="Black"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Имя директора: " Foreground="Black"/>
<TextBlock Text="{Binding Directorname}" Foreground="Black"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Телефон компании: " Foreground="Black"/>
<TextBlock Text="{Binding Phone}" Foreground="Black"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Адрес: " Foreground="Black"/>
<TextBlock Text="{Binding Address}" Foreground="Black" Width="350" TextWrapping="Wrap"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</ScrollViewer>
</Border>
</StackPanel>
<StackPanel>
<TextBlock Text="Веберите сортировку списка продуктов компании" HorizontalAlignment="Center"/>
<ComboBox Name="SortListAgents" HorizontalAlignment="Center">
<TextBlock Text="Веберите сортировку списка продуктов компании" HorizontalAlignment="Center" Foreground="White"/>
<ComboBox Name="SortListProductAgents" HorizontalAlignment="Center" SelectionChanged="ComboBox_SelectionChanged_3">
<ComboBoxItem>
без. сорт.
</ComboBoxItem>
@ -101,7 +125,7 @@
<ScrollViewer>
<StackPanel>
<TextBlock Text="Товары продавца" HorizontalAlignment="Center" Foreground="Blue"/>
<ListBox Name="ListProducts" SelectionChanged="ListBox_SelectionChanged1">
<ListBox Name="ListProducts">
<ListBox.ItemTemplate>
<DataTemplate x:DataType="vm:Product">
<StackPanel>

View File

@ -9,6 +9,7 @@ using System.Collections.ObjectModel;
using Avalonia.Interactivity;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Collections.Immutable;
namespace Agents
{
@ -16,10 +17,12 @@ namespace Agents
{
static User11Context db = new User11Context();
ObservableCollection<Agent> AgentsitemSource = new ObservableCollection<Agent>(db.Agents.OrderBy(it=>it.Title));
ObservableCollection<Agent> ListAgents2;
public MainWindow()
{
InitializeComponent();
ListAgents.ItemsSource = AgentsitemSource;
ListAgents2 = AgentsitemSource;
}
private void ListBox_SelectionChanged(object? sender, Avalonia.Controls.SelectionChangedEventArgs e)
{
@ -33,14 +36,47 @@ namespace Agents
{
ExceptionDispatchInfo.Capture(ex).Throw();
}
}
}
private void ListBox_SelectionChanged1(object? sender, Avalonia.Controls.SelectionChangedEventArgs e)
private void SortAg(object? sender, Avalonia.Controls.SelectionChangedEventArgs e)
{
if (sender != null)
{
try
{
SortAgent();
}
catch (Exception ex)
{
ExceptionDispatchInfo.Capture(ex).Throw();
}
}
}
void SortAgent()
{
switch (SortListAgents.SelectedIndex)
{
case 1: AgentsitemSource = new ObservableCollection<Agent>(AgentsitemSource.OrderByDescending(it => it.Title).ToList()); break;
case 2: AgentsitemSource = new ObservableCollection<Agent>(AgentsitemSource.OrderBy(it => it.Title).ToList()); break;
default: AgentsitemSource = ListAgents2; break;
}
ListAgents.ItemsSource = new ObservableCollection<Agent>(AgentsitemSource);
}
private void ComboBox_SelectionChanged_3(object? sender, Avalonia.Controls.SelectionChangedEventArgs e)
{
if (sender != null)
{
try
{
UpdateInfo();
}
catch (Exception ex)
{
ExceptionDispatchInfo.Capture(ex).Throw();
}
}
}
@ -69,7 +105,7 @@ namespace Agents
Articlenumber = PWS.Product.Articlenumber
}).ToList();
switch (SortListAgents.SelectedIndex)
switch (SortListProductAgents.SelectedIndex)
{
case 1: prods = prods.OrderBy(p => p.Title).ToList(); break;
case 2: prods = prods.OrderByDescending(p => p.Title).ToList(); break;
@ -84,6 +120,7 @@ namespace Agents
new AgentEidtor().Show();
Close();
}
private void ButtonProductEidtor(object sender, RoutedEventArgs e)
{
new ProductEditor().Show();
@ -96,5 +133,38 @@ namespace Agents
Close();
}
void Button_search(object sender, RoutedEventArgs e)
{
string? Search = search.Text;
if (search.Text != "")
{
AgentsitemSource = new ObservableCollection<Agent>(db.Agents.Where(it => it.Title == Search ||
it.Address == Search ||
it.Inn == Search ||
it.Kpp == Search ||
it.Directorname == Search ||
it.Phone == Search ||
it.Email == Search ||
it.Priority == int.Parse(Search)
));
if (AgentsitemSource != null)
{
ListAgents.ItemsSource = AgentsitemSource;
ListAgents2 = AgentsitemSource;
SortAgent();
}
else
{
ListAgents.ItemsSource = null;
}
}
else
{
AgentsitemSource = new ObservableCollection<Agent>(db.Agents.OrderBy(it => it.Title));
ListAgents.ItemsSource = AgentsitemSource;
ListAgents2 = AgentsitemSource;
SortAgent();
}
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Agents")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f314e84939e5636d79895b7258adce8fcd1048d5")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5d82d26889dc3b648bc20bd60768fafd1e11759c")]
[assembly: System.Reflection.AssemblyProductAttribute("Agents")]
[assembly: System.Reflection.AssemblyTitleAttribute("Agents")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
78a8a43c2cd3b833317f446f674122c68c79b86ef40d6b4ec00669be86bc6b55
cc11f2038498ef0d07347327c4ce73b49b319e36326b8f4cbe591290f0eeaefa

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.