EditAndAddEmployee.axaml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="990"
  6. x:Class="AvaloniaApplication4.Views.EditAndAddEmployee"
  7. xmlns:vm="using:AvaloniaApplication4.ViewModels"
  8. x:DataType="vm:EditAndAddEmployeeViewModel"
  9. Background="White"
  10. Padding="80">
  11. <ScrollViewer>
  12. <StackPanel Margin="0 0 0 23" Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Top">
  13. <TextBlock Margin="0 0 0 36" Text="Сотрудники" Classes="titleStyle" FontWeight="Bold"/>
  14. <TextBlock Margin="0 0 0 20" Text="Личная информация" Classes="mediumText" FontWeight="Bold"/>
  15. <TextBox Text="{Binding Employee.Surname}" Watermark="Фамилия сотрудника" Margin="0 0 0 10" TextWrapping="NoWrap" HorizontalAlignment="Stretch"/>
  16. <TextBox Text="{Binding Employee.Name}" Watermark="Имя сотрудника" Margin="0 0 0 10" TextWrapping="NoWrap" HorizontalAlignment="Stretch"/>
  17. <TextBox Text="{Binding Employee.Patronumic}" Watermark="Отчество сотрудника" Margin="0 0 0 10" TextWrapping="NoWrap" HorizontalAlignment="Stretch"/>
  18. <TextBlock Margin="0 0 0 20" Text="Авторизация" Classes="mediumText" FontWeight="Bold"/>
  19. <TextBox Watermark="Логин сотрудника" Text="{Binding EmployeeLogin.UserEmail}" Margin="0 0 0 10" TextWrapping="NoWrap" HorizontalAlignment="Stretch"/>
  20. <TextBox Watermark="Пароль сотрудника" Text="{Binding EmployeeLogin.Password}" Margin="0 0 0 10" TextWrapping="NoWrap" HorizontalAlignment="Stretch"/>
  21. <TextBlock Margin="0 0 0 36" Text="Роли сотрудника" Classes="mediumText" FontWeight="Bold"/>
  22. <StackPanel Orientation="Horizontal" Margin="0 0 0 10">
  23. <CheckBox IsChecked="{Binding IsAdmin, Mode=TwoWay}" Margin="0 0 5 0"/>
  24. <TextBlock Text="Администратор"/>
  25. </StackPanel>
  26. <StackPanel Orientation="Horizontal" Margin="0 0 0 10">
  27. <CheckBox IsChecked="{Binding IsTutor, Mode=TwoWay}" Margin="0 0 5 0"/>
  28. <TextBlock Text="Куратор всех программ"/>
  29. </StackPanel>
  30. <Grid Margin="0 5 0 40">
  31. <Grid.ColumnDefinitions>
  32. <ColumnDefinition Width="1*"/>
  33. <ColumnDefinition Width="1*"/>
  34. </Grid.ColumnDefinitions>
  35. <Button HorizontalAlignment="Stretch" Grid.Column="0" Content="Сохранить" Margin="0 0 5 0" Command="{Binding $parent[UserControl].((vm:EditAndAddEmployeeViewModel)DataContext).SaveChanges}"/>
  36. <Button HorizontalAlignment="Stretch" Grid.Column="1" IsEnabled="{Binding IsNotNew}" Content="Удалить сотрудника" Margin="5 0 0 0" Command="{Binding $parent[UserControl].((vm:EditAndAddEmployeeViewModel)DataContext).Delete}"/>
  37. </Grid>
  38. <Button Content="Вернуться назад" HorizontalAlignment="Stretch" Command="{Binding $parent[UserControl].((vm:EditAndAddEmployeeViewModel)DataContext).GoBack}"/>
  39. </StackPanel>
  40. </ScrollViewer>
  41. </UserControl>