AdminTicketWindow.xaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <Window x:Class="Practics.AdminTicketWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
  7. xmlns:local="clr-namespace:Practics"
  8. mc:Ignorable="d"
  9. Title="Администратор" Height="450" Width="850" Loaded="Window_Loaded">
  10. <Grid>
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="100"/>
  13. <RowDefinition/>
  14. <RowDefinition Height="40"/>
  15. </Grid.RowDefinitions>
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="160"/>
  18. <ColumnDefinition Width="*"/>
  19. <ColumnDefinition Width="150"/>
  20. </Grid.ColumnDefinitions>
  21. <UniformGrid Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Columns="2" Rows="4">
  22. <TextBlock Text="Начало периода"/>
  23. <xctk:DateTimePicker x:Name="dtpStartPeriod"/>
  24. <TextBlock Text="Окончание периода"/>
  25. <xctk:DateTimePicker x:Name="dtpFinishPeriod"/>
  26. <TextBlock>Статус</TextBlock>
  27. <ComboBox x:Name="cbProblemStatus" Text="Все"></ComboBox>
  28. <TextBlock>Тип заявки</TextBlock>
  29. <ComboBox x:Name="cbProblemType" Text="Все"></ComboBox>
  30. </UniformGrid>
  31. <Button x:Name="btnReport" Grid.Column="2" Grid.Row="4" Margin="2" Click="btnReport_Click">Отчет</Button>
  32. <Button x:Name="btnFilter" Grid.Column="1" Grid.Row="2" Margin="2" Width="100" Click="btnFilter_Click">Фильтр</Button>
  33. <DataGrid Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" x:Name="dgTickets" AutoGenerateColumns="False" SelectionChanged="dgTickets_SelectionChanged" SelectionUnit="FullRow" IsReadOnly="True" CanUserAddRows="False">
  34. <DataGrid.Columns>
  35. <!-- Остальные столбцы вашей таблицы -->
  36. <!--<DataGridTextColumn Header="ID Problem" Binding="{Binding Id}" />-->
  37. <DataGridTextColumn Header="Фамилия" Binding="{Binding LastName}" />
  38. <DataGridTextColumn Header="Имя" Binding="{Binding FirstName}" />
  39. <DataGridTextColumn Header="Отчество" Binding="{Binding MiddleName}" />
  40. <DataGridTextColumn Header="Краткое описание" Binding="{Binding ProblemName}" />
  41. <DataGridComboBoxColumn x:Name="dgcbcStatus" SelectedValueBinding="{Binding ProblemStatusID}" Header="Статус" />
  42. <DataGridComboBoxColumn x:Name="dgcbcProblemType" SelectedValueBinding="{Binding ProblemTypeID}" Header="Тип" />
  43. <DataGridTemplateColumn Header="Дата заявки">
  44. <DataGridTemplateColumn.CellTemplate>
  45. <DataTemplate>
  46. <!-- Добавляем DatePicker в шаблон столбца -->
  47. <xctk:DateTimePicker Value="{Binding ProblemTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  48. </DataTemplate>
  49. </DataGridTemplateColumn.CellTemplate>
  50. </DataGridTemplateColumn>
  51. <DataGridTemplateColumn Header="Обработать">
  52. <DataGridTemplateColumn.CellTemplate>
  53. <DataTemplate>
  54. <Button x:Name="btnProcessWindow" Click="btnProcessWindow_Click">Обработать</Button>
  55. </DataTemplate>
  56. </DataGridTemplateColumn.CellTemplate>
  57. </DataGridTemplateColumn>
  58. </DataGrid.Columns>
  59. </DataGrid>
  60. <StackPanel Grid.Row="1" Grid.Column="0">
  61. <Button x:Name="btnUpdateProblems" Click="btnUpdateProblems_Click">Обновить БД</Button>
  62. <Button x:Name="btnReadProblems" Click="btnReadProblems_Click">Считать данные из БД</Button>
  63. <Button x:Name="btnShowNotesWindow" Click="btnShowNotesWindow_Click">База знаний</Button>
  64. <Button x:Name="btnExit" Click="btnExit_Click">Выход</Button>
  65. </StackPanel>
  66. </Grid>
  67. </Window>