From 00a491d93733d4625ad329b2ba8237f445364b3f Mon Sep 17 00:00:00 2001 From: Mirta Date: Wed, 30 Dec 2020 16:39:52 +0200 Subject: merge --- .../ActionLogsModule.cs | 62 ---- .../Tango.MachineStudio.ActionLogs/App.xaml | 12 - .../Images/action_logs.jpg | Bin 25603 -> 0 bytes .../Images/actionlogs_title.png | Bin 12112 -> 0 bytes .../Properties/AssemblyInfo.cs | 19 -- .../Properties/Resources.Designer.cs | 71 ----- .../Properties/Resources.resx | 117 -------- .../Properties/Settings.Designer.cs | 30 -- .../Properties/Settings.settings | 7 - .../Tango.MachineStudio.ActionLogs.csproj | 163 ----------- .../ViewModelLocator.cs | 29 -- .../ViewModels/MainViewVM.cs | 290 ------------------- .../Views/MainView.xaml | 317 --------------------- .../Views/MainView.xaml.cs | 34 --- .../Tango.MachineStudio.ActionLogs/app.config | 85 ------ .../Tango.MachineStudio.ActionLogs/packages.config | 9 - 16 files changed, 1245 deletions(-) delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ActionLogsModule.cs delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/App.xaml delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Images/action_logs.jpg delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Images/actionlogs_title.png delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/AssemblyInfo.cs delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Resources.Designer.cs delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Resources.resx delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Settings.Designer.cs delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Settings.settings delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Tango.MachineStudio.ActionLogs.csproj delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModelLocator.cs delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModels/MainViewVM.cs delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml.cs delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/app.config delete mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/packages.config (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ActionLogsModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ActionLogsModule.cs deleted file mode 100644 index 3a9dcdfaa..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ActionLogsModule.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media.Imaging; -using Tango.BL.Enumerations; -using Tango.MachineStudio.Common; -using Tango.MachineStudio.ActionLogs.Views; -using Tango.SharedUI.Helpers; - -namespace Tango.MachineStudio.ActionLogs -{ - [StudioModule(21)] - public class ActionLogsModule : StudioModuleBase - { - public override string Name - { - get - { - return "Action Logs"; - } - } - - public override string Description - { - get - { - return "Monitor and track changes made to Twine's global datasets."; - } - } - - public override BitmapSource Image - { - get - { - return ResourceHelper.GetImageFromResources("Images/action_logs.jpg"); - } - } - - public override Type MainViewType - { - get - { - return typeof(MainView); - } - } - - public override Permissions Permission - { - get - { - return Permissions.RunMachineStudio; - } - } - - public override void Dispose() - { - - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/App.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/App.xaml deleted file mode 100644 index 3ab646c7c..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/App.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Images/action_logs.jpg b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Images/action_logs.jpg deleted file mode 100644 index 75f39c09c..000000000 Binary files a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Images/action_logs.jpg and /dev/null differ 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 deleted file mode 100644 index 299c14c6d..000000000 Binary files a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Images/actionlogs_title.png and /dev/null differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/AssemblyInfo.cs deleted file mode 100644 index 072265a74..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -[assembly: AssemblyTitle("Tango - Machine Studio Action Logs Module")] -[assembly: AssemblyVersion("1.0.0.1737")] - -[assembly: ComVisible(false)] - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Resources.Designer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Resources.Designer.cs deleted file mode 100644 index 796a67686..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.MachineStudio.ActionLogs.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.MachineStudio.ActionLogs.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Resources.resx b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Settings.Designer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Settings.Designer.cs deleted file mode 100644 index 507ac539d..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.MachineStudio.ActionLogs.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Settings.settings b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file 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 deleted file mode 100644 index de4783237..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Tango.MachineStudio.ActionLogs.csproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - Debug - AnyCPU - {447ECB9F-F730-47D6-8DF8-D232BF4A0315} - library - Tango.MachineStudio.ActionLogs - Tango.MachineStudio.ActionLogs - v4.6.1 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - - - true - full - false - ..\..\..\Build\Machine Studio\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - ..\..\..\Build\Machine Studio\Release\ - TRACE - prompt - 4 - - - - ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll - - - ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll - - - ..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll - - - ..\..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll - - - ..\..\..\packages\MaterialDesignColors.1.1.2\lib\net45\MaterialDesignColors.dll - - - ..\..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll - - - ..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - - - - - - ..\..\..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll - - - - - - - - - 4.0 - - - - - - - - GlobalVersionInfo.cs - - - - - MainView.xaml - - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - {f441feee-322a-4943-b566-110e12fd3b72} - Tango.BL - - - {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} - Tango.Core - - - {4206ac58-3b57-4699-8835-90bf6db01a61} - Tango.Integration - - - {bc932dbd-7cdb-488c-99e4-f02cf441f55e} - Tango.Logging - - - {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} - Tango.Settings - - - {8491D07B-C1F6-4B62-A412-41B9FD2D6538} - Tango.SharedUI - - - {74e700b0-1156-4126-be40-ee450d3c3026} - Tango.Transport - - - {cb0b0aa2-bb24-4bca-a720-45e397684e12} - Tango.MachineStudio.Common - - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModelLocator.cs deleted file mode 100644 index 29540fa86..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModelLocator.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.DI; -using Tango.MachineStudio.ActionLogs.ViewModels; - -namespace Tango.MachineStudio.ActionLogs -{ - public static class ViewModelLocator - { - /// - /// Initializes a new instance of the ViewModelLocator class. - /// - static ViewModelLocator() - { - TangoIOC.Default.Register(); - } - - public static MainViewVM MainViewVM - { - get - { - return TangoIOC.Default.GetInstance(); - } - } - } -} 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 deleted file mode 100644 index 3e5c59fee..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/ViewModels/MainViewVM.cs +++ /dev/null @@ -1,290 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Data.Entity; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using Tango.BL; -using Tango.BL.Builders; -using Tango.BL.Entities; -using Tango.BL.Enumerations; -using Tango.BL.ValueObjects; -using Tango.Core.Commands; -using Tango.Core.ExtensionMethods; -using Tango.MachineStudio.Common; -using Tango.MachineStudio.Common.Notifications; -using Tango.SharedUI.Components; - -namespace Tango.MachineStudio.ActionLogs.ViewModels -{ - public class MainViewVM : StudioViewModel - { - private INotificationProvider _notification; - private List _allUsers; - - #region Properties - - private DateTime _startSelectedDate; - public DateTime StartSelectedDate - { - get { return _startSelectedDate; } - set { _startSelectedDate = value; RaisePropertyChangedAuto(); } - } - - private DateTime _endSelectedDate; - public DateTime EndSelectedDate - { - get { return _endSelectedDate; } - set { _endSelectedDate = value; RaisePropertyChangedAuto(); } - } - - private string _searchFilter; - public string SearchFilter - { - get { return _searchFilter; } - set { _searchFilter = value; RaisePropertyChangedAuto(); } - } - - private ObservableCollection _actionLogs; - public ObservableCollection ActionLogs - { - get { return _actionLogs; } - set { _actionLogs = value; RaisePropertyChanged(nameof(ActionLogs)); } - } - - private SelectedObjectCollection _selectedActionLogTypes; - public SelectedObjectCollection SelectedActionLogTypes - { - get { return _selectedActionLogTypes; } - set - { - _selectedActionLogTypes = value; - RaisePropertyChanged(nameof(SelectedActionLogTypes)); - } - } - - private ActionLog _selectedActionLog = null; - public ActionLog SelectedActionLog - { - get { return _selectedActionLog; } - set - { - _selectedActionLog = value; - SelectedItemChanged(); - RaisePropertyChangedAuto(); - InvalidateRelayCommands(); - } - } - - private ActionLogDifference _differenceObject; - public ActionLogDifference DifferenceObject - { - get { return _differenceObject; } - set { _differenceObject = value; RaisePropertyChangedAuto(); } - } - - private bool _isLoading; - - public bool IsLoading - { - get { return _isLoading; } - set { _isLoading = value; RaisePropertyChangedAuto(); } - } - - private bool _isLoadingDifferences; - - public bool IsLoadingDifferences - { - get { return _isLoadingDifferences; } - set { _isLoadingDifferences = value; RaisePropertyChangedAuto(); } - } - - - - - #endregion - - public RelayCommand SearchCommand { get; set; } - public RelayCommand CopyToClipBoardCommand { get; set; } - public RelayCommand CopyRelateObjectIDCommand { get; set; } - - public MainViewVM(INotificationProvider notification) - { - _notification = notification; - - IsLoading = false; - IsLoadingDifferences = false; - ActionLogs = new ObservableCollection(); - SearchCommand = new RelayCommand(async () => await GetActionLogs(), () => IsFree); - CopyRelateObjectIDCommand = new RelayCommand(CopyRelateObjectID); - CopyToClipBoardCommand = new RelayCommand(CopyToClipBoard, () => SelectedActionLog != null && SelectedActionLog.DifferenceObject != null); - DateTime now = DateTime.Now; - StartSelectedDate = now.AddMonths(-1); - EndSelectedDate = now; - var source = Enum.GetValues(typeof(ActionLogType)).Cast().ToObservableCollection(); - var syncedSource = Enum.GetValues(typeof(ActionLogType)).Cast().ToObservableCollection(); - - SelectedActionLogTypes = new SelectedObjectCollection(source, syncedSource); - } - - public override void OnApplicationReady() - { - InitUsers(); - } - public async void InitUsers() - { - try - { - IsFree = false; - - using (var db = ObservablesContext.CreateDefault()) - { - - _allUsers = await db.Users.Include(x => x.Contact).ToListAsync(); - } - } - catch (Exception ex) - { - LogManager.Log(ex, "Error loading users."); - } - finally - { - IsFree = true; - } - } - - private void CopyToClipBoard() - { - DataObject data = new DataObject(SelectedActionLog.DifferenceObject.ToJsonString()); - System.Windows.Clipboard.SetDataObject(data); - - } - private void CopyRelateObjectID() - { - DataObject data = new DataObject(SelectedActionLog.RelatedObjectGuid); - System.Windows.Clipboard.SetDataObject(data); - } - - /// - /// New Database Query with search parameters. Initialization ActionLogs property. - /// - private async Task GetActionLogs() - { - IsLoading = true; - string filter = SearchFilter?.ToLower(); - - if (String.IsNullOrWhiteSpace(filter)) filter = null; - - try - { - IsFree = false; - - using (ObservablesContext db = ObservablesContext.CreateDefault()) - { - DateTime startUtc = new DateTime(StartSelectedDate.Year, StartSelectedDate.Month, StartSelectedDate.Day, 0, 0, 0).ToUniversalTime(); - TimeSpan offsetTime = (EndSelectedDate.Date == DateTime.Now.Date) ? DateTime.Now.TimeOfDay : new TimeSpan(23, 59, 59); - DateTime endUtc = EndSelectedDate.ToUniversalTime() + offsetTime; - - Debug.Write($"TEST TIME {startUtc} to {endUtc} "+ System.Environment.NewLine); - - var db_ActionLogs = db.ActionLogs.Where(x => x.LastUpdated <= endUtc && x.LastUpdated >= startUtc) - .Select(x => new - { - x.ID, - x.Guid, - x.UserGuid, - x.LastUpdated, - x.Type, - x.RelatedObjectName, - x.RelatedObjectGuid, - x.Message - }); - - int[] actionTypes = SelectedActionLogTypes.SynchedSource.ToArray().Select(x => (int)x).ToArray(); - if (actionTypes.Length > 0) - { - db_ActionLogs = db_ActionLogs.Where(x => actionTypes.Contains(x.Type)); - } - - var runs_db = await db_ActionLogs.ToListAsync(); - var runs = runs_db.Select(x => new ActionLog() - { - ID = x.ID, - Guid = x.Guid, - UserGuid = x.UserGuid, - LastUpdated = x.LastUpdated, - Type = x.Type, - RelatedObjectName = x.RelatedObjectName, - RelatedObjectGuid = x.RelatedObjectGuid, - Message = x.Message, - User = _allUsers.SingleOrDefault(y => y.Guid == x.UserGuid) - }); - - if (!String.IsNullOrEmpty(filter)) - { - runs = runs.Where(x => 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))); - } - ActionLogs = runs.ToObservableCollection(); - } - } - catch (Exception ex) - { - IsFree = true; - LogManager.Log(ex, "Error getting action logs."); - _notification.ShowError($"Error occurred while trying to retrieve the action logs.\n{ex.Message}"); - } - finally - { - IsFree = true; - IsLoading = false; - } - } - - /// - /// Update DifferenceObject on Selected item changed - /// - private async void SelectedItemChanged() - { - if (SelectedActionLog == null) - return; - if (SelectedActionLog.Difference == null) - { - await InitSelectedActionLogDifference(); - } - DifferenceObject = SelectedActionLog.DifferenceObject; - } - - /// - /// Initializes the selected action log difference. - /// - public async Task InitSelectedActionLogDifference() - { - IsLoadingDifferences = true; - try - { - using (var db = ObservablesContext.CreateDefault()) - { - var difference = await db.ActionLogs.SingleOrDefaultAsync(x => x.Guid.Equals(SelectedActionLog.Guid)); - if (difference != null) - { - SelectedActionLog.DifferenceObject = difference.DifferenceObject; - } - } - } - catch (Exception ex) - { - LogManager.Log(ex, "Error loading difference of the selected action log."); - } - finally - { - IsLoadingDifferences = false; - } - } - } -} 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 deleted file mode 100644 index 146735eaa..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - - - - - - - - - - - Action Logs - Select start/end dates and action log types to trace system changes. - - - - - - - - - - - - - - - - - - - - - - Start Date: - - - - End Date: - - - - - - - - - - - - - - () - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Object Changes - - - - - - - - - - - - - - - - - - - - : - - | - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml.cs deleted file mode 100644 index 67641e3fc..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/Views/MainView.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Tango.MachineStudio.ActionLogs.Views -{ - /// - /// Interaction logic for MainView.xaml - /// - public partial class MainView : UserControl - { - public MainView() - { - InitializeComponent(); - } - - private void Button_Click(object sender, RoutedEventArgs e) - { - selectActionsButton.IsChecked = true; - e.Handled = true; - } - } -} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/app.config deleted file mode 100644 index 7b82e5f7c..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/app.config +++ /dev/null @@ -1,85 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/packages.config deleted file mode 100644 index e57143046..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ActionLogs/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file -- cgit v1.3.1