|
@@ -10,6 +10,7 @@ using System.Threading.Tasks;
|
|
|
using Syncfusion.Windows.Tools.Controls;
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
using System.Reflection;
|
|
|
+using FastReport.Utils;
|
|
|
|
|
|
namespace PRS.Shared
|
|
|
{
|
|
@@ -24,6 +25,7 @@ namespace PRS.Shared
|
|
|
DataUpdater.RegisterUpdateScript("6.43", Update_6_43);
|
|
|
DataUpdater.RegisterUpdateScript("7.00", Update_7_00);
|
|
|
DataUpdater.RegisterUpdateScript("7.06", Update_7_06);
|
|
|
+ DataUpdater.RegisterUpdateScript("7.14", Update_7_14);
|
|
|
}
|
|
|
|
|
|
private static Dictionary<string, Tuple<string, string>> _6_31_module_map = new()
|
|
@@ -531,5 +533,42 @@ namespace PRS.Shared
|
|
|
Logger.Send(LogType.Information, "", "Finished updating Deletions");
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Updating Wpf and Timebench fields to use Platform.DesktopVersion and Platform.MobileVersion
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private static bool Update_7_14()
|
|
|
+ {
|
|
|
+ Logger.Send(LogType.Information, "", "Converting User.Wpf, User.Timebench -> User.Platform.DesktopVersion, User.Platform.MobileVersion");
|
|
|
+
|
|
|
+ Logger.Send(LogType.Information, "", "Loading Wpf, Timebench properties");
|
|
|
+ var props = DbFactory.Provider.Query<CustomProperty>(new Filter<CustomProperty>(x => x.Name).InList("Wpf", "TimeBench"))
|
|
|
+ .Rows.Select(x => x.ToObject<CustomProperty>()).ToArray();
|
|
|
+ DatabaseSchema.Load(props);
|
|
|
+
|
|
|
+ var columns = new Columns<User>(x => x.ID);
|
|
|
+ columns.Add("Wpf", "TimeBench");
|
|
|
+
|
|
|
+ var users = DbFactory.Provider.Query<User>(
|
|
|
+ new Filter<User>().All(),
|
|
|
+ columns).ToObjects<User>().ToList();
|
|
|
+ foreach(var user in users)
|
|
|
+ {
|
|
|
+ if(user.UserProperties.Dictionary.TryGetValue("Wpf", out var wpf))
|
|
|
+ {
|
|
|
+ user.Platform.DesktopVersion = wpf?.Value?.ToString() ?? "";
|
|
|
+ }
|
|
|
+ if (user.UserProperties.Dictionary.TryGetValue("TimeBench", out var timebench))
|
|
|
+ {
|
|
|
+ user.Platform.MobileVersion = timebench?.Value?.ToString() ?? "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ DbFactory.Provider.Save<User>(users);
|
|
|
+
|
|
|
+ Logger.Send(LogType.Information, "", "Finished updating user versions");
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|