AssignmentPanel.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <UserControl x:Class="PRSDesktop.AssignmentPanel"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. mc:Ignorable="d"
  7. d:DesignHeight="450" d:DesignWidth="1024"
  8. xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
  9. Background="WhiteSmoke">
  10. <UserControl.Resources>
  11. <Style TargetType="syncfusion:TimeRulerCell">
  12. <Setter Property='VerticalContentAlignment' Value="Center" />
  13. </Style>
  14. </UserControl.Resources>
  15. <Grid>
  16. <Grid.RowDefinitions>
  17. <RowDefinition Height="*" />
  18. </Grid.RowDefinitions>
  19. <Grid.ColumnDefinitions>
  20. <ColumnDefinition Width="*" />
  21. <ColumnDefinition Width="Auto" />
  22. </Grid.ColumnDefinitions>
  23. <syncfusion:SfScheduler Grid.Column="0"
  24. Grid.Row="0"
  25. Name="Bookings"
  26. HeaderDateFormat="dd MMM yyyy"
  27. SizeChanged="Schedule_SizeChanged"
  28. AppointmentEditorOpening="Schedule_AppointmentEditorOpening"
  29. ViewType="Day"
  30. HeaderHeight="0"
  31. BorderThickness="1"
  32. BorderBrush="Silver"
  33. Background="White"
  34. ResourceGroupType="Date"
  35. FirstDayOfWeek="Monday">
  36. <!-- The context menu to show when you click on an empty cell -->
  37. <syncfusion:SfScheduler.CellContextMenu>
  38. <ContextMenu x:Name="CreateAssignmentContextMenu">
  39. <MenuItem x:Name="CreateAssignment" Header="Create Assignment" Click="CreateAssignment_Click" />
  40. </ContextMenu>
  41. </syncfusion:SfScheduler.CellContextMenu>
  42. <syncfusion:SfScheduler.DaysViewSettings>
  43. <syncfusion:DaysViewSettings ViewHeaderDateFormat="dd MMM yy" ViewHeaderDayFormat="dddd"
  44. ViewHeaderHeight="45" TimeRulerFormat="hh:mm tt" TimeInterval="0:30"
  45. MinimumAllDayAppointmentsCount="0">
  46. <syncfusion:DaysViewSettings.ViewHeaderTemplate>
  47. <DataTemplate>
  48. <StackPanel Background="WhiteSmoke" Margin="-10,0,0,0" VerticalAlignment="Stretch"
  49. HorizontalAlignment="Stretch" Orientation="Vertical">
  50. <Label HorizontalContentAlignment="Center" Content="{Binding DayText}" FontSize="12"
  51. Foreground="Black" FontFamily="Arial" FontWeight="Bold"
  52. VerticalContentAlignment="Bottom" Margin="0,0,0,-5" />
  53. <Label HorizontalContentAlignment="Center" Content="{Binding DateText}" FontSize="10"
  54. VerticalContentAlignment="Top" />
  55. </StackPanel>
  56. </DataTemplate>
  57. </syncfusion:DaysViewSettings.ViewHeaderTemplate>
  58. <syncfusion:DaysViewSettings.AppointmentTemplate>
  59. <DataTemplate>
  60. <Border BorderBrush="Gray" BorderThickness="0.75" CornerRadius="3"
  61. Background="{Binding AppointmentBackground}" Margin="2,0,-8,0">
  62. <!-- The context menu to appear when you click on an appointment -->
  63. <Border.ContextMenu>
  64. <ContextMenu x:Name="EditAssignmentContextMenu" Tag="{Binding}"
  65. Opened="EditAssignmentContextMenu_Opened">
  66. <MenuItem x:Name="EditAssignment" Header="Edit Assignment"
  67. Click="EditAssignment_Click" Tag="{Binding}" />
  68. <MenuItem x:Name="ViewForms" Header="Digital Forms" Tag="{Binding}" />
  69. <Separator x:Name="Separator1" />
  70. <MenuItem x:Name="EditLeaveRequest" Header="Edit Leave Request"
  71. Click="EditLeaveRequest_Click" Tag="{Binding}" />
  72. <MenuItem x:Name="CreateTimeSheet" Header="Create TimeSheet"
  73. Click="CreateTimeSheet_Click" Tag="{Binding}" />
  74. <MenuItem x:Name="EditTimeSheet" Header="Create TimeSheet"
  75. Click="EditTimeSheet_Click" Tag="{Binding}" />
  76. <MenuItem x:Name="DeleteTimeSheet" Header="Delete TimeSheet"
  77. Click="DeleteTimeSheet_Click" Tag="{Binding}" />
  78. <Separator x:Name="Separator2" />
  79. <MenuItem x:Name="DeleteAssignment" Header="Delete Assignment"
  80. Click="DeleteAssignment_Click" Tag="{Binding}" />
  81. </ContextMenu>
  82. </Border.ContextMenu>
  83. <Border.ToolTip>
  84. <Grid Margin="4,2,0,2">
  85. <Grid.ColumnDefinitions>
  86. <ColumnDefinition Width="*" />
  87. </Grid.ColumnDefinitions>
  88. <Grid.RowDefinitions>
  89. <RowDefinition Height="Auto" />
  90. <RowDefinition Height="*" />
  91. </Grid.RowDefinitions>
  92. <DockPanel Grid.Row="0" Grid.Column="0" Height="20">
  93. <TextBlock Text="{Binding Number}" DockPanel.Dock="Left"
  94. VerticalAlignment="Center" FontWeight="DemiBold"/>
  95. <TextBlock Text="{Binding JobNumber}" DockPanel.Dock="Left"
  96. VerticalAlignment="Center" FontWeight="DemiBold" />
  97. <Image Source="{Binding Locked}" DockPanel.Dock="Right"
  98. VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
  99. <Image Source="{Binding Completed}" DockPanel.Dock="Right"
  100. VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
  101. <Image Source="{Binding TimeSheet}" DockPanel.Dock="Right"
  102. VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
  103. <Image Source="{Binding HasDelivery}" DockPanel.Dock="Right"
  104. VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
  105. <TextBlock Text="{Binding Subject}" DockPanel.Dock="Left"
  106. VerticalAlignment="Center" FontWeight="DemiBold" />
  107. </DockPanel>
  108. <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left"
  109. Text="{Binding Notes}" TextWrapping="Wrap" />
  110. </Grid>
  111. </Border.ToolTip>
  112. <Grid Margin="4,2,0,2">
  113. <Grid.ColumnDefinitions>
  114. <ColumnDefinition Width="*" />
  115. </Grid.ColumnDefinitions>
  116. <Grid.RowDefinitions>
  117. <RowDefinition Height="Auto" />
  118. <RowDefinition Height="*" />
  119. </Grid.RowDefinitions>
  120. <DockPanel Grid.Row="0" Grid.Column="0" Height="20">
  121. <TextBlock Text="{Binding Number}" Foreground="{Binding AppointmentForeground}"
  122. DockPanel.Dock="Left" VerticalAlignment="Center"
  123. FontWeight="DemiBold" />
  124. <TextBlock Text="{Binding JobNumber}" DockPanel.Dock="Left"
  125. Foreground="{Binding AppointmentForeground}"
  126. VerticalAlignment="Center" FontWeight="DemiBold" />
  127. <Image Source="{Binding Locked}" DockPanel.Dock="Right"
  128. VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
  129. <Image Source="{Binding Completed}" DockPanel.Dock="Right"
  130. VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
  131. <Image Source="{Binding TimeSheet}" DockPanel.Dock="Right"
  132. VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
  133. <Image Source="{Binding HasDelivery}" DockPanel.Dock="Right"
  134. VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
  135. <TextBlock Text="{Binding Subject}"
  136. Foreground="{Binding AppointmentForeground}" DockPanel.Dock="Left"
  137. VerticalAlignment="Center" FontWeight="DemiBold" />
  138. </DockPanel>
  139. <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left"
  140. Text="{Binding Notes}" TextWrapping="Wrap"
  141. Foreground="{Binding AppointmentForeground}" />
  142. </Grid>
  143. </Border>
  144. </DataTemplate>
  145. </syncfusion:DaysViewSettings.AppointmentTemplate>
  146. </syncfusion:DaysViewSettings>
  147. </syncfusion:SfScheduler.DaysViewSettings>
  148. </syncfusion:SfScheduler>
  149. <Grid Margin="0" Grid.Row="0" Grid.Column="1">
  150. <Grid.ColumnDefinitions>
  151. <ColumnDefinition Width="Auto" />
  152. <ColumnDefinition Width="*" />
  153. </Grid.ColumnDefinitions>
  154. <Grid.RowDefinitions>
  155. <RowDefinition Height="Auto" />
  156. <RowDefinition Height="Auto" />
  157. <RowDefinition Height="Auto" />
  158. <RowDefinition Height="*" />
  159. <RowDefinition Height="Auto" />
  160. <RowDefinition Height="Auto" />
  161. <RowDefinition Height="Auto" />
  162. </Grid.RowDefinitions>
  163. <Label Grid.Row="0" Grid.Column="0" Content="View" VerticalContentAlignment="Center" Margin="5,0,0,0" />
  164. <ComboBox x:Name="View" Grid.Row="0" Grid.Column="1" SelectionChanged="View_SelectionChanged"
  165. VerticalAlignment="Center" SelectedIndex="-1" Margin="5,0,0,0">
  166. <ComboBoxItem Content="Day" />
  167. <ComboBoxItem Content="Work Week" />
  168. <ComboBoxItem Content="Week" />
  169. </ComboBox>
  170. <Border BorderBrush="Gray" BorderThickness="0.75" Padding="0,5,0,0" Grid.Row="1" Grid.Column="0"
  171. Grid.ColumnSpan="2" Margin="5,5,0,0" Background="White">
  172. <syncfusion:CalendarEdit x:Name="Date" ShowAbbreviatedMonthNames="True" AllowMultiplySelection="False"
  173. DateChanged="Date_DateChanged" BorderBrush="Transparent" />
  174. </Border>
  175. <Label Content="Team" Grid.Row="2" VerticalContentAlignment="Center" Margin="5,5,0,0" />
  176. <ComboBox Grid.Row="2" Grid.Column="1" x:Name="Teams" DisplayMemberPath="Value" SelectedValuePath="Key"
  177. SelectionChanged="Groups_SelectionChanged" VerticalAlignment="Center" Margin="5,5,0,0" />
  178. <syncfusion:CheckListBox Grid.Row="3" Grid.ColumnSpan="2" x:Name="SelectedEmployees"
  179. DisplayMemberPath="Value" SelectedValuePath="Key" IsCheckOnFirstClick="True"
  180. Margin="5,5,0,0" SelectionChanged="SelectedEmployees_SelectionChanged"
  181. BorderBrush="Gray" />
  182. <Label Content="Start" Grid.Row="4" VerticalContentAlignment="Center" Margin="5,5,0,0" />
  183. <DockPanel Grid.Row="4" Grid.Column="1" Margin="5,5,0,0">
  184. <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
  185. BorderBrush="Gray" Click="StartTimeDown_Click">
  186. <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" />
  187. </Button>
  188. <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
  189. BorderBrush="Gray" Click="StartTimeUp_Click">
  190. <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" />
  191. </Button>
  192. <TextBox x:Name="StartHour" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
  193. BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
  194. </DockPanel>
  195. <Label Content="Finish" Grid.Row="5" VerticalContentAlignment="Center" Margin="5,5,0,0" />
  196. <DockPanel Grid.Row="5" Grid.Column="1" Margin="5,5,0,0">
  197. <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
  198. BorderBrush="Gray" Click="FinishTimeDown_Click">
  199. <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" />
  200. </Button>
  201. <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
  202. BorderBrush="Gray" Click="FinishTimeUp_Click">
  203. <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" />
  204. </Button>
  205. <TextBox x:Name="FinishHour" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
  206. BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
  207. </DockPanel>
  208. <DockPanel Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2">
  209. <Label Content="Show TimeSheets?" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="5,0,0,0" />
  210. <CheckBox DockPanel.Dock="Right" HorizontalAlignment="Center" VerticalAlignment="Center"
  211. x:Name="ShowTimeSheets" Margin="5,0,0,0" Checked="ShowTimeSheets_Checked"
  212. Unchecked="ShowTimeSheets_Checked" IsThreeState="False" />
  213. </DockPanel>
  214. </Grid>
  215. </Grid>
  216. </UserControl>