MainWindow.xaml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <Window x:Class="ych.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. Title="Учёт оценок студентов" Height="650" Width="1100"
  5. Background="#F4F6FA" WindowStartupLocation="CenterScreen">
  6. <Window.Resources>
  7. <Style x:Key="SideBtn" TargetType="Button">
  8. <Setter Property="Background" Value="Transparent"/>
  9. <Setter Property="Foreground" Value="#2C3E50"/>
  10. <Setter Property="FontSize" Value="14"/>
  11. <Setter Property="FontFamily" Value="Segoe UI"/>
  12. <Setter Property="Height" Value="42"/>
  13. <Setter Property="Cursor" Value="Hand"/>
  14. <Setter Property="BorderThickness" Value="0"/>
  15. <Setter Property="HorizontalContentAlignment" Value="Left"/>
  16. <Setter Property="Padding" Value="20,0,0,0"/>
  17. <Style.Triggers>
  18. <Trigger Property="IsMouseOver" Value="True">
  19. <Setter Property="Background" Value="#E3EAF6"/>
  20. </Trigger>
  21. </Style.Triggers>
  22. </Style>
  23. <Style x:Key="ActionBtn" TargetType="Button">
  24. <Setter Property="Height" Value="34"/>
  25. <Setter Property="Padding" Value="16,0"/>
  26. <Setter Property="FontSize" Value="13"/>
  27. <Setter Property="FontFamily" Value="Segoe UI"/>
  28. <Setter Property="Cursor" Value="Hand"/>
  29. <Setter Property="BorderThickness" Value="0"/>
  30. <Setter Property="Foreground" Value="White"/>
  31. </Style>
  32. </Window.Resources>
  33. <Grid>
  34. <Grid.ColumnDefinitions>
  35. <ColumnDefinition Width="200"/>
  36. <ColumnDefinition Width="*"/>
  37. </Grid.ColumnDefinitions>
  38. <!-- Боковая панель -->
  39. <Border Grid.Column="0" Background="White"
  40. BorderBrush="#E0E6EF" BorderThickness="0,0,1,0">
  41. <StackPanel>
  42. <Border Background="#1F4E79" Height="60">
  43. <TextBlock Text="Учёт оценок"
  44. Foreground="White" FontSize="15"
  45. FontWeight="Bold" FontFamily="Segoe UI"
  46. VerticalAlignment="Center"
  47. HorizontalAlignment="Center"/>
  48. </Border>
  49. <Border Background="#EBF3FB" Height="36">
  50. <TextBlock x:Name="RoleLabel"
  51. FontFamily="Segoe UI" FontSize="12"
  52. Foreground="#1F4E79" FontWeight="SemiBold"
  53. HorizontalAlignment="Center"
  54. VerticalAlignment="Center"/>
  55. </Border>
  56. <TextBlock Text="ТАБЛИЦЫ" Foreground="#999"
  57. FontSize="11" FontFamily="Segoe UI"
  58. Margin="20,14,0,4"/>
  59. <Button x:Name="BtnStudents"
  60. Content=" Студенты"
  61. Style="{StaticResource SideBtn}"
  62. Click="ShowStudents"/>
  63. <Button x:Name="BtnSubjects"
  64. Content=" Предметы"
  65. Style="{StaticResource SideBtn}"
  66. Click="ShowSubjects"/>
  67. <Button x:Name="BtnTeachers"
  68. Content=" Преподаватели"
  69. Style="{StaticResource SideBtn}"
  70. Click="ShowTeachers"/>
  71. <Button x:Name="BtnGroups"
  72. Content=" Группы"
  73. Style="{StaticResource SideBtn}"
  74. Click="ShowGroups"/>
  75. <Button x:Name="BtnGrades"
  76. Content=" Оценки"
  77. Style="{StaticResource SideBtn}"
  78. Click="ShowGrades"/>
  79. <Separator Margin="16,10" Background="#E0E6EF"/>
  80. <TextBlock Text="ЗАПРОСЫ" Foreground="#999"
  81. FontSize="11" FontFamily="Segoe UI"
  82. Margin="20,0,0,4"/>
  83. <Button Content=" Неуспевающие"
  84. Style="{StaticResource SideBtn}"
  85. Click="ShowFailing"/>
  86. <Button Content=" Средний балл"
  87. Style="{StaticResource SideBtn}"
  88. Click="ShowAvg"/>
  89. <Separator Margin="16,10" Background="#E0E6EF"/>
  90. <Button Content=" Выйти"
  91. Style="{StaticResource SideBtn}"
  92. Foreground="#E74C3C"
  93. Click="Logout_Click"/>
  94. </StackPanel>
  95. </Border>
  96. <!-- Основная область -->
  97. <Grid Grid.Column="1" Margin="24,20,24,20">
  98. <Grid.RowDefinitions>
  99. <RowDefinition Height="Auto"/>
  100. <RowDefinition Height="Auto"/>
  101. <RowDefinition Height="*"/>
  102. <RowDefinition Height="Auto"/>
  103. </Grid.RowDefinitions>
  104. <TextBlock x:Name="TitleText" Grid.Row="0"
  105. Text="Выберите таблицу"
  106. FontSize="22" FontWeight="Bold"
  107. FontFamily="Segoe UI"
  108. Foreground="#1F4E79"
  109. Margin="0,0,0,14"/>
  110. <StackPanel x:Name="ActionPanel" Grid.Row="1"
  111. Orientation="Horizontal"
  112. Margin="0,0,0,12"
  113. Visibility="Collapsed">
  114. <Button x:Name="BtnAdd"
  115. Content=" Добавить"
  116. Style="{StaticResource ActionBtn}"
  117. Background="#27AE60"
  118. Click="AddRow"
  119. Margin="0,0,8,0"/>
  120. <Button Content=" Сохранить"
  121. Style="{StaticResource ActionBtn}"
  122. Background="#2980B9"
  123. Click="SaveRow"
  124. Margin="0,0,8,0"/>
  125. <Button x:Name="BtnDelete"
  126. Content=" Удалить"
  127. Style="{StaticResource ActionBtn}"
  128. Background="#E74C3C"
  129. Click="DeleteRow"/>
  130. </StackPanel>
  131. <DataGrid x:Name="MainGrid" Grid.Row="2"
  132. AutoGenerateColumns="True"
  133. CanUserAddRows="False"
  134. RowBackground="White"
  135. AlternatingRowBackground="#F8FAFE"
  136. BorderBrush="#D0DBE8" BorderThickness="1"
  137. GridLinesVisibility="Horizontal"
  138. HorizontalGridLinesBrush="#EDF0F5"
  139. FontFamily="Segoe UI" FontSize="13"
  140. SelectionMode="Single"
  141. ColumnHeaderHeight="38">
  142. <DataGrid.ColumnHeaderStyle>
  143. <Style TargetType="DataGridColumnHeader">
  144. <Setter Property="Background" Value="#1F4E79"/>
  145. <Setter Property="Foreground" Value="White"/>
  146. <Setter Property="FontWeight" Value="SemiBold"/>
  147. <Setter Property="FontSize" Value="13"/>
  148. <Setter Property="Padding" Value="10,0"/>
  149. <Setter Property="Height" Value="38"/>
  150. </Style>
  151. </DataGrid.ColumnHeaderStyle>
  152. </DataGrid>
  153. <TextBlock x:Name="StatusText" Grid.Row="3"
  154. Margin="0,10,0,0"
  155. FontFamily="Segoe UI" FontSize="12"
  156. Foreground="#666"/>
  157. </Grid>
  158. </Grid>
  159. </Window>