saveWithoutImage;botStackPanel

This commit is contained in:
Your Name 2025-04-25 14:46:43 +03:00
parent a0aef6e93b
commit 6a181d1a05
17 changed files with 95 additions and 84 deletions

View File

@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Avalonia;
@ -70,8 +71,10 @@ public partial class EditAgentWindow : Window
if (string.IsNullOrEmpty(EmailTextBox.Text)) return;
agentPresenter.Email = EmailTextBox.Text;
if (String.IsNullOrEmpty(PathToImage)) return;
agentPresenter.Logo = PathToImage;
if (!string.IsNullOrEmpty(PathToImage))
{
agentPresenter.Logo = PathToImage;
}
Close(agentPresenter);
}
@ -107,6 +110,18 @@ public partial class EditAgentWindow : Window
DirectorNameTextBox.Text = agentPresenter.DirectorName;
PhoneTextBox.Text = agentPresenter.Phone;
EmailTextBox.Text = agentPresenter.Email;
if (!string.IsNullOrEmpty(agentPresenter.Logo))
{
string imagePath = Path.Combine(Environment.CurrentDirectory, agentPresenter.Logo);
if (File.Exists(imagePath))
{
var bitmap = new Bitmap(imagePath);
LogoImage.Source = bitmap;
PathToImage = agentPresenter.Logo;
}
}
switch (agentPresenter.AgentTypeId)
{

View File

@ -6,82 +6,78 @@
x:Class="Voroncov2103.MainWindow"
x:CompileBindings="False"
Title="Voroncov2103">
<Border>
<DockPanel LastChildFill="False">
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Background="Gray" Height="50" Spacing="15">
<TextBlock Text="какойто текст" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox TextChanging="SearchTextBox_OnTextChanging" Width="200" x:Name="SearchTextBox"/>
<StackPanel Orientation="Vertical">
<TextBlock Text="Title"/>
<ComboBox VerticalAlignment="Center" Width="100" x:Name="TitleAgentSortComboBox" SelectionChanged="TitleAgentSortComboBox_OnSelectionChanged">
<ComboBoxItem Content="all"/>
<ComboBoxItem Content="убывание"/>
<ComboBoxItem Content="возрастание"/>
</ComboBox>
<DockPanel>
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Background="Gray" Height="50" Spacing="15">
<TextBlock Text="какойто текст" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox TextChanging="SearchTextBox_OnTextChanging" Width="200" x:Name="SearchTextBox"/>
<StackPanel Orientation="Vertical">
<TextBlock Text="Title"/>
<ComboBox VerticalAlignment="Center" Width="100" x:Name="TitleAgentSortComboBox" SelectionChanged="TitleAgentSortComboBox_OnSelectionChanged">
<ComboBoxItem Content="all"/>
<ComboBoxItem Content="убывание"/>
<ComboBoxItem Content="возрастание"/>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock Text="Sale"/>
<ComboBox VerticalAlignment="Center" Width="100" x:Name="SaleAgentSortComboBox" SelectionChanged="TitleAgentSortComboBox_OnSelectionChanged">
<ComboBoxItem Content="all"/>
<ComboBoxItem Content="убывание"/>
<ComboBoxItem Content="возрастание"/>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock Text="Priority"/>
<ComboBox VerticalAlignment="Center" Width="100" x:Name="PriorityAgentSortComboBox" SelectionChanged="TitleAgentSortComboBox_OnSelectionChanged">
<ComboBoxItem Content="all"/>
<ComboBoxItem Content="убывание"/>
<ComboBoxItem Content="возрастание"/>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock Text="AgentType"/>
<ComboBox VerticalAlignment="Center" Width="100" x:Name="TypeAgentFilterCombobox" SelectionChanged="TypeAgentFilterCombobox_OnSelectionChanged">
<ComboBoxItem Content="Все"/>
<ComboBoxItem Content="ООО"/>
<ComboBoxItem Content="МФО"/>
<ComboBoxItem Content="ЗАО"/>
<ComboBoxItem Content="МКК"/>
<ComboBoxItem Content="ПАО"/>
<ComboBoxItem Content="ОАО"/>
</ComboBox>
</StackPanel>
<Button Content="ADD" Click="AddAgent_OnClick" DockPanel.Dock="Right" Width="60" VerticalAlignment="Center" HorizontalAlignment="Right"/>
</StackPanel>
<ListBox x:Name="ListBox" DockPanel.Dock="Top">
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Gray" BorderThickness="1" Padding="5">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image Source="{Binding Image}" Width="100" Height="100" Margin="0,0,10,0" VerticalAlignment="Center" HorizontalAlignment="Left" Stretch="UniformToFill"/>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Text="{Binding Id, StringFormat='Title: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
<TextBlock Text="{Binding Title, StringFormat='Title: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
<TextBlock Text="{Binding Year, StringFormat='Year: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
<TextBlock Text="{Binding countSales, StringFormat='countSales: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
<TextBlock Text="{Binding sale, StringFormat='sale: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
<TextBlock Text="{Binding totalSalesAmount, StringFormat='totalSalesAmount: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock Text="Sale"/>
<ComboBox VerticalAlignment="Center" Width="100" x:Name="SaleAgentSortComboBox" SelectionChanged="TitleAgentSortComboBox_OnSelectionChanged">
<ComboBoxItem Content="all"/>
<ComboBoxItem Content="убывание"/>
<ComboBoxItem Content="возрастание"/>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock Text="Priority"/>
<ComboBox VerticalAlignment="Center" Width="100" x:Name="PriorityAgentSortComboBox" SelectionChanged="TitleAgentSortComboBox_OnSelectionChanged">
<ComboBoxItem Content="all"/>
<ComboBoxItem Content="убывание"/>
<ComboBoxItem Content="возрастание"/>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock Text="AgentType"/>
<ComboBox VerticalAlignment="Center" Width="100" x:Name="TypeAgentFilterCombobox" SelectionChanged="TypeAgentFilterCombobox_OnSelectionChanged">
<ComboBoxItem Content="Все"/>
<ComboBoxItem Content="ООО"/>
<ComboBoxItem Content="МФО"/>
<ComboBoxItem Content="ЗАО"/>
<ComboBoxItem Content="МКК"/>
<ComboBoxItem Content="ПАО"/>
<ComboBoxItem Content="ОАО"/>
</ComboBox>
</StackPanel>
<Button Content="ADD" Click="AddAgent_OnClick" DockPanel.Dock="Right" Width="60" VerticalAlignment="Center" HorizontalAlignment="Right"/>
</StackPanel>
<ScrollViewer DockPanel.Dock="Top" VerticalScrollBarVisibility="Auto" Height="520">
<ListBox x:Name="ListBox">
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Gray" BorderThickness="1" Padding="5">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image Source="{Binding Image}" Width="100" Height="100" Margin="0,0,10,0" VerticalAlignment="Center" HorizontalAlignment="Left" Stretch="UniformToFill"/>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Text="{Binding Id, StringFormat='Title: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
<TextBlock Text="{Binding Title, StringFormat='Title: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
<TextBlock Text="{Binding Year, StringFormat='Year: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
<TextBlock Text="{Binding countSales, StringFormat='countSales: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
<TextBlock Text="{Binding sale, StringFormat='sale: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
<TextBlock Text="{Binding totalSalesAmount, StringFormat='totalSalesAmount: {0}'}" TextWrapping="Wrap" TextAlignment="Center" />
</StackPanel>
</StackPanel>
</Grid>
<Border.ContextMenu>
<ContextMenu>
<MenuItem Header="edit" Click="EditMenuItem_OnClick"/>
<MenuItem Header="priority" Click="PriorityMenuItem_OnClick"/>
</ContextMenu>
</Border.ContextMenu>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</ScrollViewer>
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="PreviousButton" Content="Предыдущая" Click="PreviousPage" Margin="5"/>
<Button x:Name="NextButton" Content="Следующая" Click="NextPage" Margin="5"/>
</StackPanel>
</DockPanel>
</Border>
</Window>
</Grid>
<Border.ContextMenu>
<ContextMenu>
<MenuItem Header="edit" Click="EditMenuItem_OnClick"/>
<MenuItem Header="priority" Click="PriorityMenuItem_OnClick"/>
</ContextMenu>
</Border.ContextMenu>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Stretch" Height="50" Background="Black" VerticalAlignment="Bottom">
<Button x:Name="PreviousButton" Content="Предыдущая" Click="PreviousPage" Margin="5" HorizontalAlignment="Center"/>
<Button x:Name="NextButton" Content="Следующая" Click="NextPage" Margin="5" HorizontalAlignment="Center"/>
</StackPanel>
</DockPanel>
</Window>

View File

@ -111,8 +111,8 @@ public partial class MainWindow : Window
// Console.WriteLine(item.Id);
}
PreviousButton.IsEnabled = currentPage > 1;
NextButton.IsEnabled = currentPage < totalPages;
// PreviousButton.IsEnabled = currentPage > 1;
// NextButton.IsEnabled = currentPage < totalPages;
}
private void NextPage(object? sender, Avalonia.Interactivity.RoutedEventArgs e)

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Voroncov2103")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1389d8aa63ee86ebe0cdad05a197766d7fcb2d10")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a0aef6e93b876614c5a0487b8c95ed476d659185")]
[assembly: System.Reflection.AssemblyProductAttribute("Voroncov2103")]
[assembly: System.Reflection.AssemblyTitleAttribute("Voroncov2103")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
1b980c123927c3f71b991ddad4954187c6b5af4fa6ee1ad1d1caf0d95368c81e
772baa7e32d085dbca8a8b9245209603dc8872ea8e271c412e4f899509da3808