123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <UserControl x:Class="PRSDesktop.AssignmentPanel"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="1024"
- xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
- Background="WhiteSmoke">
- <UserControl.Resources>
- <Style TargetType="syncfusion:TimeRulerCell">
- <Setter Property='VerticalContentAlignment' Value="Center" />
- </Style>
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <syncfusion:SfScheduler Grid.Column="0"
- Grid.Row="0"
- Name="Bookings"
- HeaderDateFormat="dd MMM yyyy"
- SizeChanged="Schedule_SizeChanged"
- AppointmentEditorOpening="Schedule_AppointmentEditorOpening"
- ViewType="Day"
- HeaderHeight="0"
- BorderThickness="1"
- BorderBrush="Silver"
- Background="White"
- ResourceGroupType="Date"
- FirstDayOfWeek="Monday">
- <!-- The context menu to show when you click on an empty cell -->
- <syncfusion:SfScheduler.CellContextMenu>
- <ContextMenu x:Name="CreateAssignmentContextMenu">
- <MenuItem x:Name="CreateAssignment" Header="Create Assignment" Click="CreateAssignment_Click" />
- </ContextMenu>
- </syncfusion:SfScheduler.CellContextMenu>
- <syncfusion:SfScheduler.DaysViewSettings>
- <syncfusion:DaysViewSettings ViewHeaderDateFormat="dd MMM yy" ViewHeaderDayFormat="dddd"
- ViewHeaderHeight="45" TimeRulerFormat="hh:mm tt" TimeInterval="0:30"
- MinimumAllDayAppointmentsCount="0">
- <syncfusion:DaysViewSettings.ViewHeaderTemplate>
- <DataTemplate>
- <StackPanel Background="WhiteSmoke" Margin="-10,0,0,0" VerticalAlignment="Stretch"
- HorizontalAlignment="Stretch" Orientation="Vertical">
- <Label HorizontalContentAlignment="Center" Content="{Binding DayText}" FontSize="12"
- Foreground="Black" FontFamily="Arial" FontWeight="Bold"
- VerticalContentAlignment="Bottom" Margin="0,0,0,-5" />
- <Label HorizontalContentAlignment="Center" Content="{Binding DateText}" FontSize="10"
- VerticalContentAlignment="Top" />
- </StackPanel>
- </DataTemplate>
- </syncfusion:DaysViewSettings.ViewHeaderTemplate>
- <syncfusion:DaysViewSettings.AppointmentTemplate>
- <DataTemplate>
- <Border BorderBrush="Gray" BorderThickness="0.75" CornerRadius="3"
- Background="{Binding AppointmentBackground}" Margin="2,0,-8,0">
- <!-- The context menu to appear when you click on an appointment -->
- <Border.ContextMenu>
- <ContextMenu x:Name="EditAssignmentContextMenu" Tag="{Binding}"
- Opened="EditAssignmentContextMenu_Opened">
- <MenuItem x:Name="EditAssignment" Header="Edit Assignment"
- Click="EditAssignment_Click" Tag="{Binding}" />
- <MenuItem x:Name="ViewForms" Header="Digital Forms" Tag="{Binding}" />
- <Separator x:Name="Separator1" />
- <MenuItem x:Name="EditLeaveRequest" Header="Edit Leave Request"
- Click="EditLeaveRequest_Click" Tag="{Binding}" />
- <MenuItem x:Name="CreateTimeSheet" Header="Create TimeSheet"
- Click="CreateTimeSheet_Click" Tag="{Binding}" />
- <MenuItem x:Name="EditTimeSheet" Header="Create TimeSheet"
- Click="EditTimeSheet_Click" Tag="{Binding}" />
- <MenuItem x:Name="DeleteTimeSheet" Header="Delete TimeSheet"
- Click="DeleteTimeSheet_Click" Tag="{Binding}" />
- <Separator x:Name="Separator2" />
- <MenuItem x:Name="DeleteAssignment" Header="Delete Assignment"
- Click="DeleteAssignment_Click" Tag="{Binding}" />
- </ContextMenu>
- </Border.ContextMenu>
- <Border.ToolTip>
- <Grid Margin="4,2,0,2">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <DockPanel Grid.Row="0" Grid.Column="0" Height="20">
- <TextBlock Text="{Binding Number}" DockPanel.Dock="Left"
- VerticalAlignment="Center" FontWeight="DemiBold"/>
- <TextBlock Text="{Binding JobNumber}" DockPanel.Dock="Left"
- VerticalAlignment="Center" FontWeight="DemiBold" />
- <Image Source="{Binding Locked}" DockPanel.Dock="Right"
- VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
- <Image Source="{Binding Completed}" DockPanel.Dock="Right"
- VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
- <Image Source="{Binding TimeSheet}" DockPanel.Dock="Right"
- VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
- <Image Source="{Binding HasDelivery}" DockPanel.Dock="Right"
- VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
- <TextBlock Text="{Binding Subject}" DockPanel.Dock="Left"
- VerticalAlignment="Center" FontWeight="DemiBold" />
- </DockPanel>
- <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left"
- Text="{Binding Notes}" TextWrapping="Wrap" />
- </Grid>
- </Border.ToolTip>
- <Grid Margin="4,2,0,2">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <DockPanel Grid.Row="0" Grid.Column="0" Height="20">
- <TextBlock Text="{Binding Number}" Foreground="{Binding AppointmentForeground}"
- DockPanel.Dock="Left" VerticalAlignment="Center"
- FontWeight="DemiBold" />
- <TextBlock Text="{Binding JobNumber}" DockPanel.Dock="Left"
- Foreground="{Binding AppointmentForeground}"
- VerticalAlignment="Center" FontWeight="DemiBold" />
- <Image Source="{Binding Locked}" DockPanel.Dock="Right"
- VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
- <Image Source="{Binding Completed}" DockPanel.Dock="Right"
- VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
- <Image Source="{Binding TimeSheet}" DockPanel.Dock="Right"
- VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
- <Image Source="{Binding HasDelivery}" DockPanel.Dock="Right"
- VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
- <TextBlock Text="{Binding Subject}"
- Foreground="{Binding AppointmentForeground}" DockPanel.Dock="Left"
- VerticalAlignment="Center" FontWeight="DemiBold" />
- </DockPanel>
- <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left"
- Text="{Binding Notes}" TextWrapping="Wrap"
- Foreground="{Binding AppointmentForeground}" />
- </Grid>
- </Border>
- </DataTemplate>
- </syncfusion:DaysViewSettings.AppointmentTemplate>
- </syncfusion:DaysViewSettings>
- </syncfusion:SfScheduler.DaysViewSettings>
- </syncfusion:SfScheduler>
- <Grid Margin="0" Grid.Row="0" Grid.Column="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Label Grid.Row="0" Grid.Column="0" Content="View" VerticalContentAlignment="Center" Margin="5,0,0,0" />
- <ComboBox x:Name="View" Grid.Row="0" Grid.Column="1" SelectionChanged="View_SelectionChanged"
- VerticalAlignment="Center" SelectedIndex="-1" Margin="5,0,0,0">
- <ComboBoxItem Content="Day" />
- <ComboBoxItem Content="Work Week" />
- <ComboBoxItem Content="Week" />
- </ComboBox>
- <Border BorderBrush="Gray" BorderThickness="0.75" Padding="0,5,0,0" Grid.Row="1" Grid.Column="0"
- Grid.ColumnSpan="2" Margin="5,5,0,0" Background="White">
- <syncfusion:CalendarEdit x:Name="Date" ShowAbbreviatedMonthNames="True" AllowMultiplySelection="False"
- DateChanged="Date_DateChanged" BorderBrush="Transparent" />
- </Border>
- <Label Content="Team" Grid.Row="2" VerticalContentAlignment="Center" Margin="5,5,0,0" />
- <ComboBox Grid.Row="2" Grid.Column="1" x:Name="Teams" DisplayMemberPath="Value" SelectedValuePath="Key"
- SelectionChanged="Groups_SelectionChanged" VerticalAlignment="Center" Margin="5,5,0,0" />
- <syncfusion:CheckListBox Grid.Row="3" Grid.ColumnSpan="2" x:Name="SelectedEmployees"
- DisplayMemberPath="Value" SelectedValuePath="Key" IsCheckOnFirstClick="True"
- Margin="5,5,0,0" SelectionChanged="SelectedEmployees_SelectionChanged"
- BorderBrush="Gray" />
- <Label Content="Start" Grid.Row="4" VerticalContentAlignment="Center" Margin="5,5,0,0" />
- <DockPanel Grid.Row="4" Grid.Column="1" Margin="5,5,0,0">
- <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
- BorderBrush="Gray" Click="StartTimeDown_Click">
- <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" />
- </Button>
- <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
- BorderBrush="Gray" Click="StartTimeUp_Click">
- <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" />
- </Button>
- <TextBox x:Name="StartHour" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
- BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
- </DockPanel>
- <Label Content="Finish" Grid.Row="5" VerticalContentAlignment="Center" Margin="5,5,0,0" />
- <DockPanel Grid.Row="5" Grid.Column="1" Margin="5,5,0,0">
- <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
- BorderBrush="Gray" Click="FinishTimeDown_Click">
- <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" />
- </Button>
- <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
- BorderBrush="Gray" Click="FinishTimeUp_Click">
- <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" />
- </Button>
- <TextBox x:Name="FinishHour" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
- BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
- </DockPanel>
- <DockPanel Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2">
- <Label Content="Show TimeSheets?" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="5,0,0,0" />
- <CheckBox DockPanel.Dock="Right" HorizontalAlignment="Center" VerticalAlignment="Center"
- x:Name="ShowTimeSheets" Margin="5,0,0,0" Checked="ShowTimeSheets_Checked"
- Unchecked="ShowTimeSheets_Checked" IsThreeState="False" />
- </DockPanel>
- </Grid>
- </Grid>
- </UserControl>
|