Пук пук

master
vikto 2026-05-20 16:04:57 +10:00
parent 2832adf6b9
commit 4de787127f
24 changed files with 377 additions and 149 deletions

View File

@ -1,6 +1,8 @@
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Controls.Templates; using Avalonia.Controls.Templates;
using Policlinica.ViewModels; using Policlinica.ViewModels;
using Policlinica.Views; using Policlinica.Views;
@ -33,6 +35,16 @@ public class ViewLocator : IDataTemplate
sugarVm.SetView(sugarView); sugarVm.SetView(sugarView);
} }
// Специальная обработка для AdminViewModel
if (param is AdminViewModel adminVm)
{
// Получаем главное окно из ApplicationLifetime
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
adminVm.SetCloseAction(() => desktop.MainWindow?.Close());
}
}
return view; return view;
} }

View File

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using Avalonia.Controls;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -20,6 +21,7 @@ public partial class AdminViewModel : ViewModelBase
private readonly UserRepository _userRepository; private readonly UserRepository _userRepository;
private readonly DoctorRepository _doctorRepository; private readonly DoctorRepository _doctorRepository;
private readonly ServiceRepository _serviceRepository; private readonly ServiceRepository _serviceRepository;
private List<Record> _allRecords; // Сохраняем все записи для поиска
[ObservableProperty] string _login; [ObservableProperty] string _login;
[ObservableProperty] int _id; [ObservableProperty] int _id;
@ -27,6 +29,7 @@ public partial class AdminViewModel : ViewModelBase
[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 = ""; [ObservableProperty] string statusMessage = "";
[ObservableProperty] string searchText = "";
[ObservableProperty] string editClientName = ""; [ObservableProperty] string editClientName = "";
[ObservableProperty] string editClientSurname = ""; [ObservableProperty] string editClientSurname = "";
@ -37,6 +40,8 @@ public partial class AdminViewModel : ViewModelBase
[ObservableProperty] decimal editTotalAmount = 0; [ObservableProperty] decimal editTotalAmount = 0;
[ObservableProperty] string editRecordDate = ""; [ObservableProperty] string editRecordDate = "";
private Action _closeAction;
public AdminViewModel(Navigation navigation, IServiceProvider provider, RecordRep recordRep, User user, UserRepository userRepository, DoctorRepository doctorRepository, ServiceRepository serviceRepository) public AdminViewModel(Navigation navigation, IServiceProvider provider, RecordRep recordRep, User user, UserRepository userRepository, DoctorRepository doctorRepository, ServiceRepository serviceRepository)
{ {
_navigation = navigation; _navigation = navigation;
@ -54,10 +59,16 @@ public partial class AdminViewModel : ViewModelBase
Id = obj.Id; Id = obj.Id;
} }
RecordsList = new ObservableCollection<Record>(recordRep.GetRecord(Id)); _allRecords = recordRep.GetRecord(Id);
RecordsList = new ObservableCollection<Record>(_allRecords);
DoctorList = new ObservableCollection<Doctor>(doctorRepository.GetDoctorsByTest()); DoctorList = new ObservableCollection<Doctor>(doctorRepository.GetDoctorsByTest());
} }
public void SetCloseAction(Action closeAction)
{
_closeAction = closeAction;
}
partial void OnSelectedRecordChanged(Record value) partial void OnSelectedRecordChanged(Record value)
{ {
if (value != null) if (value != null)
@ -93,6 +104,34 @@ public partial class AdminViewModel : ViewModelBase
} }
} }
[RelayCommand]
void SearchRecords()
{
if (string.IsNullOrWhiteSpace(SearchText))
{
// Если поле поиска пусто, показываем все записи
RecordsList = new ObservableCollection<Record>(_allRecords);
return;
}
// Фильтруем записи по имени или фамилии клиента
var filteredRecords = _allRecords
.Where(r => r.ClientName.Contains(SearchText, StringComparison.OrdinalIgnoreCase) ||
r.ClientSurname.Contains(SearchText, StringComparison.OrdinalIgnoreCase))
.ToList();
RecordsList = new ObservableCollection<Record>(filteredRecords);
StatusMessage = $"Найдено {filteredRecords.Count} записей";
}
[RelayCommand]
void ShowAllRecords()
{
SearchText = "";
RecordsList = new ObservableCollection<Record>(_allRecords);
StatusMessage = $"Показано {_allRecords.Count} записей";
}
[RelayCommand] [RelayCommand]
void UpdateRecord() void UpdateRecord()
{ {
@ -131,9 +170,11 @@ public partial class AdminViewModel : ViewModelBase
if (updated) if (updated)
{ {
StatusMessage = "Запись успешно обновлена"; StatusMessage = "Запись успешно обновлена";
RecordsList = new ObservableCollection<Record>(_recordRep.GetRecord(Id)); _allRecords = _recordRep.GetRecord(Id);
RecordsList = new ObservableCollection<Record>(_allRecords);
SelectedRecord = null; SelectedRecord = null;
ClearEditFields(); ClearEditFields();
SearchText = "";
} }
else else
{ {
@ -174,9 +215,11 @@ public partial class AdminViewModel : ViewModelBase
if (deleted) if (deleted)
{ {
StatusMessage = "Запись успешно удалена"; StatusMessage = "Запись успешно удалена";
RecordsList = new ObservableCollection<Record>(_recordRep.GetRecord(Id)); _allRecords = _recordRep.GetRecord(Id);
RecordsList = new ObservableCollection<Record>(_allRecords);
SelectedRecord = null; SelectedRecord = null;
ClearEditFields(); ClearEditFields();
SearchText = "";
} }
else else
{ {
@ -204,4 +247,11 @@ public partial class AdminViewModel : ViewModelBase
_navigation.Navigate(vm); _navigation.Navigate(vm);
} }
[RelayCommand]
void ExitApplication()
{
Console.WriteLine("Exit button clicked");
_closeAction?.Invoke();
}
} }

View File

@ -24,8 +24,6 @@ public partial class DoctorViewModel : ViewModelBase
_provider = provider; _provider = provider;
_doctorList = new ObservableCollection<Doctor>(repository.GetDoctorsByTest()); _doctorList = new ObservableCollection<Doctor>(repository.GetDoctorsByTest());
_navigation = navigation; _navigation = navigation;
} }
[RelayCommand] [RelayCommand]
@ -44,4 +42,11 @@ public partial class DoctorViewModel : ViewModelBase
_navigation.Navigate(vm); _navigation.Navigate(vm);
} }
[RelayCommand]
public void GoBack()
{
var vm = ActivatorUtilities.CreateInstance<AdminViewModel>(_provider);
_navigation.Navigate(vm);
}
} }

View File

@ -120,7 +120,7 @@ public partial class RecordItemsViewModel : ViewModelBase
} }
[RelayCommand] [RelayCommand]
public void Cancel() public void GoBack()
{ {
var repository = _provider.GetRequiredService<ServiceRepository>(); var repository = _provider.GetRequiredService<ServiceRepository>();
var vm = ActivatorUtilities.CreateInstance<ServiceViewModel>(_provider, selectedDoctor, repository, clientName, clientSurname); var vm = ActivatorUtilities.CreateInstance<ServiceViewModel>(_provider, selectedDoctor, repository, clientName, clientSurname);

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
@ -14,16 +14,33 @@ public partial class RegistrationViewModel : ViewModelBase
private readonly Navigation _navigation; private readonly Navigation _navigation;
private readonly IServiceProvider _provider; private readonly IServiceProvider _provider;
[ObservableProperty] private string _password; [ObservableProperty] private string _password = "";
[ObservableProperty] private string _login; [ObservableProperty] private string _login = "";
[ObservableProperty] public string _eror; [ObservableProperty] public string _eror = "";
public RegistrationViewModel(IServiceProvider serviceProvider, Navigation navigation, IServiceProvider provider) public RegistrationViewModel(IServiceProvider serviceProvider, Navigation navigation, IServiceProvider provider)
{ {
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
_navigation = navigation; _navigation = navigation;
_provider = provider; _provider = provider;
}
partial void OnPasswordChanged(string value)
{
// Ограничиваем пароль до 8 символов
if (value != null && value.Length > 8)
{
Password = value.Substring(0, 8);
}
}
partial void OnLoginChanged(string value)
{
// Ограничиваем логин до 15 символов
if (value != null && value.Length > 15)
{
Login = value.Substring(0, 15);
}
} }
[RelayCommand] [RelayCommand]
@ -31,12 +48,28 @@ public partial class RegistrationViewModel : ViewModelBase
{ {
var vm = _serviceProvider.GetRequiredService<AutorizationViewModel>(); var vm = _serviceProvider.GetRequiredService<AutorizationViewModel>();
_navigation.Navigate(vm); _navigation.Navigate(vm);
} }
[RelayCommand] [RelayCommand]
void Registration() void Registration()
{ {
if (string.IsNullOrWhiteSpace(Login))
{
Eror = "Логин не может быть пустым";
return;
}
if (string.IsNullOrWhiteSpace(Password))
{
Eror = "Пароль не может быть пустым";
return;
}
if (Password.Length < 4)
{
Eror = "Пароль должен быть минимум 4 символа";
return;
}
using (UserRepository repository = _provider.GetRequiredService<UserRepository>()) using (UserRepository repository = _provider.GetRequiredService<UserRepository>())
{ {
@ -46,6 +79,7 @@ public partial class RegistrationViewModel : ViewModelBase
Eror = "Такой логин уже существует"; Eror = "Такой логин уже существует";
return; return;
} }
var user = new User() var user = new User()
{ {
Name = Login, Name = Login,
@ -61,7 +95,4 @@ public partial class RegistrationViewModel : ViewModelBase
_navigation.Navigate(vm); _navigation.Navigate(vm);
} }
} }
} }

View File

@ -34,7 +34,6 @@ public partial class ServiceViewModel : ViewModelBase
name = clientName; name = clientName;
surname = clientSurname; surname = clientSurname;
Services = new ObservableCollection<ServiceSelected>(repository.GetServicesByDoctors(selectedDoctor.Id).Select(service => new ServiceSelected(service)).ToList()); Services = new ObservableCollection<ServiceSelected>(repository.GetServicesByDoctors(selectedDoctor.Id).Select(service => new ServiceSelected(service)).ToList());
} }
@ -58,9 +57,17 @@ public partial class ServiceViewModel : ViewModelBase
var recordRepository = _provider.GetRequiredService<RecordRep>(); var recordRepository = _provider.GetRequiredService<RecordRep>();
var recordItemsRepository = _provider.GetRequiredService<RecordItemsRepository>(); var recordItemsRepository = _provider.GetRequiredService<RecordItemsRepository>();
var vm = ActivatorUtilities.CreateInstance<RecordItemsViewModel>(_provider, var vm = ActivatorUtilities.CreateInstance<RecordItemsViewModel>(_provider,
_navigation, _selectedDoctor, selectedServices, recordRepository, recordItemsRepository, Name, Surname); _navigation, _selectedDoctor, selectedServices, recordRepository, recordItemsRepository, Name, Surname);
_navigation.Navigate(vm); _navigation.Navigate(vm);
} }
[RelayCommand]
public void GoBack()
{
var vm = ActivatorUtilities.CreateInstance<DoctorViewModel>(_provider);
_navigation.Navigate(vm);
}
} }

View File

@ -12,47 +12,88 @@
<Setter Property="Background" Value="White"/> <Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="Black"/> <Setter Property="Foreground" Value="Black"/>
<Setter Property="CaretBrush" Value="Red"/> <Setter Property="CaretBrush" Value="Red"/>
<Setter Property="SelectionBrush" Value="LightBlue"/>
<Setter Property="BorderBrush" Value="Black"/> <Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1"/> <Setter Property="BorderThickness" Value="1"/>
</Style> </Style>
</UserControl.Styles> </UserControl.Styles>
<ScrollViewer> <ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Margin="30" Spacing="20"> <StackPanel Margin="30" Spacing="20">
<TextBlock Text="Управление записями" FontSize="24" FontWeight="Bold" HorizontalAlignment="Center" Foreground="Black"/> <!-- Заголовок с поиском и кнопкой выхода -->
<Grid ColumnDefinitions="*,Auto,Auto,Auto" Margin="0,0,0,10" VerticalAlignment="Center">
<TextBlock Grid.Column="0" Text="Управление записями" FontSize="24" FontWeight="Bold" Foreground="Black" VerticalAlignment="Center"/>
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5"> <StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="10">
<StackPanel Spacing="10"> <TextBox Text="{Binding SearchText}"
<TextBlock Text="Список записей (кликните для редактирования):" FontWeight="Bold" FontSize="16" Foreground="Black"/> Watermark="Поиск по имени/фамилии"
<DataGrid ItemsSource="{Binding RecordsList }" SelectedItem="{Binding SelectedRecord }" MinHeight="300"> Width="200"
Padding="10"
FontSize="13"/>
<Button Content="Искать"
FontSize="14"
Padding="15,8"
Background="Blue"
Foreground="White"
Command="{Binding SearchRecordsCommand}"/>
<Button Content="Показать все"
FontSize="14"
Padding="15,8"
Background="Green"
Foreground="White"
Command="{Binding ShowAllRecordsCommand}"/>
</StackPanel>
<Button Grid.Column="3" Content="Выход"
FontSize="14"
Padding="15,8"
Background="Red"
Foreground="White"
Command="{Binding ExitApplicationCommand}"/>
</Grid>
<!-- Таблица записей с ползунком -->
<Border BorderBrush="LightGray" BorderThickness="1" Padding="0" CornerRadius="5" ClipToBounds="True">
<StackPanel Spacing="0">
<TextBlock Text="Список записей (кликните для редактирования):"
FontWeight="Bold" FontSize="16" Foreground="Black" Padding="15,15,15,10"/>
<ScrollViewer MaxHeight="300" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<DataGrid ItemsSource="{Binding RecordsList }"
SelectedItem="{Binding SelectedRecord }"
Width="1100"
CanUserResizeColumns="True"
CanUserSortColumns="True">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridCheckBoxColumn IsVisible="True"/> <DataGridCheckBoxColumn IsVisible="True"/>
<DataGridTextColumn Binding="{Binding ClientName}" Header="Имя клиента"/> <DataGridTextColumn Binding="{Binding ClientName}" Header="Имя клиента" Width="150"/>
<DataGridTextColumn Binding="{Binding ClientSurname}" Header="Фамилия клиента"/> <DataGridTextColumn Binding="{Binding ClientSurname}" Header="Фамилия клиента" Width="150"/>
<DataGridTextColumn Binding="{Binding Title}" Header="Врач"/> <DataGridTextColumn Binding="{Binding Title}" Header="Врач" Width="150"/>
<DataGridTextColumn Binding="{Binding TotalAmount}" Header="Цена"/> <DataGridTextColumn Binding="{Binding TotalAmount}" Header="Цена" Width="100"/>
<DataGridTextColumn Binding="{Binding ServiceName}" Header="Услуга"/> <DataGridTextColumn Binding="{Binding ServiceName}" Header="Услуга" Width="200"/>
<DataGridTextColumn Binding="{Binding RecordDate}" Header="Дата"/> <DataGridTextColumn Binding="{Binding RecordDate}" Header="Дата" Width="200"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</ScrollViewer>
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Форма редактирования -->
<Border BorderBrush="DodgerBlue" BorderThickness="2" Padding="20" CornerRadius="5" Background="White"> <Border BorderBrush="DodgerBlue" BorderThickness="2" Padding="20" CornerRadius="5" Background="White">
<StackPanel Spacing="20"> <StackPanel Spacing="20">
<TextBlock Text="Редактирование записи:" FontWeight="Bold" FontSize="16" Foreground="Black"/> <TextBlock Text="Редактирование записи:" FontWeight="Bold" FontSize="16" Foreground="Black"/>
<!-- Имя клиента -->
<StackPanel Spacing="8"> <StackPanel Spacing="8">
<TextBlock Text="Имя клиента:" FontWeight="Bold" Foreground="Black" FontSize="14"/> <TextBlock Text="Имя клиента:" FontWeight="Bold" Foreground="Black" FontSize="14"/>
<TextBox Text="{Binding EditClientName}" Padding="12" FontSize="14"/> <TextBox Text="{Binding EditClientName}" Padding="12" FontSize="14"/>
</StackPanel> </StackPanel>
<!-- Фамилия клиента -->
<StackPanel Spacing="8"> <StackPanel Spacing="8">
<TextBlock Text="Фамилия клиента:" FontWeight="Bold" Foreground="Black" FontSize="14"/> <TextBlock Text="Фамилия клиента:" FontWeight="Bold" Foreground="Black" FontSize="14"/>
<TextBox Text="{Binding EditClientSurname}" Padding="12" FontSize="14"/> <TextBox Text="{Binding EditClientSurname}" Padding="12" FontSize="14"/>
</StackPanel> </StackPanel>
<!-- Врач -->
<StackPanel Spacing="8"> <StackPanel Spacing="8">
<TextBlock Text="Врач:" FontWeight="Bold" Foreground="Black" FontSize="14"/> <TextBlock Text="Врач:" FontWeight="Bold" Foreground="Black" FontSize="14"/>
<ComboBox ItemsSource="{Binding DoctorList}" <ComboBox ItemsSource="{Binding DoctorList}"
@ -61,6 +102,7 @@
Padding="12" FontSize="14" Background="White" Foreground="Black"/> Padding="12" FontSize="14" Background="White" Foreground="Black"/>
</StackPanel> </StackPanel>
<!-- Услуга (зависит от выбранного врача) -->
<StackPanel Spacing="8"> <StackPanel Spacing="8">
<TextBlock Text="Услуга:" FontWeight="Bold" Foreground="Black" FontSize="14"/> <TextBlock Text="Услуга:" FontWeight="Bold" Foreground="Black" FontSize="14"/>
<ComboBox ItemsSource="{Binding EditServiceList}" <ComboBox ItemsSource="{Binding EditServiceList}"
@ -69,11 +111,15 @@
Padding="12" FontSize="14" Background="White" Foreground="Black"/> Padding="12" FontSize="14" Background="White" Foreground="Black"/>
</StackPanel> </StackPanel>
<!-- Сумма (только для отображения) -->
<StackPanel Spacing="8"> <StackPanel Spacing="8">
<TextBlock Text="Сумма:" FontWeight="Bold" Foreground="Black" FontSize="14"/> <TextBlock Text="Сумма:" FontWeight="Bold" Foreground="Black" FontSize="14"/>
<TextBox Text="{Binding EditTotalAmount}" Padding="12" FontSize="14"/> <Border Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="1" Padding="12" CornerRadius="3">
<TextBlock Text="{Binding EditTotalAmount}" FontSize="14" Foreground="Black"/>
</Border>
</StackPanel> </StackPanel>
<!-- Дата -->
<StackPanel Spacing="8"> <StackPanel Spacing="8">
<TextBlock Text="Дата (YYYY-MM-DD):" FontWeight="Bold" Foreground="Black" FontSize="14"/> <TextBlock Text="Дата (YYYY-MM-DD):" FontWeight="Bold" Foreground="Black" FontSize="14"/>
<TextBox Text="{Binding EditRecordDate}" Padding="12" FontSize="14"/> <TextBox Text="{Binding EditRecordDate}" Padding="12" FontSize="14"/>
@ -81,8 +127,10 @@
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Сообщение статуса -->
<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"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
<Button Content="Обновить запись" <Button Content="Обновить запись"
FontSize="16" FontSize="16"

View File

@ -3,24 +3,48 @@
xmlns:vm="using:Policlinica.ViewModels" xmlns:vm="using:Policlinica.ViewModels"
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"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="500"
x:Class="Policlinica.Views.AutorizationView" x:Class="Policlinica.Views.AutorizationView"
x:DataType="vm:AutorizationViewModel"> x:DataType="vm:AutorizationViewModel">
<Border BorderBrush="Aqua" CornerRadius="8" BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10"> <UserControl.Styles>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <Style Selector="TextBox">
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="CaretBrush" Value="Red"/>
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="10"/>
<Setter Property="FontSize" Value="14"/>
</Style>
</UserControl.Styles>
<TextBlock Text="Вход" FontSize="20" FontWeight="Bold" HorizontalAlignment="Center"/> <Border BorderBrush="DodgerBlue" CornerRadius="8" BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20" Padding="30" Background="White">
<StackPanel Spacing="15" Width="400">
<TextBlock Text="Авторизация" FontSize="24" FontWeight="Bold" HorizontalAlignment="Center" Foreground="Black"/>
<TextBlock Text="Логин:" /> <StackPanel Spacing="8">
<TextBox Text="{Binding Login}"/> <TextBlock Text="Логин:" FontWeight="Bold" Foreground="Black"/>
<TextBlock Text="Пароль:" /> <TextBox Text="{Binding Login}" Watermark="Введите логин"/>
<TextBox Text="{Binding Password}"/> </StackPanel>
<TextBlock Text="{Binding Eror}" Foreground="Red"/>
<StackPanel Orientation="Horizontal"> <StackPanel Spacing="8">
<TextBlock Text="Пароль:" FontWeight="Bold" Foreground="Black"/>
<TextBox Text="{Binding Password}" Watermark="Введите пароль"/>
</StackPanel>
<TextBlock Text="{Binding Eror}" Foreground="Red" FontSize="12" TextWrapping="Wrap"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="15" Margin="0,15,0,0">
<Button Content="Продолжить" <Button Content="Продолжить"
FontSize="14"
Padding="15,10"
Background="Blue"
Foreground="White"
Command="{Binding ContiCommand}"/> Command="{Binding ContiCommand}"/>
<HyperlinkButton Content="Регистрация" <HyperlinkButton Content="Регистрация"
FontSize="14"
Foreground="Blue"
Command="{Binding OpenRegWinCommand}"/> Command="{Binding OpenRegWinCommand}"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>

View File

@ -11,6 +11,7 @@
<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 Text="Имя клиента:" FontWeight="Bold" FontSize="14"/> <TextBlock Text="Имя клиента:" FontWeight="Bold" FontSize="14"/>
@ -18,6 +19,7 @@
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Ввод фамилии клиента -->
<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 Text="Фамилия клиента:" FontWeight="Bold" FontSize="14"/> <TextBlock Text="Фамилия клиента:" FontWeight="Bold" FontSize="14"/>
@ -25,6 +27,7 @@
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Выбор врача -->
<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 Text="Выберите врача:" FontWeight="Bold" FontSize="14"/> <TextBlock Text="Выберите врача:" FontWeight="Bold" FontSize="14"/>
@ -36,12 +39,20 @@
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Кнопки -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
<Button Content="Далее" <Button Content="Далее"
FontSize="16" FontSize="16"
Padding="20,12" Padding="20,12"
Background="Green" Background="Green"
Foreground="White" Foreground="White"
HorizontalAlignment="Center"
Command="{Binding StartTestCommand}"/> Command="{Binding StartTestCommand}"/>
<Button Content="Назад"
FontSize="16"
Padding="20,12"
Background="Gray"
Foreground="White"
Command="{Binding GoBackCommand}"/>
</StackPanel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@ -7,9 +7,12 @@
x:Class="Policlinica.Views.RecordItemsView" x:Class="Policlinica.Views.RecordItemsView"
x:DataType="viewModels:RecordItemsViewModel"> x:DataType="viewModels:RecordItemsViewModel">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Margin="30" Spacing="20"> <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 Text="Клиент:" FontWeight="Bold" FontSize="16"/> <TextBlock Text="Клиент:" FontWeight="Bold" FontSize="16"/>
@ -18,6 +21,7 @@
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Информация о враче -->
<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 Text="Врач:" FontWeight="Bold" FontSize="16"/> <TextBlock Text="Врач:" FontWeight="Bold" FontSize="16"/>
@ -25,11 +29,13 @@
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Выбранные услуги -->
<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 Text="Выбранные услуги:" FontWeight="Bold" FontSize="16"/> <TextBlock Text="Выбранные услуги:" FontWeight="Bold" FontSize="16"/>
<ListBox ItemsSource="{Binding SelectedServices}" MinHeight="150"> <ScrollViewer MaxHeight="200" VerticalScrollBarVisibility="Auto">
<ListBox ItemsSource="{Binding SelectedServices}">
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal" Spacing="20" Margin="5"> <StackPanel Orientation="Horizontal" Spacing="20" Margin="5">
@ -39,9 +45,11 @@
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ListBox.ItemTemplate>
</ListBox> </ListBox>
</ScrollViewer>
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Итоговая сумма -->
<Border BorderBrush="DodgerBlue" BorderThickness="2" Padding="20" CornerRadius="5" Background="WhiteSmoke"> <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"/> <TextBlock Text="Итого:" FontWeight="Bold" FontSize="16"/>
@ -49,8 +57,10 @@
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Сообщение статуса -->
<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"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
<Button Content="Сохранить запись" <Button Content="Сохранить запись"
FontSize="16" FontSize="16"
@ -58,13 +68,14 @@
Background="Green" Background="Green"
Foreground="White" Foreground="White"
Command="{Binding SaveToDatabaseCommand}"/> Command="{Binding SaveToDatabaseCommand}"/>
<Button Content="Вернуться" <Button Content="Назад"
FontSize="16" FontSize="16"
Padding="20,12" Padding="20,12"
Background="Gray" Background="Gray"
Foreground="White" Foreground="White"
Command="{Binding CancelCommand}"/> Command="{Binding GoBackCommand}"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</ScrollViewer>
</UserControl> </UserControl>

View File

@ -1,23 +1,51 @@
<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="600" d:DesignHeight="500"
x:Class="Policlinica.Views.RegistrationView" x:Class="Policlinica.Views.RegistrationView"
x:DataType="viewModels:RegistrationViewModel"> x:DataType="viewModels:RegistrationViewModel">
<Border BorderBrush="Aqua" CornerRadius="8" BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10"> <UserControl.Styles>
<StackPanel Spacing="5"> <Style Selector="TextBox">
<Label FontWeight="Bold" Content="Регистрация" HorizontalAlignment="Center"/> <Setter Property="Background" Value="White"/>
<TextBlock Text="Логин" HorizontalAlignment="Center"/> <Setter Property="Foreground" Value="Black"/>
<TextBox Watermark="Придумайте имя" Text="{Binding Login}"/> <Setter Property="CaretBrush" Value="Red"/>
<TextBlock Text="Пароль" HorizontalAlignment="Center"/> <Setter Property="BorderBrush" Value="Black"/>
<TextBox Watermark="Придумайте пароль" Text="{Binding Password}"/> <Setter Property="BorderThickness" Value="1"/>
<TextBlock Text="{Binding Eror}" Foreground="Red"/> <Setter Property="Padding" Value="10"/>
<StackPanel Orientation="Horizontal"> <Setter Property="FontSize" Value="14"/>
<Button Content= "Зарегистрироваться" Command="{Binding RegistrationCommand}"/> </Style>
<HyperlinkButton Command="{Binding OpenAutorizationCommand}" Content="Авторизоваться"/> </UserControl.Styles>
<Border BorderBrush="DodgerBlue" CornerRadius="8" BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20" Padding="30" Background="White">
<StackPanel Spacing="15" Width="400">
<TextBlock Text="Регистрация" FontSize="24" FontWeight="Bold" HorizontalAlignment="Center" Foreground="Black"/>
<StackPanel Spacing="8">
<TextBlock Text="Логин (макс. 15 символов):" FontWeight="Bold" Foreground="Black"/>
<TextBox Watermark="Придумайте имя" Text="{Binding Login}" MaxLength="15"/>
</StackPanel>
<StackPanel Spacing="8">
<TextBlock Text="Пароль (макс. 8 символов):" FontWeight="Bold" Foreground="Black"/>
<TextBox Watermark="Придумайте пароль" Text="{Binding Password}" MaxLength="8"/>
</StackPanel>
<TextBlock Text="{Binding Eror}" Foreground="Red" FontSize="12" TextWrapping="Wrap"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="15" Margin="0,15,0,0">
<Button Content="Зарегистрироваться"
FontSize="14"
Padding="15,10"
Background="Green"
Foreground="White"
Command="{Binding RegistrationCommand}"/>
<HyperlinkButton Content="Авторизоваться"
FontSize="14"
Foreground="Blue"
Command="{Binding OpenAutorizationCommand}"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</Border> </Border>

View File

@ -39,7 +39,8 @@
FontSize="16" FontSize="16"
Padding="20,12" Padding="20,12"
Background="Gray" Background="Gray"
Foreground="White"/> Foreground="White"
Command="{Binding GoBackCommand}"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>

View File

@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Policlinica")] [assembly: System.Reflection.AssemblyCompanyAttribute("Policlinica")]
[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+42674a1eafd52a914f3b85957d38411bca2434ad")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2832adf6b90e33ade0e4dddb6ea06effb67f8d1e")]
[assembly: System.Reflection.AssemblyProductAttribute("Policlinica")] [assembly: System.Reflection.AssemblyProductAttribute("Policlinica")]
[assembly: System.Reflection.AssemblyTitleAttribute("Policlinica")] [assembly: System.Reflection.AssemblyTitleAttribute("Policlinica")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
2b3375ad610e5fbc841535e991e0833d98ba70a8d5acdd80554ef8703e1f2a91 2780337f6c579f86204d6a118f92ae98da7690ac52f371d55d46561ef4b97617

View File

@ -1 +1 @@
{"documents":{"C:\\Users\\vikto\\RiderProjects\\Policlinica\\*":"https://raw.githubusercontent.com/Dezkriminant/Policlinica/42674a1eafd52a914f3b85957d38411bca2434ad/*"}} {"documents":{"C:\\Users\\vikto\\RiderProjects\\Policlinica\\*":"https://raw.githubusercontent.com/Dezkriminant/Policlinica/2832adf6b90e33ade0e4dddb6ea06effb67f8d1e/*"}}