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;
using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia; using Avalonia;
@ -70,8 +71,10 @@ public partial class EditAgentWindow : Window
if (string.IsNullOrEmpty(EmailTextBox.Text)) return; if (string.IsNullOrEmpty(EmailTextBox.Text)) return;
agentPresenter.Email = EmailTextBox.Text; agentPresenter.Email = EmailTextBox.Text;
if (String.IsNullOrEmpty(PathToImage)) return; if (!string.IsNullOrEmpty(PathToImage))
{
agentPresenter.Logo = PathToImage; agentPresenter.Logo = PathToImage;
}
Close(agentPresenter); Close(agentPresenter);
} }
@ -108,6 +111,18 @@ public partial class EditAgentWindow : Window
PhoneTextBox.Text = agentPresenter.Phone; PhoneTextBox.Text = agentPresenter.Phone;
EmailTextBox.Text = agentPresenter.Email; 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) switch (agentPresenter.AgentTypeId)
{ {
case 1: TypeAgentFilterCombobox.SelectedIndex = 0; break; case 1: TypeAgentFilterCombobox.SelectedIndex = 0; break;

View File

@ -6,8 +6,7 @@
x:Class="Voroncov2103.MainWindow" x:Class="Voroncov2103.MainWindow"
x:CompileBindings="False" x:CompileBindings="False"
Title="Voroncov2103"> Title="Voroncov2103">
<Border> <DockPanel>
<DockPanel LastChildFill="False">
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Background="Gray" Height="50" Spacing="15"> <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Background="Gray" Height="50" Spacing="15">
<TextBlock Text="какойто текст" HorizontalAlignment="Center" VerticalAlignment="Center"/> <TextBlock Text="какойто текст" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox TextChanging="SearchTextBox_OnTextChanging" Width="200" x:Name="SearchTextBox"/> <TextBox TextChanging="SearchTextBox_OnTextChanging" Width="200" x:Name="SearchTextBox"/>
@ -49,8 +48,7 @@
</StackPanel> </StackPanel>
<Button Content="ADD" Click="AddAgent_OnClick" DockPanel.Dock="Right" Width="60" VerticalAlignment="Center" HorizontalAlignment="Right"/> <Button Content="ADD" Click="AddAgent_OnClick" DockPanel.Dock="Right" Width="60" VerticalAlignment="Center" HorizontalAlignment="Right"/>
</StackPanel> </StackPanel>
<ScrollViewer DockPanel.Dock="Top" VerticalScrollBarVisibility="Auto" Height="520"> <ListBox x:Name="ListBox" DockPanel.Dock="Top">
<ListBox x:Name="ListBox">
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Border BorderBrush="Gray" BorderThickness="1" Padding="5"> <Border BorderBrush="Gray" BorderThickness="1" Padding="5">
@ -77,11 +75,9 @@
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ListBox.ItemTemplate>
</ListBox> </ListBox>
</ScrollViewer> <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Stretch" Height="50" Background="Black" VerticalAlignment="Bottom">
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center"> <Button x:Name="PreviousButton" Content="Предыдущая" Click="PreviousPage" Margin="5" HorizontalAlignment="Center"/>
<Button x:Name="PreviousButton" Content="Предыдущая" Click="PreviousPage" Margin="5"/> <Button x:Name="NextButton" Content="Следующая" Click="NextPage" Margin="5" HorizontalAlignment="Center"/>
<Button x:Name="NextButton" Content="Следующая" Click="NextPage" Margin="5"/>
</StackPanel> </StackPanel>
</DockPanel> </DockPanel>
</Border>
</Window> </Window>

View File

@ -111,8 +111,8 @@ public partial class MainWindow : Window
// Console.WriteLine(item.Id); // Console.WriteLine(item.Id);
} }
PreviousButton.IsEnabled = currentPage > 1; // PreviousButton.IsEnabled = currentPage > 1;
NextButton.IsEnabled = currentPage < totalPages; // NextButton.IsEnabled = currentPage < totalPages;
} }
private void NextPage(object? sender, Avalonia.Interactivity.RoutedEventArgs e) 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.AssemblyCompanyAttribute("Voroncov2103")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [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.AssemblyProductAttribute("Voroncov2103")]
[assembly: System.Reflection.AssemblyTitleAttribute("Voroncov2103")] [assembly: System.Reflection.AssemblyTitleAttribute("Voroncov2103")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
1b980c123927c3f71b991ddad4954187c6b5af4fa6ee1ad1d1caf0d95368c81e 772baa7e32d085dbca8a8b9245209603dc8872ea8e271c412e4f899509da3808