master
parent
e3c82b3beb
commit
0c39d43067
|
|
@ -41,7 +41,7 @@ public partial class AdminWindowViewModel : ViewModelBase
|
|||
[RelayCommand]
|
||||
void GoService()
|
||||
{
|
||||
var vm = _provider.GetRequiredService<ServiceViewModel>();
|
||||
var vm = _provider.GetRequiredService<DoctorViewModel>();
|
||||
_navigation.Navigate(vm);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,38 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Policlinica.DB;
|
||||
|
||||
namespace Policlinica.ViewModels;
|
||||
|
||||
public class DoctorViewModel
|
||||
public partial class DoctorViewModel : ViewModelBase
|
||||
{
|
||||
private readonly IServiceProvider _provider;
|
||||
private readonly Navigation _navigation;
|
||||
|
||||
[ObservableProperty] string username;
|
||||
[ObservableProperty] string name;
|
||||
[ObservableProperty] List<Doctor> _doctorList;
|
||||
[ObservableProperty] Doctor selectedDoctor;
|
||||
[ObservableProperty] string g;
|
||||
|
||||
public DoctorViewModel(IServiceProvider provider, DoctorRepository repository)
|
||||
{
|
||||
_provider = provider;
|
||||
_doctorList = repository.GetDoctorsByTest();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public void StartTest()
|
||||
{
|
||||
|
||||
if (SelectedDoctor == null)
|
||||
return;
|
||||
|
||||
var vm = _provider.GetRequiredService<ServiceViewModel>();
|
||||
_navigation.Navigate(vm);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,9 +1,28 @@
|
|||
<Window 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:vm="using:Policlinica.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Policlinica.Views.DoctoraWindow"
|
||||
Title="DoctoraWindow">
|
||||
Welcome to Avalonia!
|
||||
</Window>
|
||||
x:DataType="vm:DoctorViewModel">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
|
||||
<TextBlock Text="Создание заказа" FontSize="20" FontWeight="Bold" HorizontalAlignment="Center"/>
|
||||
|
||||
<TextBlock Text="Введите имя:" />
|
||||
<TextBox Text="{Binding Name}"/>
|
||||
|
||||
<TextBlock Text="Введите Фамилию" />
|
||||
<TextBox Text="{Binding Username}"/>
|
||||
|
||||
<!--> <TextBox Text="{Binding g}"/><!-->
|
||||
<ComboBox ItemsSource="{Binding DoctorList}"
|
||||
SelectedItem="{Binding SelectedDoctor}"
|
||||
DisplayMemberBinding="{Binding Title}"/>
|
||||
<Button Content="Далее"
|
||||
Command="{Binding StartTestCommand}"/>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Avalonia.Markup.Xaml;
|
|||
|
||||
namespace Policlinica.Views;
|
||||
|
||||
public partial class DoctoraWindow : Window
|
||||
public partial class DoctoraWindow : UserControl
|
||||
{
|
||||
public DoctoraWindow()
|
||||
{
|
||||
|
|
|
|||
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+1ea1be87bdcc1be1edf581939fe3fad5c4543b87")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+e3c82b3beb1339a2b45ae0135f4cec1dd2d539ad")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Policlinica")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Policlinica")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
a4ba19822fdbb15ed15f95983a1e8d700bab0f1304423af8f4b191027a0bf6ee
|
||||
f9b7536251095c35c285debded6d0b23c2542b426e625ba97bb4d89f55dd8a5b
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
{"documents":{"C:\\Users\\artem\\RiderProjects\\Policlinica1\\*":"https://raw.githubusercontent.com/Dezkriminant/Policlinica/1ea1be87bdcc1be1edf581939fe3fad5c4543b87/*"}}
|
||||
{"documents":{"C:\\Users\\artem\\RiderProjects\\Policlinica1\\*":"https://raw.githubusercontent.com/Dezkriminant/Policlinica/e3c82b3beb1339a2b45ae0135f4cec1dd2d539ad/*"}}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue