AssignmentView.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <UserControl x:Class="PRSDesktop.AssignmentView"
  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. xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800" Background="White">
  9. <UserControl.Resources>
  10. <Style TargetType="syncfusion:HeaderTitleBarView">
  11. <Setter Property="Height" Value="00" />
  12. </Style>
  13. <Style TargetType="syncfusion:ScheduleDaysHeaderViewItemsControl">
  14. <Setter Property="Height" Value="0" />
  15. </Style>
  16. <Style TargetType="syncfusion:ScheduleDaysHeaderViewControl">
  17. <Setter Property="Height" Value="30" />
  18. <Setter Property="Background" Value="#FF9EDA11" />
  19. </Style>
  20. <Style TargetType="syncfusion:DayViewItemHeader">
  21. <Setter Property="Height" Value="30" />
  22. <Setter Property="Background" Value="#FF9EDA11" />
  23. </Style>
  24. </UserControl.Resources>
  25. <Grid x:Name="grid">
  26. <Grid.ColumnDefinitions>
  27. <ColumnDefinition Width="200" />
  28. <ColumnDefinition Width="*" />
  29. <ColumnDefinition Width="0" x:Name="TeamColumn" />
  30. </Grid.ColumnDefinitions>
  31. <Grid.RowDefinitions>
  32. <RowDefinition Height="Auto" x:Name="DateRow" />
  33. <RowDefinition Height="*" />
  34. <RowDefinition Height="Auto" />
  35. </Grid.RowDefinitions>
  36. <Border Grid.Row="0" Grid.Column="0" BorderBrush="Silver" BorderThickness="0.75,0.75,0,0.75"
  37. Background="WhiteSmoke" CornerRadius="0,0,0,0" Margin="0,0,0,2" Padding="2">
  38. <DockPanel x:Name="ViewDock">
  39. <Label DockPanel.Dock="Left" Content="View:" VerticalContentAlignment="Center" Margin="0,0,5,0" />
  40. <ComboBox DockPanel.Dock="Left" x:Name="View" SelectionChanged="View_SelectionChanged"
  41. VerticalAlignment="Center" SelectedIndex="-1" Margin="0">
  42. <ComboBoxItem Content="Daily" />
  43. <ComboBoxItem Content="Weekly" />
  44. </ComboBox>
  45. </DockPanel>
  46. </Border>
  47. <Border x:Name="DateBorder" Grid.Row="0" Grid.Column="1" BorderBrush="Silver"
  48. BorderThickness="0,0.75,0.75,0.75" Background="WhiteSmoke" CornerRadius="0,0,0,0" Margin="0,0,0,2"
  49. Padding="2">
  50. <DockPanel>
  51. <Button x:Name="ShowEmployees" DockPanel.Dock="Right" Content="&lt;" Width="20" Margin="0,2,2,2"
  52. Visibility="Visible" Click="ShowEmployees_Click" Height="22" />
  53. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  54. <Button x:Name="PrevMonth" BorderThickness="0" Background="Transparent" Click="PrevMonth_Click" />
  55. <Button x:Name="PrevDay" BorderThickness="0" Background="Transparent" Click="PrevDay_Click" />
  56. <TextBox x:Name="CurrentDate" Width="250" Text="ddd, dd MMMM yyyy"
  57. HorizontalContentAlignment="Center" Background="Transparent"
  58. VerticalContentAlignment="Center" MouseDoubleClick="CurrentDate_MouseDoubleClick"
  59. Margin="2" />
  60. <Button x:Name="NextDay" BorderThickness="0" Background="Transparent" Click="NextDay_Click" />
  61. <Button x:Name="NextMonth" BorderThickness="0" Background="Transparent" Click="NextMonth_Click" />
  62. </StackPanel>
  63. </DockPanel>
  64. </Border>
  65. <Border Grid.Row="0" Grid.Column="2" BorderBrush="Silver" BorderThickness="0,0.75,0.75,0.75"
  66. Background="WhiteSmoke" CornerRadius="0,0,0,0" Margin="0,0,0,2" Padding="2">
  67. <DockPanel>
  68. <Label DockPanel.Dock="Left" Content="Team:" VerticalContentAlignment="Center" Margin="0,0,5,0" />
  69. <Button x:Name="HideEmployees" DockPanel.Dock="Right" Content="&gt;" Width="20" Margin="2,2,0,2"
  70. Click="HideEmployees_Click" Height="22" />
  71. <ComboBox DockPanel.Dock="Left" x:Name="Teams" DisplayMemberPath="Value" SelectedValuePath="Key"
  72. SelectionChanged="Teams_SelectionChanged" VerticalAlignment="Center" />
  73. </DockPanel>
  74. </Border>
  75. <Border Grid.Row="1" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2" BorderBrush="Silver"
  76. BorderThickness="1" Background="WhiteSmoke" Margin="0,0,0,0" Padding="0">
  77. <syncfusion:SfSchedule
  78. Name="Bookings"
  79. DayHeaderOrder="OrderByDate"
  80. HeaderDateFormat="dd MMM yyyy"
  81. ShowNonWorkingHours="True"
  82. NonWorkingHourBrush="Gainsboro"
  83. IsHighLightWorkingHours="True"
  84. ShowAllDay="False"
  85. AllowEditing="True"
  86. AllowResize="False"
  87. AllowDeleting="False"
  88. AllowAddNewAppointment="True"
  89. AllowAppointmentEditing="True"
  90. SizeChanged="Bookings_SizeChanged"
  91. AppointmentEndDragging="Schedule_AppointmentEndDragging"
  92. AppointmentEndResizing="Schedule_AppointmentEndResizing"
  93. AppointmentEditorOpening="Schedule_AppointmentEditorOpening"
  94. AppointmentStartDragging="Schedule_AppointmentStartDragging"
  95. AllowDrop="True"
  96. Drop="Bookings_Drop"
  97. ScheduleType="Day"
  98. Background="White"
  99. HeaderBackground="White"
  100. CellSelectionBrush="LightBlue"
  101. MinWidth="200"
  102. PreviewMouseLeftButtonUp="Bookings_MouseLeftButtonUp"
  103. PreviewMouseRightButtonUp="Bookings_MouseRightButtonUp">
  104. <syncfusion:SfSchedule.ContextMenu>
  105. <ContextMenu>
  106. <MenuItem x:Name="CreateAssignment" Header="Create Assignment" Click="CreateAssignment_Click" />
  107. <MenuItem x:Name="EditAssignment" Header="Edit Assignment" Click="EditAssignment_Click" />
  108. <Separator x:Name="Separator1" />
  109. <!--<MenuItem x:Name="EditRequisition" Header="Edit Requisition" Click="EditRequisition_Click"/>-->
  110. <MenuItem x:Name="EditLeaveRequest" Header="Edit Leave Request" Click="EditLeaveRequest_Click" />
  111. <MenuItem x:Name="CreateTimeSheet" Header="Create TimeSheet" Click="CreateTimeSheet_Click" />
  112. <MenuItem x:Name="EditTimeSheet" Header="Create TimeSheet" Click="EditTimeSheet_Click" />
  113. <MenuItem x:Name="DeleteTimeSheet" Header="Delete TimeSheet" Click="DeleteTimeSheet_Click" />
  114. <Separator x:Name="Separator2" />
  115. <MenuItem x:Name="DeleteAssignment" Header="Delete Assignment" Click="DeleteAssignment_Click" />
  116. <Separator x:Name="Separator3" />
  117. <MenuItem x:Name="ZoomIn" Header="Zoom In" Click="ZoomIn_Click" />
  118. <MenuItem x:Name="ZoomOut" Header="Zoom Out" Click="ZoomOut_Click" />
  119. <MenuItem x:Name="ZoomReset" Header="Reset Zoom" Click="ZoomReset_Click" />
  120. </ContextMenu>
  121. </syncfusion:SfSchedule.ContextMenu>
  122. <syncfusion:SfSchedule.AppointmentTemplate>
  123. <DataTemplate>
  124. <Border BorderBrush="Gray" BorderThickness="0.75" CornerRadius="3"
  125. Background="{Binding AppointmentBackground}"
  126. PreviewMouseLeftButtonUp="Bookings_MouseLeftButtonUp"
  127. PreviewMouseRightButtonUp="Bookings_MouseRightButtonUp"
  128. Tag="{Binding}"
  129. >
  130. <Grid Margin="4,2,0,2">
  131. <Grid.ColumnDefinitions>
  132. <ColumnDefinition Width="*" />
  133. </Grid.ColumnDefinitions>
  134. <Grid.RowDefinitions>
  135. <RowDefinition Height="Auto" />
  136. <RowDefinition Height="*" />
  137. </Grid.RowDefinitions>
  138. <DockPanel Grid.Row="0" Grid.Column="0" Height="20">
  139. <TextBlock Text="{Binding Number}" Foreground="{Binding AppointmentForeground}"
  140. DockPanel.Dock="Left" VerticalAlignment="Center" FontWeight="DemiBold" />
  141. <TextBlock Text="{Binding JobNumber}" DockPanel.Dock="Left"
  142. Foreground="{Binding AppointmentForeground}" VerticalAlignment="Center"
  143. FontWeight="DemiBold" Margin="2,0,0,0" />
  144. <Image Source="{Binding Locked}" DockPanel.Dock="Right" VerticalAlignment="Center"
  145. MaxWidth="20" MaxHeight="20" />
  146. <Image Source="{Binding Completed}" DockPanel.Dock="Right"
  147. VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
  148. <Image Source="{Binding TimeSheet}" DockPanel.Dock="Right"
  149. VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
  150. <Image Source="{Binding HasDelivery}" DockPanel.Dock="Right"
  151. VerticalAlignment="Center" MaxWidth="20" MaxHeight="20" />
  152. <TextBlock Text="{Binding Subject}" Foreground="{Binding AppointmentForeground}"
  153. DockPanel.Dock="Left" VerticalAlignment="Center" FontWeight="DemiBold"
  154. Margin="2,0,0,0" />
  155. </DockPanel>
  156. <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left"
  157. Text="{Binding Notes}" TextWrapping="Wrap"
  158. Foreground="{Binding AppointmentForeground}" />
  159. </Grid>
  160. </Border>
  161. </DataTemplate>
  162. </syncfusion:SfSchedule.AppointmentTemplate>
  163. </syncfusion:SfSchedule>
  164. </Border>
  165. <syncfusion:CheckListBox Grid.Row="1" Grid.Column="2" Margin="2,0,0,0" x:Name="SelectedEmployees"
  166. DisplayMemberPath="Value" SelectedValuePath="Key" IsCheckOnFirstClick="True"
  167. SelectionChanged="SelectedEmployees_SelectionChanged" BorderBrush="Silver"
  168. BorderThickness="1" Background="LightYellow" />
  169. <Border Grid.Row="2" Grid.Column="2" BorderBrush="Silver" BorderThickness="1" Background="WhiteSmoke"
  170. Margin="2,2,0,0" Padding="3">
  171. <Grid Margin="2">
  172. <Grid.RowDefinitions>
  173. <RowDefinition Height="Auto" />
  174. <RowDefinition Height="Auto" />
  175. </Grid.RowDefinitions>
  176. <Grid.ColumnDefinitions>
  177. <ColumnDefinition Width="69*" />
  178. <ColumnDefinition Width="89*" />
  179. <ColumnDefinition Width="Auto" />
  180. </Grid.ColumnDefinitions>
  181. <Label Content="Start Time" Grid.Row="0" Grid.Column="0" />
  182. <syncfusion:TimeSpanEdit Grid.Row="0" Grid.Column="1" x:Name="StartTime"
  183. ValueChanged="DisplayTime_ValueChanged" TextAlignment="Center"
  184. MinValue="00:00" MaxValue="1:00:00:00" Format="hh:mm" Margin="2" />
  185. <Label x:Name="StartAMPM" Grid.Row="0" Grid.Column="2" Content="AM" />
  186. <Label Content="Finish Time" Grid.Row="3" />
  187. <syncfusion:TimeSpanEdit x:Name="EndTime" ValueChanged="DisplayTime_ValueChanged" Grid.Row="3"
  188. Grid.Column="1" TextAlignment="Center" MinValue="00:00" MaxValue="1:00:00:00"
  189. Format="hh:mm" Margin="2" />
  190. <Label x:Name="EndAMPM" Content="PM" Grid.Row="3" Grid.Column="2" />
  191. </Grid>
  192. </Border>
  193. </Grid>
  194. </UserControl>