Agents/MainWindow.axaml
2025-04-05 20:05:02 +03:00

208 lines
7.5 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<Window xmlns="https://github.com/avaloniaui"
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"
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="450"
x:Class="Agents.MainWindow"
Title="Агенты"
Icon="avares://Agents/Assets/Icon.ico"
xmlns:vm="using:Agents.Models">
<DockPanel Background="Blue">
<ScrollViewer>
<StackPanel Spacing="15">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="1">
<TextBox Name="search" Width="400" Background="Black" Watermark="ПОИСК" Text=""/>
<Button Content="Найти" Background="Yellow" Foreground="Black" Click="Button_search"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<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="ListAgents_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>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</ScrollViewer>
</Border>
</StackPanel>
<StackPanel>
<TextBlock Text="Веберите сортировку списка продуктов компании" HorizontalAlignment="Center" Foreground="White"/>
<ComboBox Name="SortListProductAgents" HorizontalAlignment="Center" SelectionChanged="SortListProductAgents_method">
<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="ListProducts">
<ListBox.ItemTemplate>
<DataTemplate x:DataType="vm:ProductDTO">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Название продукта: "/>
<TextBlock Text="{Binding Title}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Описание товара: "/>
<TextBlock Text="{Binding Description}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Количество производственных сотрудников: "/>
<TextBlock Text="{Binding Productionpersoncount}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Артикул: "/>
<TextBlock Text="{Binding Articlenumber}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Минимальная цена для агента: "/>
<TextBlock Text="{Binding Mincostforagent}"/>
<TextBlock Text=" Руб."/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="колличество продаж этого товара: "/>
<TextBlock Text="{Binding SalesCount}"/>
<TextBlock Text=" шт."/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Скидка на товар: "/>
<TextBlock Text="{Binding ProductDiscount}"/>
<TextBlock Text=" %"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Описание товара: "/>
<TextBlock Text="{Binding Description}" Width="300" TextWrapping="Wrap"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</ScrollViewer>
</Border>
</StackPanel>
</StackPanel>
<StackPanel>
<Border
Background="Red"
CornerRadius="10"
Padding="20"
Margin="20"
Height="80"
>
<StackPanel HorizontalAlignment="Center">
<TextBlock Text="Доступные функции" HorizontalAlignment="Center" Foreground="Blue"/>
<StackPanel Orientation="Horizontal" Background="Red" HorizontalAlignment="Center">
<Button Content="Обновить продукт" Click="ButtonProductEidtor" Background="Green"/>
<Button Content="Изменить агентов" Click="ButtonAgentEidtor" Background="Green"/>
<Button Content="Добавление и удаление продукта" Click="ButtonAddProduct" Background="Green"/>
<Button Content="Редактированть данные продуктов" Click="ButtonProductEidtor" Background="Green"/>
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
</StackPanel>
</ScrollViewer>
</DockPanel>
</Window>