Пук пук
parent
2832adf6b9
commit
4de787127f
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Controls.Templates;
|
||||
using Policlinica.ViewModels;
|
||||
using Policlinica.Views;
|
||||
|
|
@ -33,6 +35,16 @@ public class ViewLocator : IDataTemplate
|
|||
sugarVm.SetView(sugarView);
|
||||
}
|
||||
|
||||
// Специальная обработка для AdminViewModel
|
||||
if (param is AdminViewModel adminVm)
|
||||
{
|
||||
// Получаем главное окно из ApplicationLifetime
|
||||
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
adminVm.SetCloseAction(() => desktop.MainWindow?.Close());
|
||||
}
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using Avalonia.Controls;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
@ -20,6 +21,7 @@ public partial class AdminViewModel : ViewModelBase
|
|||
private readonly UserRepository _userRepository;
|
||||
private readonly DoctorRepository _doctorRepository;
|
||||
private readonly ServiceRepository _serviceRepository;
|
||||
private List<Record> _allRecords; // Сохраняем все записи для поиска
|
||||
|
||||
[ObservableProperty] string _login;
|
||||
[ObservableProperty] int _id;
|
||||
|
|
@ -27,6 +29,7 @@ public partial class AdminViewModel : ViewModelBase
|
|||
[ObservableProperty] private Record _selectedRecord;
|
||||
[ObservableProperty] private ObservableCollection<User> userList = new ObservableCollection<User>();
|
||||
[ObservableProperty] string statusMessage = "";
|
||||
[ObservableProperty] string searchText = "";
|
||||
|
||||
[ObservableProperty] string editClientName = "";
|
||||
[ObservableProperty] string editClientSurname = "";
|
||||
|
|
@ -37,6 +40,8 @@ public partial class AdminViewModel : ViewModelBase
|
|||
[ObservableProperty] decimal editTotalAmount = 0;
|
||||
[ObservableProperty] string editRecordDate = "";
|
||||
|
||||
private Action _closeAction;
|
||||
|
||||
public AdminViewModel(Navigation navigation, IServiceProvider provider, RecordRep recordRep, User user, UserRepository userRepository, DoctorRepository doctorRepository, ServiceRepository serviceRepository)
|
||||
{
|
||||
_navigation = navigation;
|
||||
|
|
@ -54,10 +59,16 @@ public partial class AdminViewModel : ViewModelBase
|
|||
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());
|
||||
}
|
||||
|
||||
public void SetCloseAction(Action closeAction)
|
||||
{
|
||||
_closeAction = closeAction;
|
||||
}
|
||||
|
||||
partial void OnSelectedRecordChanged(Record value)
|
||||
{
|
||||
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]
|
||||
void UpdateRecord()
|
||||
{
|
||||
|
|
@ -131,9 +170,11 @@ public partial class AdminViewModel : ViewModelBase
|
|||
if (updated)
|
||||
{
|
||||
StatusMessage = "Запись успешно обновлена";
|
||||
RecordsList = new ObservableCollection<Record>(_recordRep.GetRecord(Id));
|
||||
_allRecords = _recordRep.GetRecord(Id);
|
||||
RecordsList = new ObservableCollection<Record>(_allRecords);
|
||||
SelectedRecord = null;
|
||||
ClearEditFields();
|
||||
SearchText = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -174,9 +215,11 @@ public partial class AdminViewModel : ViewModelBase
|
|||
if (deleted)
|
||||
{
|
||||
StatusMessage = "Запись успешно удалена";
|
||||
RecordsList = new ObservableCollection<Record>(_recordRep.GetRecord(Id));
|
||||
_allRecords = _recordRep.GetRecord(Id);
|
||||
RecordsList = new ObservableCollection<Record>(_allRecords);
|
||||
SelectedRecord = null;
|
||||
ClearEditFields();
|
||||
SearchText = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -204,4 +247,11 @@ public partial class AdminViewModel : ViewModelBase
|
|||
_navigation.Navigate(vm);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
void ExitApplication()
|
||||
{
|
||||
Console.WriteLine("Exit button clicked");
|
||||
_closeAction?.Invoke();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ public partial class DoctorViewModel : ViewModelBase
|
|||
_provider = provider;
|
||||
_doctorList = new ObservableCollection<Doctor>(repository.GetDoctorsByTest());
|
||||
_navigation = navigation;
|
||||
|
||||
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
|
|
@ -44,4 +42,11 @@ public partial class DoctorViewModel : ViewModelBase
|
|||
_navigation.Navigate(vm);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public void GoBack()
|
||||
{
|
||||
var vm = ActivatorUtilities.CreateInstance<AdminViewModel>(_provider);
|
||||
_navigation.Navigate(vm);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ public partial class RecordItemsViewModel : ViewModelBase
|
|||
}
|
||||
|
||||
[RelayCommand]
|
||||
public void Cancel()
|
||||
public void GoBack()
|
||||
{
|
||||
var repository = _provider.GetRequiredService<ServiceRepository>();
|
||||
var vm = ActivatorUtilities.CreateInstance<ServiceViewModel>(_provider, selectedDoctor, repository, clientName, clientSurname);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
|
@ -14,16 +14,33 @@ public partial class RegistrationViewModel : ViewModelBase
|
|||
private readonly Navigation _navigation;
|
||||
private readonly IServiceProvider _provider;
|
||||
|
||||
[ObservableProperty] private string _password;
|
||||
[ObservableProperty] private string _login;
|
||||
[ObservableProperty] public string _eror;
|
||||
[ObservableProperty] private string _password = "";
|
||||
[ObservableProperty] private string _login = "";
|
||||
[ObservableProperty] public string _eror = "";
|
||||
|
||||
public RegistrationViewModel(IServiceProvider serviceProvider, Navigation navigation, IServiceProvider provider)
|
||||
{
|
||||
_serviceProvider = serviceProvider;
|
||||
_navigation = navigation;
|
||||
_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]
|
||||
|
|
@ -31,12 +48,28 @@ public partial class RegistrationViewModel : ViewModelBase
|
|||
{
|
||||
var vm = _serviceProvider.GetRequiredService<AutorizationViewModel>();
|
||||
_navigation.Navigate(vm);
|
||||
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
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>())
|
||||
{
|
||||
|
|
@ -46,6 +79,7 @@ public partial class RegistrationViewModel : ViewModelBase
|
|||
Eror = "Такой логин уже существует";
|
||||
return;
|
||||
}
|
||||
|
||||
var user = new User()
|
||||
{
|
||||
Name = Login,
|
||||
|
|
@ -61,7 +95,4 @@ public partial class RegistrationViewModel : ViewModelBase
|
|||
_navigation.Navigate(vm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -34,7 +34,6 @@ public partial class ServiceViewModel : ViewModelBase
|
|||
name = clientName;
|
||||
surname = clientSurname;
|
||||
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 recordItemsRepository = _provider.GetRequiredService<RecordItemsRepository>();
|
||||
|
||||
var vm = ActivatorUtilities.CreateInstance<RecordItemsViewModel>(_provider,
|
||||
_navigation, _selectedDoctor, selectedServices, recordRepository, recordItemsRepository, Name, Surname);
|
||||
|
||||
_navigation.Navigate(vm);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public void GoBack()
|
||||
{
|
||||
var vm = ActivatorUtilities.CreateInstance<DoctorViewModel>(_provider);
|
||||
_navigation.Navigate(vm);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,47 +12,88 @@
|
|||
<Setter Property="Background" Value="White"/>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="CaretBrush" Value="Red"/>
|
||||
<Setter Property="SelectionBrush" Value="LightBlue"/>
|
||||
<Setter Property="BorderBrush" Value="Black"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
|
||||
<ScrollViewer>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<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 Spacing="10">
|
||||
<TextBlock Text="Список записей (кликните для редактирования):" FontWeight="Bold" FontSize="16" Foreground="Black"/>
|
||||
<DataGrid ItemsSource="{Binding RecordsList }" SelectedItem="{Binding SelectedRecord }" MinHeight="300">
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="10">
|
||||
<TextBox Text="{Binding SearchText}"
|
||||
Watermark="Поиск по имени/фамилии"
|
||||
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>
|
||||
<DataGridCheckBoxColumn IsVisible="True"/>
|
||||
<DataGridTextColumn Binding="{Binding ClientName}" Header="Имя клиента"/>
|
||||
<DataGridTextColumn Binding="{Binding ClientSurname}" Header="Фамилия клиента"/>
|
||||
<DataGridTextColumn Binding="{Binding Title}" Header="Врач"/>
|
||||
<DataGridTextColumn Binding="{Binding TotalAmount}" Header="Цена"/>
|
||||
<DataGridTextColumn Binding="{Binding ServiceName}" Header="Услуга"/>
|
||||
<DataGridTextColumn Binding="{Binding RecordDate}" Header="Дата"/>
|
||||
<DataGridTextColumn Binding="{Binding ClientName}" Header="Имя клиента" Width="150"/>
|
||||
<DataGridTextColumn Binding="{Binding ClientSurname}" Header="Фамилия клиента" Width="150"/>
|
||||
<DataGridTextColumn Binding="{Binding Title}" Header="Врач" Width="150"/>
|
||||
<DataGridTextColumn Binding="{Binding TotalAmount}" Header="Цена" Width="100"/>
|
||||
<DataGridTextColumn Binding="{Binding ServiceName}" Header="Услуга" Width="200"/>
|
||||
<DataGridTextColumn Binding="{Binding RecordDate}" Header="Дата" Width="200"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Форма редактирования -->
|
||||
<Border BorderBrush="DodgerBlue" BorderThickness="2" Padding="20" CornerRadius="5" Background="White">
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Text="Редактирование записи:" FontWeight="Bold" FontSize="16" Foreground="Black"/>
|
||||
|
||||
<!-- Имя клиента -->
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Text="Имя клиента:" FontWeight="Bold" Foreground="Black" FontSize="14"/>
|
||||
<TextBox Text="{Binding EditClientName}" Padding="12" FontSize="14"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Фамилия клиента -->
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Text="Фамилия клиента:" FontWeight="Bold" Foreground="Black" FontSize="14"/>
|
||||
<TextBox Text="{Binding EditClientSurname}" Padding="12" FontSize="14"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Врач -->
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Text="Врач:" FontWeight="Bold" Foreground="Black" FontSize="14"/>
|
||||
<ComboBox ItemsSource="{Binding DoctorList}"
|
||||
|
|
@ -61,6 +102,7 @@
|
|||
Padding="12" FontSize="14" Background="White" Foreground="Black"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Услуга (зависит от выбранного врача) -->
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Text="Услуга:" FontWeight="Bold" Foreground="Black" FontSize="14"/>
|
||||
<ComboBox ItemsSource="{Binding EditServiceList}"
|
||||
|
|
@ -69,11 +111,15 @@
|
|||
Padding="12" FontSize="14" Background="White" Foreground="Black"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Сумма (только для отображения) -->
|
||||
<StackPanel Spacing="8">
|
||||
<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 Spacing="8">
|
||||
<TextBlock Text="Дата (YYYY-MM-DD):" FontWeight="Bold" Foreground="Black" FontSize="14"/>
|
||||
<TextBox Text="{Binding EditRecordDate}" Padding="12" FontSize="14"/>
|
||||
|
|
@ -81,8 +127,10 @@
|
|||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Сообщение статуса -->
|
||||
<TextBlock Text="{Binding StatusMessage}" Foreground="Green" FontSize="14" TextWrapping="Wrap"/>
|
||||
|
||||
<!-- Кнопки -->
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
|
||||
<Button Content="Обновить запись"
|
||||
FontSize="16"
|
||||
|
|
|
|||
|
|
@ -3,24 +3,48 @@
|
|||
xmlns:vm="using:Policlinica.ViewModels"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
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:DataType="vm:AutorizationViewModel">
|
||||
|
||||
<Border BorderBrush="Aqua" CornerRadius="8" BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<UserControl.Styles>
|
||||
<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="Логин:" />
|
||||
<TextBox Text="{Binding Login}"/>
|
||||
<TextBlock Text="Пароль:" />
|
||||
<TextBox Text="{Binding Password}"/>
|
||||
<TextBlock Text="{Binding Eror}" Foreground="Red"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Text="Логин:" FontWeight="Bold" Foreground="Black"/>
|
||||
<TextBox Text="{Binding Login}" Watermark="Введите логин"/>
|
||||
</StackPanel>
|
||||
|
||||
<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="Продолжить"
|
||||
FontSize="14"
|
||||
Padding="15,10"
|
||||
Background="Blue"
|
||||
Foreground="White"
|
||||
Command="{Binding ContiCommand}"/>
|
||||
<HyperlinkButton Content="Регистрация"
|
||||
FontSize="14"
|
||||
Foreground="Blue"
|
||||
Command="{Binding OpenRegWinCommand}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
<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"/>
|
||||
|
|
@ -18,6 +19,7 @@
|
|||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Ввод фамилии клиента -->
|
||||
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||
<StackPanel Spacing="10">
|
||||
<TextBlock Text="Фамилия клиента:" FontWeight="Bold" FontSize="14"/>
|
||||
|
|
@ -25,6 +27,7 @@
|
|||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Выбор врача -->
|
||||
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||
<StackPanel Spacing="10">
|
||||
<TextBlock Text="Выберите врача:" FontWeight="Bold" FontSize="14"/>
|
||||
|
|
@ -36,12 +39,20 @@
|
|||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Кнопки -->
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
|
||||
<Button Content="Далее"
|
||||
FontSize="16"
|
||||
Padding="20,12"
|
||||
Background="Green"
|
||||
Foreground="White"
|
||||
HorizontalAlignment="Center"
|
||||
Command="{Binding StartTestCommand}"/>
|
||||
<Button Content="Назад"
|
||||
FontSize="16"
|
||||
Padding="20,12"
|
||||
Background="Gray"
|
||||
Foreground="White"
|
||||
Command="{Binding GoBackCommand}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
|
|
|||
|
|
@ -7,9 +7,12 @@
|
|||
x:Class="Policlinica.Views.RecordItemsView"
|
||||
x:DataType="viewModels:RecordItemsViewModel">
|
||||
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Margin="30" Spacing="20">
|
||||
<!-- Заголовок -->
|
||||
<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"/>
|
||||
|
|
@ -18,6 +21,7 @@
|
|||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Информация о враче -->
|
||||
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||
<StackPanel Spacing="10">
|
||||
<TextBlock Text="Врач:" FontWeight="Bold" FontSize="16"/>
|
||||
|
|
@ -25,11 +29,13 @@
|
|||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Выбранные услуги -->
|
||||
<Border BorderBrush="LightGray" BorderThickness="1" Padding="15" CornerRadius="5">
|
||||
<StackPanel Spacing="10">
|
||||
<TextBlock Text="Выбранные услуги:" FontWeight="Bold" FontSize="16"/>
|
||||
|
||||
<ListBox ItemsSource="{Binding SelectedServices}" MinHeight="150">
|
||||
<ScrollViewer MaxHeight="200" VerticalScrollBarVisibility="Auto">
|
||||
<ListBox ItemsSource="{Binding SelectedServices}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20" Margin="5">
|
||||
|
|
@ -39,9 +45,11 @@
|
|||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Итоговая сумма -->
|
||||
<Border BorderBrush="DodgerBlue" BorderThickness="2" Padding="20" CornerRadius="5" Background="WhiteSmoke">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="30">
|
||||
<TextBlock Text="Итого:" FontWeight="Bold" FontSize="16"/>
|
||||
|
|
@ -49,8 +57,10 @@
|
|||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Сообщение статуса -->
|
||||
<TextBlock Text="{Binding StatusMessage}" Foreground="Green" FontSize="14" TextWrapping="Wrap"/>
|
||||
|
||||
<!-- Кнопки -->
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
|
||||
<Button Content="Сохранить запись"
|
||||
FontSize="16"
|
||||
|
|
@ -58,13 +68,14 @@
|
|||
Background="Green"
|
||||
Foreground="White"
|
||||
Command="{Binding SaveToDatabaseCommand}"/>
|
||||
<Button Content="Вернуться"
|
||||
<Button Content="Назад"
|
||||
FontSize="16"
|
||||
Padding="20,12"
|
||||
Background="Gray"
|
||||
Foreground="White"
|
||||
Command="{Binding CancelCommand}"/>
|
||||
Command="{Binding GoBackCommand}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
</UserControl>
|
||||
|
|
|
|||
|
|
@ -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:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
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:DataType="viewModels:RegistrationViewModel">
|
||||
|
||||
<Border BorderBrush="Aqua" CornerRadius="8" BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10">
|
||||
<StackPanel Spacing="5">
|
||||
<Label FontWeight="Bold" Content="Регистрация" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="Логин" HorizontalAlignment="Center"/>
|
||||
<TextBox Watermark="Придумайте имя" Text="{Binding Login}"/>
|
||||
<TextBlock Text="Пароль" HorizontalAlignment="Center"/>
|
||||
<TextBox Watermark="Придумайте пароль" Text="{Binding Password}"/>
|
||||
<TextBlock Text="{Binding Eror}" Foreground="Red"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Content= "Зарегистрироваться" Command="{Binding RegistrationCommand}"/>
|
||||
<HyperlinkButton Command="{Binding OpenAutorizationCommand}" Content="Авторизоваться"/>
|
||||
<UserControl.Styles>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
</Border>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@
|
|||
FontSize="16"
|
||||
Padding="20,12"
|
||||
Background="Gray"
|
||||
Foreground="White"/>
|
||||
Foreground="White"
|
||||
Command="{Binding GoBackCommand}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -13,7 +13,7 @@ using System.Reflection;
|
|||
[assembly: System.Reflection.AssemblyCompanyAttribute("Policlinica")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[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.AssemblyTitleAttribute("Policlinica")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
2b3375ad610e5fbc841535e991e0833d98ba70a8d5acdd80554ef8703e1f2a91
|
||||
2780337f6c579f86204d6a118f92ae98da7690ac52f371d55d46561ef4b97617
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -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/*"}}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue