DiffCredit.axaml 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.StudyLists.DiffCredit"
  7. xmlns:vm="using:AvaloniaApplication4.ViewModels.StudyListsViewModels"
  8. x:DataType="vm:DiffCreditViewModel"
  9. Background="White"
  10. Padding="80">
  11. <ScrollViewer>
  12. <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0 20 0 0">
  13. <Grid Margin="0 0 0 36" HorizontalAlignment="Stretch">
  14. <Grid.ColumnDefinitions>
  15. <ColumnDefinition Width="3*"/>
  16. <ColumnDefinition Width="1*"/>
  17. <ColumnDefinition Width="1*"/>
  18. </Grid.ColumnDefinitions>
  19. <TextBlock Grid.Column="0" HorizontalAlignment="Stretch" Text="Зачетная ведомость" Classes="titleStyle" FontWeight="Bold" TextWrapping="Wrap"/>
  20. <Button HorizontalAlignment="Stretch" Margin="5 0 5 0" Content="Сохранить в файл" Command="{Binding $parent[UserControl].((vm:DiffCreditViewModel)DataContext).SaveToFile}" Name="SaveToFile" Grid.Column="2"/>
  21. </Grid>
  22. <StackPanel Orientation="Horizontal" Margin="0 0 0 20">
  23. <TextBlock Classes="mediumText" FontSize="24" Text="Дисциплина: "/>
  24. <TextBlock Classes="mediumText" Text="{Binding Subject.IdSubjectNavigation.NameSubject}" FontSize="24"/>
  25. </StackPanel>
  26. <StackPanel Orientation="Horizontal" Margin="0 0 0 20">
  27. <TextBlock Classes="mediumText" FontSize="24" Text="Преподаватель: "/>
  28. <ComboBox IsEnabled="{Binding IsAdmin}" ItemsSource="{Binding AllUsers}" SelectedItem="{Binding Teacher,Mode=TwoWay}">
  29. <ComboBox.ItemTemplate>
  30. <DataTemplate>
  31. <StackPanel Orientation="Horizontal">
  32. <TextBlock Classes="mediumText" Text="{Binding Surname}" FontSize="24"/>
  33. <TextBlock Classes="mediumText" Text=" " FontSize="24"/>
  34. <TextBlock Classes="mediumText" Text="{Binding Name}" FontSize="24"/>
  35. <TextBlock Classes="mediumText" Text=" " FontSize="24"/>
  36. <TextBlock Classes="mediumText" Text="{Binding Patronumic}" FontSize="24"/>
  37. </StackPanel>
  38. </DataTemplate>
  39. </ComboBox.ItemTemplate>
  40. </ComboBox>
  41. </StackPanel>
  42. <DataGrid AutoGenerateColumns="False" GridLinesVisibility="All" BorderThickness="1" BorderBrush="Gray" HorizontalAlignment="Stretch" Margin="0 0 0 20" ItemsSource="{Binding AllGradesBinding}">
  43. <DataGrid.Columns>
  44. <DataGridTextColumn IsReadOnly="True" Header="№ п/п" Binding="{Binding Grade.IdStudent}"/>
  45. <DataGridTextColumn IsReadOnly="True" Header="Фамилия" Binding="{Binding Grade.IdStudentNavigation.Surname}"/>
  46. <DataGridTextColumn IsReadOnly="True" Header="Имя" Binding="{Binding Grade.IdStudentNavigation.Name}"/>
  47. <DataGridTextColumn IsReadOnly="True" Header="Отчество" Binding="{Binding Grade.IdStudentNavigation.Patronumic}"/>
  48. <DataGridTemplateColumn Header="Оценка">
  49. <DataTemplate>
  50. <ComboBox ItemsSource="{Binding AllGradesInBase}" SelectedIndex="{Binding IdGradle, Mode=TwoWay}">
  51. <ComboBox.ItemTemplate>
  52. <DataTemplate>
  53. <TextBlock Text="{Binding Name}"/>
  54. </DataTemplate>
  55. </ComboBox.ItemTemplate>
  56. </ComboBox>
  57. </DataTemplate>
  58. </DataGridTemplateColumn>
  59. </DataGrid.Columns>
  60. </DataGrid>
  61. <DataGrid HorizontalAlignment="Stretch" ItemsSource="{Binding ForBindingList.Statistics}" IsReadOnly="True" Margin="0 0 0 20">
  62. <DataGrid.Columns>
  63. <DataGridTextColumn Header="Всего студентов" Binding="{Binding CountStudents}"/>
  64. <DataGridTextColumn Header="Аттестовано" Binding="{Binding CountAtt}"/>
  65. <DataGridTextColumn Header="на 5" Binding="{Binding CountGrade5}"/>
  66. <DataGridTextColumn Header="на 4" Binding="{Binding CountGrade4}"/>
  67. <DataGridTextColumn Header="на 3" Binding="{Binding CountGrade3}"/>
  68. <DataGridTextColumn Header="на 2" Binding="{Binding CountGrade2}"/>
  69. <DataGridTextColumn Header="Не аттестовано" Binding="{Binding CountNotAtt}"/>
  70. <DataGridTextColumn Header="Неявка" Binding="{Binding CountNotCome}"/>
  71. </DataGrid.Columns>
  72. </DataGrid>
  73. <Button HorizontalAlignment="Stretch" Content="Вернуться назад" Command="{Binding $parent[UserControl].((vm:DiffCreditViewModel)DataContext).GoBack}"/>
  74. </StackPanel>
  75. </ScrollViewer>
  76. </UserControl>