Виктор Пиктор
parent
db9efc98b9
commit
feb4764a4f
|
|
@ -22,6 +22,7 @@
|
||||||
<entry key="Policlinica/Views/ServiecWindow.axaml" value="Policlinica/Policlinica.csproj" />
|
<entry key="Policlinica/Views/ServiecWindow.axaml" value="Policlinica/Policlinica.csproj" />
|
||||||
<entry key="Policlinica/Views/StartView.axaml" value="Policlinica/Policlinica.csproj" />
|
<entry key="Policlinica/Views/StartView.axaml" value="Policlinica/Policlinica.csproj" />
|
||||||
<entry key="Policlinica/Views/StartWindow.axaml" value="Policlinica/Policlinica.csproj" />
|
<entry key="Policlinica/Views/StartWindow.axaml" value="Policlinica/Policlinica.csproj" />
|
||||||
|
<entry key="Policlinica/Views/SugarCheckView.axaml" value="Policlinica/Policlinica.csproj" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,8 @@ public class RecordRep:BaseRep
|
||||||
mc.Parameters.AddWithValue("@total_amount", record.TotalAmount);
|
mc.Parameters.AddWithValue("@total_amount", record.TotalAmount);
|
||||||
mc.Parameters.AddWithValue("@record_date", record.RecordDate);
|
mc.Parameters.AddWithValue("@record_date", record.RecordDate);
|
||||||
|
|
||||||
int result = mc.ExecuteNonQuery();
|
mc.ExecuteNonQuery();
|
||||||
Console.WriteLine($"ExecuteNonQuery returned: {result}");
|
Console.WriteLine($"ExecuteNonQuery returned");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Получаем ID последней вставленной записи
|
// Получаем ID последней вставленной записи
|
||||||
|
|
@ -119,21 +119,31 @@ public class RecordRep:BaseRep
|
||||||
|
|
||||||
public bool Delete(int id)
|
public bool Delete(int id)
|
||||||
{
|
{
|
||||||
string sql = @"delete from `records` where `id` = @id";
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var mc = new MySqlCommand(sql, connection))
|
// Сначала удаляем все связанные record_items
|
||||||
|
string deleteItemsSql = @"delete from `record_items` where `record_id` = @id";
|
||||||
|
using (var mc = new MySqlCommand(deleteItemsSql, connection))
|
||||||
{
|
{
|
||||||
mc.Parameters.AddWithValue("@id", id);
|
mc.Parameters.AddWithValue("@id", id);
|
||||||
mc.ExecuteNonQuery();
|
mc.ExecuteNonQuery();
|
||||||
|
Console.WriteLine($"Deleted record items for record {id}");
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
|
|
||||||
|
// Затем удаляем саму запись
|
||||||
|
string deleteRecordSql = @"delete from `records` where `id` = @id";
|
||||||
|
using (var mc = new MySqlCommand(deleteRecordSql, connection))
|
||||||
|
{
|
||||||
|
mc.Parameters.AddWithValue("@id", id);
|
||||||
|
mc.ExecuteNonQuery();
|
||||||
|
Console.WriteLine($"Deleted record {id}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine(e);
|
Console.WriteLine($"Error deleting record: {e}");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,4 +34,10 @@
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Update="Views\SugarCheckView.axaml.cs">
|
||||||
|
<DependentUpon>SugarCheckView.axaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Templates;
|
using Avalonia.Controls.Templates;
|
||||||
using Policlinica.ViewModels;
|
using Policlinica.ViewModels;
|
||||||
|
using Policlinica.Views;
|
||||||
|
|
||||||
namespace Policlinica;
|
namespace Policlinica;
|
||||||
|
|
||||||
|
|
@ -24,7 +25,15 @@ public class ViewLocator : IDataTemplate
|
||||||
|
|
||||||
if (type != null)
|
if (type != null)
|
||||||
{
|
{
|
||||||
return (Control)Activator.CreateInstance(type)!;
|
var view = (Control)Activator.CreateInstance(type)!;
|
||||||
|
|
||||||
|
// Специальная обработка для SugarCheckViewModel
|
||||||
|
if (param is SugarCheckViewModel sugarVm && view is SugarCheckView sugarView)
|
||||||
|
{
|
||||||
|
sugarVm.SetView(sugarView);
|
||||||
|
}
|
||||||
|
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TextBlock { Text = "Not Found: " + name };
|
return new TextBlock { Text = "Not Found: " + name };
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -23,6 +23,7 @@ public partial class AdminViewModel : ViewModelBase
|
||||||
[ObservableProperty] ObservableCollection<Record> _recordsList = new();
|
[ObservableProperty] ObservableCollection<Record> _recordsList = new();
|
||||||
[ObservableProperty] private Record _selectedRecord;
|
[ObservableProperty] private Record _selectedRecord;
|
||||||
[ObservableProperty] private ObservableCollection<User> userList = new ObservableCollection<User>();
|
[ObservableProperty] private ObservableCollection<User> userList = new ObservableCollection<User>();
|
||||||
|
[ObservableProperty] string statusMessage = "";
|
||||||
|
|
||||||
public AdminViewModel(Navigation navigation, IServiceProvider provider, RecordRep recordRep,User user,UserRepository userRepository)
|
public AdminViewModel(Navigation navigation, IServiceProvider provider, RecordRep recordRep,User user,UserRepository userRepository)
|
||||||
{
|
{
|
||||||
|
|
@ -40,17 +41,38 @@ public partial class AdminViewModel : ViewModelBase
|
||||||
Id = obj.Id;
|
Id = obj.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RecordsList = new ObservableCollection<Record>(recordRep.GetRecord(Id));
|
RecordsList = new ObservableCollection<Record>(recordRep.GetRecord(Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
void DeleteRecord()
|
void DeleteRecord()
|
||||||
{
|
{
|
||||||
_recordRep.Delete(SelectedRecord.Id);
|
if (SelectedRecord == null)
|
||||||
|
{
|
||||||
|
StatusMessage = "Выберите запись для удаления";
|
||||||
|
Console.WriteLine("No record selected for deletion");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bool deleted = _recordRep.Delete(SelectedRecord.Id);
|
||||||
|
if (deleted)
|
||||||
|
{
|
||||||
|
StatusMessage = "Запись успешно удалена";
|
||||||
RecordsList = new ObservableCollection<Record>(_recordRep.GetRecord(Id));
|
RecordsList = new ObservableCollection<Record>(_recordRep.GetRecord(Id));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StatusMessage = "Ошибка при удалении записи";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
StatusMessage = $"Ошибка: {ex.Message}";
|
||||||
|
Console.WriteLine($"Error deleting record: {ex}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
void GoService()
|
void GoService()
|
||||||
|
|
@ -59,4 +81,11 @@ public partial class AdminViewModel : ViewModelBase
|
||||||
_navigation.Navigate(vm);
|
_navigation.Navigate(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[RelayCommand]
|
||||||
|
void GoSugarCheck()
|
||||||
|
{
|
||||||
|
var vm = ActivatorUtilities.CreateInstance<SugarCheckViewModel>(_provider);
|
||||||
|
_navigation.Navigate(vm);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,33 +1,53 @@
|
||||||
<UserControl xmlns="https://github.com/avaloniaui"
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewModels="clr-namespace:Policlinica.ViewModels"
|
xmlns:viewModels="clr-namespace:Policlinica.ViewModels"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="700"
|
||||||
x:Class="Policlinica.Views.AdminView"
|
x:Class="Policlinica.Views.AdminView"
|
||||||
x:DataType="viewModels:AdminViewModel">
|
x:DataType="viewModels:AdminViewModel">
|
||||||
|
|
||||||
<Grid RowDefinitions="Auto,*,Auto" Margin="20">
|
<StackPanel Margin="30" Spacing="20">
|
||||||
<DataGrid ItemsSource="{Binding RecordsList }" SelectedItem="{Binding SelectedRecord }">
|
<TextBlock Text="Управление записями" FontSize="24" FontWeight="Bold" HorizontalAlignment="Center"/>
|
||||||
|
|
||||||
|
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||||
|
<StackPanel Spacing="10">
|
||||||
|
<TextBlock Text="Список записей:" FontWeight="Bold" FontSize="16"/>
|
||||||
|
<DataGrid ItemsSource="{Binding RecordsList }" SelectedItem="{Binding SelectedRecord }" MinHeight="300">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridCheckBoxColumn IsVisible="True"/>
|
<DataGridCheckBoxColumn IsVisible="True"/>
|
||||||
<!--><DataGridCheckBoxColumn/><!-->
|
|
||||||
<DataGridTextColumn Binding="{Binding ClientName}" Header="Имя клиента"/>
|
<DataGridTextColumn Binding="{Binding ClientName}" Header="Имя клиента"/>
|
||||||
<DataGridTextColumn Binding="{Binding ClientSurname}" Header="Фамилия клиента"/>
|
<DataGridTextColumn Binding="{Binding ClientSurname}" Header="Фамилия клиента"/>
|
||||||
<DataGridTextColumn Binding="{Binding Title}" Header="Врач"/>
|
<DataGridTextColumn Binding="{Binding Title}" Header="Врач"/>
|
||||||
<DataGridTextColumn Binding="{Binding Name}" Header="Логин"/>
|
|
||||||
<DataGridTextColumn Binding="{Binding TotalAmount}" Header="Цена"/>
|
<DataGridTextColumn Binding="{Binding TotalAmount}" Header="Цена"/>
|
||||||
<DataGridTextColumn Binding="{Binding ServiceName}" Header="Услуга"/>
|
<DataGridTextColumn Binding="{Binding ServiceName}" Header="Услуга"/>
|
||||||
<DataGridTextColumn Binding="{Binding RecordDate}" Header="Дата"/>
|
<DataGridTextColumn Binding="{Binding RecordDate}" Header="Дата"/>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
<StackPanel Grid.Row="2" Orientation="Horizontal">
|
|
||||||
|
|
||||||
|
|
||||||
<Button Content="Удалить выбранную работу" FontSize="20" HorizontalAlignment="Center" Command="{Binding DeleteRecordCommand}"/>
|
|
||||||
<Button Content="Добавить запись" FontSize="20" HorizontalAlignment="Center" Command="{Binding GoServiceCommand}"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Border>
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding StatusMessage}" Foreground="Green" FontSize="14" TextWrapping="Wrap"/>
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
|
||||||
|
<Button Content="Удалить запись"
|
||||||
|
FontSize="16"
|
||||||
|
Padding="18,12"
|
||||||
|
Background="Red"
|
||||||
|
Foreground="White"
|
||||||
|
Command="{Binding DeleteRecordCommand}"/>
|
||||||
|
<Button Content="Добавить запись"
|
||||||
|
FontSize="16"
|
||||||
|
Padding="18,12"
|
||||||
|
Background="Green"
|
||||||
|
Foreground="White"
|
||||||
|
Command="{Binding GoServiceCommand}"/>
|
||||||
|
<Button Content="Проверка сахара"
|
||||||
|
FontSize="16"
|
||||||
|
Padding="18,12"
|
||||||
|
Background="Orange"
|
||||||
|
Foreground="White"
|
||||||
|
Command="{Binding GoSugarCheckCommand}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
<!-->я устал<!-->
|
|
||||||
<!-->я тоже<!-->
|
|
||||||
|
|
|
||||||
|
|
@ -3,26 +3,49 @@
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:vm="using:Policlinica.ViewModels"
|
xmlns:vm="using:Policlinica.ViewModels"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600"
|
||||||
x:Class="Policlinica.Views.DoctorView"
|
x:Class="Policlinica.Views.DoctorView"
|
||||||
x:DataType="vm:DoctorViewModel">
|
x:DataType="vm:DoctorViewModel">
|
||||||
|
|
||||||
<Border BorderBrush="Aqua" CornerRadius="8" BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10">
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="40" Spacing="20">
|
||||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
||||||
|
|
||||||
<TextBlock Text="Создание заказа" FontSize="20" FontWeight="Bold" HorizontalAlignment="Center"/>
|
<TextBlock Text="Создание записи" FontSize="24" FontWeight="Bold" HorizontalAlignment="Center"/>
|
||||||
|
|
||||||
<TextBlock Text="Введите имя клиента:" />
|
<!-- Ввод имени клиента -->
|
||||||
<TextBox Text="{Binding Name}"/>
|
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||||
|
<StackPanel Spacing="10">
|
||||||
<TextBlock Text="Введите фамилию клиента:" />
|
<TextBlock Text="Имя клиента:" FontWeight="Bold" FontSize="14"/>
|
||||||
<TextBox Text="{Binding Surname}"/>
|
<TextBox Text="{Binding Name}" Padding="10" FontSize="13" Watermark="Введите имя"/>
|
||||||
|
|
||||||
<ComboBox ItemsSource="{Binding DoctorList}"
|
|
||||||
SelectedItem="{Binding SelectedDoctor}"
|
|
||||||
DisplayMemberBinding="{Binding Title}"/>
|
|
||||||
<Button Content="Далее"
|
|
||||||
Command="{Binding StartTestCommand}"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
<!-- Ввод фамилии клиента -->
|
||||||
|
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||||
|
<StackPanel Spacing="10">
|
||||||
|
<TextBlock Text="Фамилия клиента:" FontWeight="Bold" FontSize="14"/>
|
||||||
|
<TextBox Text="{Binding Surname}" Padding="10" FontSize="13" Watermark="Введите фамилию"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- Выбор врача -->
|
||||||
|
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||||
|
<StackPanel Spacing="10">
|
||||||
|
<TextBlock Text="Выберите врача:" FontWeight="Bold" FontSize="14"/>
|
||||||
|
<ComboBox ItemsSource="{Binding DoctorList}"
|
||||||
|
SelectedItem="{Binding SelectedDoctor}"
|
||||||
|
DisplayMemberBinding="{Binding Title}"
|
||||||
|
Padding="10"
|
||||||
|
FontSize="13"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- Кнопка -->
|
||||||
|
<Button Content="Далее"
|
||||||
|
FontSize="16"
|
||||||
|
Padding="20,12"
|
||||||
|
Background="Green"
|
||||||
|
Foreground="White"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Command="{Binding StartTestCommand}"/>
|
||||||
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,18 @@
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewModels="clr-namespace:Policlinica.ViewModels"
|
xmlns:viewModels="clr-namespace:Policlinica.ViewModels"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600"
|
mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="700"
|
||||||
x:Class="Policlinica.Views.RecordItemsView"
|
x:Class="Policlinica.Views.RecordItemsView"
|
||||||
x:DataType="viewModels:RecordItemsViewModel">
|
x:DataType="viewModels:RecordItemsViewModel">
|
||||||
|
|
||||||
<StackPanel Margin="20" Spacing="15">
|
<StackPanel Margin="30" Spacing="20">
|
||||||
<!-- Заголовок -->
|
<!-- Заголовок -->
|
||||||
<TextBlock Text="Подтверждение записи" FontSize="24" FontWeight="Bold" HorizontalAlignment="Center"/>
|
<TextBlock Text="Подтверждение записи" FontSize="24" FontWeight="Bold" HorizontalAlignment="Center"/>
|
||||||
|
|
||||||
<!-- Информация о клиенте -->
|
<!-- Информация о клиенте -->
|
||||||
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||||
<StackPanel Spacing="10">
|
<StackPanel Spacing="10">
|
||||||
<TextBlock FontWeight="Bold" FontSize="16">Клиент:</TextBlock>
|
<TextBlock Text="Клиент:" FontWeight="Bold" FontSize="16"/>
|
||||||
<TextBlock Text="{Binding ClientName}" FontSize="14"/>
|
<TextBlock Text="{Binding ClientName}" FontSize="14"/>
|
||||||
<TextBlock Text="{Binding ClientSurname}" FontSize="14"/>
|
<TextBlock Text="{Binding ClientSurname}" FontSize="14"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<!-- Информация о враче -->
|
<!-- Информация о враче -->
|
||||||
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||||
<StackPanel Spacing="10">
|
<StackPanel Spacing="10">
|
||||||
<TextBlock FontWeight="Bold" FontSize="16">Врач:</TextBlock>
|
<TextBlock Text="Врач:" FontWeight="Bold" FontSize="16"/>
|
||||||
<TextBlock Text="{Binding SelectedDoctor.Title}" FontSize="14"/>
|
<TextBlock Text="{Binding SelectedDoctor.Title}" FontSize="14"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
@ -31,14 +31,14 @@
|
||||||
<!-- Выбранные услуги -->
|
<!-- Выбранные услуги -->
|
||||||
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||||
<StackPanel Spacing="10">
|
<StackPanel Spacing="10">
|
||||||
<TextBlock FontWeight="Bold" FontSize="16">Выбранные услуги:</TextBlock>
|
<TextBlock Text="Выбранные услуги:" FontWeight="Bold" FontSize="16"/>
|
||||||
|
|
||||||
<ListBox ItemsSource="{Binding SelectedServices}" Height="150">
|
<ListBox ItemsSource="{Binding SelectedServices}" MinHeight="150">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
<StackPanel Orientation="Horizontal" Spacing="20" Margin="5">
|
||||||
<TextBlock Text="{Binding ServiceName}" Width="200"/>
|
<TextBlock Text="{Binding ServiceName}" Width="300" FontSize="13"/>
|
||||||
<TextBlock Text="{Binding Price}" Width="100"/>
|
<TextBlock Text="{Binding Price}" Width="100" FontSize="13"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
|
|
@ -47,10 +47,10 @@
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Итоговая сумма -->
|
<!-- Итоговая сумма -->
|
||||||
<Border BorderBrush="LightBlue" BorderThickness="2" Padding="15" CornerRadius="5" Background="#F0F8FF">
|
<Border BorderBrush="DodgerBlue" BorderThickness="2" Padding="20" CornerRadius="5" Background="WhiteSmoke">
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="30">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="30">
|
||||||
<TextBlock Text="Итого:" FontWeight="Bold" FontSize="16" VerticalAlignment="Center"/>
|
<TextBlock Text="Итого:" FontWeight="Bold" FontSize="16"/>
|
||||||
<TextBlock Text="{Binding TotalAmount}" FontSize="18" FontWeight="Bold" Foreground="Blue"/>
|
<TextBlock Text="{Binding TotalAmount}" FontSize="18" FontWeight="Bold" Foreground="DodgerBlue"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
|
@ -58,10 +58,18 @@
|
||||||
<TextBlock Text="{Binding StatusMessage}" Foreground="Green" FontSize="14" TextWrapping="Wrap"/>
|
<TextBlock Text="{Binding StatusMessage}" Foreground="Green" FontSize="14" TextWrapping="Wrap"/>
|
||||||
|
|
||||||
<!-- Кнопки -->
|
<!-- Кнопки -->
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20" Margin="0,20,0,0">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
|
||||||
<Button Content="Сохранить запись" FontSize="16" Padding="20,10" Background="Green" Foreground="White"
|
<Button Content="Сохранить запись"
|
||||||
|
FontSize="16"
|
||||||
|
Padding="20,12"
|
||||||
|
Background="Green"
|
||||||
|
Foreground="White"
|
||||||
Command="{Binding SaveToDatabaseCommand}"/>
|
Command="{Binding SaveToDatabaseCommand}"/>
|
||||||
<Button Content="Вернуться" FontSize="16" Padding="20,10" Background="Gray" Foreground="White"
|
<Button Content="Вернуться"
|
||||||
|
FontSize="16"
|
||||||
|
Padding="20,12"
|
||||||
|
Background="Gray"
|
||||||
|
Foreground="White"
|
||||||
Command="{Binding CancelCommand}"/>
|
Command="{Binding CancelCommand}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,46 @@
|
||||||
<UserControl xmlns="https://github.com/avaloniaui"
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewModels="clr-namespace:Policlinica.ViewModels"
|
xmlns:viewModels="clr-namespace:Policlinica.ViewModels"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="700"
|
||||||
x:Class="Policlinica.Views.ServiceView"
|
x:Class="Policlinica.Views.ServiceView"
|
||||||
x:DataType="viewModels:ServiceViewModel">
|
x:DataType="viewModels:ServiceViewModel">
|
||||||
|
|
||||||
<Grid RowDefinitions="Auto,*,Auto" Margin="20">
|
<StackPanel Margin="30" Spacing="20">
|
||||||
|
|
||||||
<ListBox Grid.Row="1" Grid.Column="0" ItemsSource="{Binding Services}">
|
<TextBlock Text="Выберите услугу" FontSize="24" FontWeight="Bold" HorizontalAlignment="Center"/>
|
||||||
|
|
||||||
|
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||||
|
<StackPanel Spacing="10">
|
||||||
|
<TextBlock Text="Доступные услуги:" FontWeight="Bold" FontSize="14"/>
|
||||||
|
<ListBox ItemsSource="{Binding Services}" MinHeight="250">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal" Spacing="20" Margin="10">
|
||||||
<CheckBox IsChecked="{Binding IsSelected}" ></CheckBox>
|
<CheckBox IsChecked="{Binding IsSelected}"/>
|
||||||
<TextBlock Text="{Binding Service.ServiceName}"></TextBlock>
|
<TextBlock Text="{Binding Service.ServiceName}" Width="250" FontSize="13"/>
|
||||||
<TextBlock Text="{Binding Service.Price}"></TextBlock>
|
<TextBlock Text="{Binding Service.Price}" Width="100" FontSize="13"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<TextBlock Text="Выберите услугу" FontSize="20" HorizontalAlignment="Center"/>
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
|
||||||
<Button Grid.Row="2" Content="Продолжить" FontSize="20" HorizontalAlignment="Center" Command="{Binding DobavlenieCommand}"/>
|
<Button Content="Продолжить"
|
||||||
</Grid>
|
FontSize="16"
|
||||||
|
Padding="20,12"
|
||||||
|
Background="Green"
|
||||||
|
Foreground="White"
|
||||||
|
Command="{Binding DobavlenieCommand}"/>
|
||||||
|
<Button Content="Назад"
|
||||||
|
FontSize="16"
|
||||||
|
Padding="20,12"
|
||||||
|
Background="Gray"
|
||||||
|
Foreground="White"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue