/
WorkerTime
/
WorkerTimeDiplom
Обзор
Документация
Войти
/
WorkerTime
/
WorkerTimeDiplom
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Views/WorkRecordsView.xaml
157 строк
10 KB
nikit
Логирование, автосохранение, восстановление пароля
05 июн 2026, 19:24
05 июн 2026, 19:24
715eb3d
Код
Авторство
О чём код?
<UserControl x:Class="WorkerTime.Views.WorkRecordsView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:WorkerTime.ViewModels"> <UserControl.DataContext> <vm:WorkRecordsViewModel/> </UserControl.DataContext> <Grid Margin="10"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <StackPanel Orientation="Horizontal" Margin="0,0,0,10"> <TextBlock Text="Год:" VerticalAlignment="Center" FontSize="14" Margin="0,0,5,0"/> <ComboBox Width="80" Margin="0,0,10,0" FontSize="14" ItemsSource="{Binding Years}" SelectedItem="{Binding SelectedYear}"/> <TextBlock Text="Месяц:" VerticalAlignment="Center" FontSize="14" Margin="0,0,5,0"/> <ComboBox Width="120" Margin="0,0,10,0" FontSize="14" ItemsSource="{Binding Months}" SelectedIndex="{Binding SelectedMonth}"/> <TextBlock Text="Подразделение:" VerticalAlignment="Center" FontSize="14" Margin="0,0,5,0"/> <ComboBox Width="180" Margin="0,0,10,0" FontSize="14" ItemsSource="{Binding AllDepartments}" SelectedValue="{Binding SelectedDepartmentId}" SelectedValuePath="Id" DisplayMemberPath="Name"/> <Button Content="Сброс" Width="70" FontSize="14" Margin="0,0,10,0" Command="{Binding ResetFilterCommand}"/> <Button Content="Заполнить (5/2)" Width="130" Margin="10,0,5,0" FontSize="14" Command="{Binding FillCommand}"/> <Button Content="Сохранить" Width="100" FontSize="14" Margin="0,0,5,0" Command="{Binding SaveCommand}"/> <Button Content="Экспорт в Excel" Width="140" FontSize="14" Command="{Binding ExportCommand}"/> </StackPanel> <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <!-- Числа --> <Border Grid.Row="0" Background="#4e3d6b" Padding="0"> <StackPanel Orientation="Horizontal"> <Border Width="160" Height="26" Padding="8,0"> <TextBlock Text="Сотрудник" Foreground="White" FontWeight="Bold" FontSize="12" VerticalAlignment="Center"/> </Border> <Border Width="120" Height="26" Padding="8,0"> <TextBlock Text="Должность" Foreground="White" FontWeight="Bold" FontSize="12" VerticalAlignment="Center"/> </Border> <Border Width="150" Height="26" Padding="8,0"> <TextBlock Text="Подразделение" Foreground="White" FontWeight="Bold" FontSize="12" VerticalAlignment="Center"/> </Border> <ItemsControl ItemsSource="{Binding DayHeaders}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Border Width="44" Height="26" BorderBrush="#1a252f" BorderThickness="1"> <TextBlock Text="{Binding Day}" Foreground="White" FontWeight="Bold" FontSize="11" TextAlignment="Center" VerticalAlignment="Center"/> </Border> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </StackPanel> </Border> <!-- Дни недели --> <Border Grid.Row="1" Background="#564277" Padding="0"> <StackPanel Orientation="Horizontal"> <Border Width="160" Height="20"/> <Border Width="120" Height="20"/> <Border Width="150" Height="20"/> <ItemsControl ItemsSource="{Binding DayHeaders}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Border Width="44" Height="20" BorderBrush="#1a252f" BorderThickness="1"> <TextBlock Text="{Binding DayName}" Foreground="#bdc3c7" FontSize="9" TextAlignment="Center" VerticalAlignment="Center"/> </Border> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </StackPanel> </Border> <!-- Сотрудники --> <ItemsControl Grid.Row="2" ItemsSource="{Binding Rows}"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Border Width="160" Height="65" BorderBrush="Gray" BorderThickness="1" Background="#f8f9fa" Padding="6,0"> <TextBlock Text="{Binding EmployeeName}" FontSize="13" FontWeight="Bold" VerticalAlignment="Center" TextWrapping="Wrap"/> </Border> <Border Width="120" Height="65" BorderBrush="Gray" BorderThickness="1" Background="#f8f9fa" Padding="4,0"> <TextBlock Text="{Binding Position}" FontSize="12" VerticalAlignment="Center" TextWrapping="Wrap"/> </Border> <Border Width="150" Height="65" BorderBrush="Gray" BorderThickness="1" Background="#f8f9fa" Padding="4,0"> <TextBlock Text="{Binding Department}" FontSize="12" VerticalAlignment="Center" TextWrapping="Wrap"/> </Border> <ItemsControl ItemsSource="{Binding Days}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Border Width="44" Height="65" BorderBrush="Gray" BorderThickness="1" PreviewMouseRightButtonDown="Cell_MouseRightButtonDown"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <TextBox Grid.Row="0" Text="{Binding WorkCode}" BorderThickness="0" FontSize="14" FontWeight="Bold" TextAlignment="Center" VerticalContentAlignment="Center" Background="White" IsReadOnly="True"/> <TextBox Grid.Row="1" Text="{Binding Hours}" BorderThickness="0" FontSize="12" TextAlignment="Center" VerticalContentAlignment="Center" Background="#fefefe"/> </Grid> </Border> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </Grid> </ScrollViewer> </Grid> </UserControl>