diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-01-30 13:59:42 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-01-30 13:59:42 +0200 |
| commit | 2da52762b676d6e844725bfb020ac037a05e5be4 (patch) | |
| tree | 11e3b1df71a59d9b9b102bbcc859900ae42c7607 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs | |
| parent | ddda6089bff56e80703c8d2dce297919edc58bf1 (diff) | |
| parent | d6bc264745261638300e33a17c56df4ebffa2d88 (diff) | |
| download | Tango-2da52762b676d6e844725bfb020ac037a05e5be4.tar.gz Tango-2da52762b676d6e844725bfb020ac037a05e5be4.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs')
4 files changed, 46 insertions, 31 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Images/actionlogs_title.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Images/actionlogs_title.png Binary files differnew file mode 100644 index 000000000..299c14c6d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Images/actionlogs_title.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Tango.MachineStudio.ActionLogs.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Tango.MachineStudio.ActionLogs.csproj index 0d6fa213c..280356aa8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Tango.MachineStudio.ActionLogs.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Tango.MachineStudio.ActionLogs.csproj @@ -116,7 +116,9 @@ <LastGenOutput>Settings.Designer.cs</LastGenOutput> </None> </ItemGroup> - <ItemGroup /> + <ItemGroup> + <Resource Include="Images\actionlogs_title.png" /> + </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\..\Tango.BL\Tango.BL.csproj"> <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModels/MainViewVM.cs index fb6568df8..408789d9f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModels/MainViewVM.cs @@ -23,7 +23,7 @@ namespace Tango.MachineStudio.ActionLogs.ViewModels public class MainViewVM : StudioViewModel { #region Properties - + private DateTime _startSelectedDate; public DateTime StartSelectedDate { @@ -56,15 +56,20 @@ namespace Tango.MachineStudio.ActionLogs.ViewModels public SelectedObjectCollection<ActionLogType> SelectedActionLogTypes { get { return _selectedActionLogTypes; } - set { _selectedActionLogTypes = value; - RaisePropertyChanged(nameof(SelectedActionLogTypes)); } + set + { + _selectedActionLogTypes = value; + RaisePropertyChanged(nameof(SelectedActionLogTypes)); + } } private ActionLog _selectedActionLog = null; public ActionLog SelectedActionLog { get { return _selectedActionLog; } - set { _selectedActionLog = value; + set + { + _selectedActionLog = value; SelectedItemChanged(); RaisePropertyChangedAuto(); InvalidateRelayCommands(); @@ -78,7 +83,7 @@ namespace Tango.MachineStudio.ActionLogs.ViewModels set { _differenceObject = value; RaisePropertyChangedAuto(); } } - + private bool _isRunning; public bool IsRunning { @@ -87,7 +92,7 @@ namespace Tango.MachineStudio.ActionLogs.ViewModels } #endregion - + public RelayCommand SearchCommand { get; set; } public RelayCommand CopyToClipBoardCommand { get; set; } public RelayCommand CopyRelateObjectIDCommand { get; set; } @@ -95,7 +100,7 @@ namespace Tango.MachineStudio.ActionLogs.ViewModels public MainViewVM() { ActionLogs = new ObservableCollection<ActionLog>(); - SearchCommand = new RelayCommand(GetActionLogs, ()=> !IsRunning); + SearchCommand = new RelayCommand(GetActionLogs, () => !IsRunning); CopyRelateObjectIDCommand = new RelayCommand(CopyRelateObjectID); CopyToClipBoardCommand = new RelayCommand(CopyToClipBoard, () => SelectedActionLog != null && SelectedActionLog.DifferenceObject != null); DateTime now = DateTime.Now; @@ -112,12 +117,12 @@ namespace Tango.MachineStudio.ActionLogs.ViewModels { } - + private void CopyToClipBoard() { DataObject data = new DataObject(SelectedActionLog.DifferenceObject.ToJsonString()); System.Windows.Clipboard.SetDataObject(data); - + } private void CopyRelateObjectID() { @@ -137,26 +142,26 @@ namespace Tango.MachineStudio.ActionLogs.ViewModels using (ObservablesContext db = ObservablesContext.CreateDefault()) { DateTime startUtc = StartSelectedDate.ToUniversalTime(); - TimeSpan offsetTime = (EndSelectedDate.Date == DateTime.Now.Date)? DateTime.Now.TimeOfDay : new TimeSpan(23, 59, 59); - DateTime endUtc = EndSelectedDate.ToUniversalTime()+ offsetTime; + TimeSpan offsetTime = (EndSelectedDate.Date == DateTime.Now.Date) ? DateTime.Now.TimeOfDay : new TimeSpan(23, 59, 59); + DateTime endUtc = EndSelectedDate.ToUniversalTime() + offsetTime; IsRunning = true; ActionLogs = await new ActionLogsCollectionBuilder(db).Set(x => x.LastUpdated <= DbFunctions.TruncateTime(endUtc) && x.LastUpdated >= DbFunctions.TruncateTime(startUtc.Date)) .WithUsers() .WithActionType(SelectedActionLogTypes.SynchedSource.ToArray()) .Query(y => y.Where - (x => filter == null || - (x.ID.ToString().ToLower().StartsWith(filter) - || (x.RelatedObjectName != null && x.RelatedObjectName.ToLower().StartsWith(filter)) + (x => filter == null || + (x.ID.ToString().ToLower().StartsWith(filter) + || (x.RelatedObjectName != null && x.RelatedObjectName.ToLower().StartsWith(filter)) || (x.RelatedObjectGuid != null && x.RelatedObjectGuid.ToLower().StartsWith(filter)) || (x.User != null && x.User.Contact != null && x.User.Contact.FullName.ToLower().StartsWith(filter))))) .BuildAsync(); IsRunning = false; } } - + private void SelectedItemChanged() { - if (SelectedActionLog == null || SelectedActionLog.DifferenceObject== null) + if (SelectedActionLog == null || SelectedActionLog.DifferenceObject == null) return; DifferenceObject = SelectedActionLog.DifferenceObject; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml index 80cc12a69..18921e2da 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml @@ -24,7 +24,15 @@ <RowDefinition Height="200"/> <RowDefinition Height="1*"/> </Grid.RowDefinitions> - <TextBlock Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="70"></TextBlock> + <Grid Margin="40"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/actionlogs_title.png" RenderOptions.BitmapScalingMode="Fant"></Image> + <StackPanel Margin="20 0 0 0" VerticalAlignment="Center"> + <TextBlock FontSize="50">Action Logs</TextBlock> + <TextBlock>Select start/end dates and action log types to trace system changes.</TextBlock> + </StackPanel> + </StackPanel> + </Grid> <Grid Grid.Row="1" Margin="40 0 40 40"> <Grid.RowDefinitions> <RowDefinition Height="70"/> @@ -42,16 +50,16 @@ </Border.Effect> <DockPanel> <StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Orientation="Horizontal"> - <StackPanel > - <TextBlock FontSize="10">Start Date:</TextBlock> - <DatePicker x:Name="startdatePicker" SelectedDate="{Binding StartSelectedDate}" materialDesign:HintAssist.Hint="Pick start date" Width="160" VerticalAlignment="Center" FontSize="16" /> - </StackPanel> - <StackPanel Margin="50 0 0 0"> - <TextBlock FontSize="10">End Date:</TextBlock> - <DatePicker x:Name="endDatePicker" SelectedDate="{Binding EndSelectedDate}" materialDesign:HintAssist.Hint="Pick end date" Width="160" VerticalAlignment="Center" FontSize="16" /> - </StackPanel> - <DockPanel Margin="50 0 0 0" > - <TextBlock DockPanel.Dock="Top" Text="Action Log Type:" VerticalAlignment="Center" FontSize="10"></TextBlock> + <StackPanel > + <TextBlock FontSize="10">Start Date:</TextBlock> + <DatePicker x:Name="startdatePicker" SelectedDate="{Binding StartSelectedDate}" materialDesign:HintAssist.Hint="Pick start date" Width="160" VerticalAlignment="Center" FontSize="16" /> + </StackPanel> + <StackPanel Margin="50 0 0 0"> + <TextBlock FontSize="10">End Date:</TextBlock> + <DatePicker x:Name="endDatePicker" SelectedDate="{Binding EndSelectedDate}" materialDesign:HintAssist.Hint="Pick end date" Width="160" VerticalAlignment="Center" FontSize="16" /> + </StackPanel> + <DockPanel Margin="50 0 0 0" > + <TextBlock DockPanel.Dock="Top" Text="Action Log Type:" VerticalAlignment="Center" FontSize="10"></TextBlock> <ToggleButton Width="200" Margin="0 5 0 0" x:Name="selectActionsButton"> <ToggleButton.Template> <ControlTemplate> @@ -208,9 +216,9 @@ <Grid Grid.Row="0" Grid.Column="1" Margin="40 0 10 0"> <Border Padding="14 14 12 14" BorderBrush="DimGray" BorderThickness="0" Background="{StaticResource Logging.Background}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="2"> - <Border.Effect> - <DropShadowEffect ShadowDepth="4" BlurRadius="10" Opacity="0.5"/> - </Border.Effect> + <Border.Effect> + <DropShadowEffect ShadowDepth="4" BlurRadius="10" Opacity="0.5"/> + </Border.Effect> <DockPanel> <TextBlock DockPanel.Dock="Left" Margin="10 0 0 0" Foreground="{StaticResource DimGrayBrush}" FontSize="16" VerticalAlignment="Center" Width="150">Object Changes</TextBlock> <Button Width="Auto" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" DockPanel.Dock="Right" Command="{Binding CopyToClipBoardCommand}" > |
