ProManager initial setup.

This commit is contained in:
Patrick Fic
2024-03-20 14:30:48 -07:00
parent 63f18cdcae
commit 84908aabfe
68 changed files with 164 additions and 176 deletions

View File

@@ -10,7 +10,7 @@ using GraphQL;
using Newtonsoft;
using Newtonsoft.Json.Linq;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class ARMSRoData
{

View File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using FileHelpers;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using System.Windows;
using System.IO;
using RestSharp;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class AppMetaData
{
@@ -22,7 +22,7 @@ namespace RomeOnlinePartner.Utils
public static Boolean IsTest = false;
private static string workingDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
public static string globalScriptsPath = @"C:\Rome\PartnerScripts";
public static string globalScriptsPath = @"C:\Web-Est\PartnerScripts";
public static RestClient RestClient;

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class ApplicationExceptionHandler
{

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using Firebase.Auth;
using System.Timers;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class Auth
{

View File

@@ -3,7 +3,7 @@ using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace RomeOnlinePartner
namespace ProManagerPartner
{
public class BaseModel : INotifyPropertyChanged
{

View File

@@ -2,7 +2,7 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace RomeOnlinePartner
namespace ProManagerPartner
{
public abstract class BaseViewModel : INotifyPropertyChanged
{

View File

@@ -8,7 +8,7 @@ using System.Threading.Tasks;
using DotNetDBF;
using Newtonsoft.Json.Linq;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
class CCCPartsPriceChange
{

View File

@@ -4,9 +4,9 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RomeOnlinePartner.Models;
using ProManagerPartner.Models;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public class CIECAMonitor : FileSystemWatcher
{

View File

@@ -8,7 +8,7 @@ using System.Threading.Tasks;
using DotNetDBF;
using Newtonsoft.Json.Linq;
namespace RomeOnlinePartner.Utils.Decoder
namespace ProManagerPartner.Utils.Decoder
{
class EstimateDecoder
{

View File

@@ -1,4 +1,4 @@
using RomeOnlinePartner.Models;
using ProManagerPartner.Models;
using System;
using System.Collections.Generic;
using System.IO;
@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class DiskScan
{

View File

@@ -11,7 +11,7 @@ using System.Net.Http;
using Newtonsoft;
using Newtonsoft.Json.Linq;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class GraphQL
{

View File

@@ -1,9 +1,9 @@
<Window x:Class="RomeOnlinePartner.Utils.Growls.GrowlNotification"
<Window x:Class="ProManagerPartner.Utils.Growls.GrowlNotification"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:RomeOnlinePartner.Utils.Growls"
xmlns:local="clr-namespace:ProManagerPartner.Utils.Growls"
mc:Ignorable="d"
SizeToContent="WidthAndHeight"
AllowsTransparency="True"
@@ -11,7 +11,7 @@
ShowInTaskbar="False"
Topmost="True"
UseLayoutRounding="True"
Title="RomeOnlinePartner Notification"
Title="ProManagerPartner Notification"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
@@ -57,7 +57,7 @@
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Grid.RowSpan="2"
Source="../../ro-favicon.ico"
Source="../../favicon.ico"
Margin="4"
Width="24"></Image>
<TextBlock Grid.Column="1"

View File

@@ -15,7 +15,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace RomeOnlinePartner.Utils.Growls
namespace ProManagerPartner.Utils.Growls
{
public partial class GrowlNotification
{

View File

@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RomeOnlinePartner.Utils.Growls
namespace ProManagerPartner.Utils.Growls
{
public class Notification : INotifyPropertyChanged
{

View File

@@ -8,12 +8,12 @@ using System.Xml.Linq;
using Newtonsoft;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RomeOnlinePartner.Models;
using ProManagerPartner.Models;
using ToastNotifications.Messages;
using System.Threading;
using System.Reflection;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class HTTPServer
{
@@ -29,7 +29,7 @@ namespace RomeOnlinePartner.Utils
//QuickBooks Execution Routes.
Route.Add("/qb/", (req, res, props) =>
{
hlog("Received a QuickBooks request from Rome Online");
hlog("Received a QuickBooks request from ProManager");
res.WithCORS();
res.Close();
}, "OPTIONS");
@@ -41,7 +41,7 @@ namespace RomeOnlinePartner.Utils
//Pinging based routes.
Route.Add("/ping/", (req, res, props) =>
{
hlog("Received a ping from Rome Online");
hlog("Received a ping from ProManager");
res.WithCORS();
res.Close();
}, "OPTIONS");
@@ -52,7 +52,7 @@ namespace RomeOnlinePartner.Utils
//FileScanning Routes
Route.Add("/scan/", (req, res, props) =>
{
hlog("Received a scan request from Rome Online");
hlog("Received a scan request from ProManager");
res.WithCORS();
res.Close();
}, "OPTIONS");
@@ -61,7 +61,7 @@ namespace RomeOnlinePartner.Utils
, "POST");
Route.Add("/import/", (req, res, props) =>
{
hlog("Received an import request from Rome Online");
hlog("Received an import request from ProManager");
res.WithCORS();
res.Close();
}, "OPTIONS");
@@ -71,7 +71,7 @@ namespace RomeOnlinePartner.Utils
Route.Add("/oec/", (req, res, props) =>
{
hlog("Received an OEC from Rome Online");
hlog("Received an OEC from ProManager");
res.WithCORS();
res.Close();
}, "OPTIONS");
@@ -81,7 +81,7 @@ namespace RomeOnlinePartner.Utils
Route.Add("/ppc/", (req, res, props) =>
{
hlog("Received an PPC from Rome Online");
hlog("Received an PPC from ProManager");
res.WithCORS();
res.Close();
}, "OPTIONS");
@@ -118,17 +118,17 @@ namespace RomeOnlinePartner.Utils
hlog = HttpLogger;
try
{
hlog("Rome Online connection server starting...");
hlog("ProManager connection server starting...");
HttpServer.ListenAsync(1337, token, Route.OnHttpRequestAsync).Wait();
}
catch (Exception Ex)
{
logger.Fatal("Unable to start HTTP server. " + Ex.ToString());
hlog("Rome Online connection server could not start. Please restart the partner to try again.");
hlog("ProManager connection server could not start. Please restart the partner to try again.");
App.Current.Dispatcher.Invoke(() =>
{
string msg = "Unable to connect to Rome Online Web App. Please ensure your firewall allows the connection.";
string msg = "Unable to connect to ProManager Web App. Please ensure your firewall allows the connection.";
Utils.Notifications.notifier.ShowError(msg);
});
Utils.SquirrelAwareHelper.AddHttpExcetion();
@@ -197,7 +197,7 @@ namespace RomeOnlinePartner.Utils
{
try
{
hlog("Processing QuickBooks request. Rome Online Record ID:" + request.Id);
hlog("Processing QuickBooks request. ProManager Record ID:" + request.Id);
XDocument response = XDocument.Parse(QuickBooksInterop.ProcessQBXmlRequestUnManaged(request.QbXML));
QbXmlResponse ResponseStatus = QuickBooksInterop.ParseResponseXml(response);

View File

@@ -5,14 +5,14 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using RomeOnlinePartner.Utils;
using RomeOnlinePartner.Models;
using RomeOnlinePartner.Utils.Growls;
using ProManagerPartner.Utils;
using ProManagerPartner.Models;
using ProManagerPartner.Utils.Growls;
using GraphQL;
using Newtonsoft.Json.Linq;
using ToastNotifications.Messages;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class JobProcessingQueue
{

View File

@@ -7,7 +7,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
class JsonPathConverter : JsonConverter
{

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class JsonExtensions
{

View File

@@ -6,7 +6,7 @@ using System.Security;
using System.Text;
using System.Threading.Tasks;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class LoginHelpers
{

View File

@@ -9,7 +9,7 @@ using ToastNotifications.Position;
using ToastNotifications.Messages;
using System.Windows;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class Notifications
{

View File

@@ -8,7 +8,7 @@ using System.Threading.Tasks;
using DotNetDBF;
using Newtonsoft.Json.Linq;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class OEConnection
{

View File

@@ -10,7 +10,7 @@ using System.IO;
using System.Timers;
using RestSharp;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class PPGMixData
{
@@ -194,7 +194,7 @@ v_paint_codes
new XElement("TransactionDate", DateTime.Now.ToString("yyyy-MM-hh:mm:ss"))
),
new XElement("Product",
new XElement("Name", "Rome Online"),
new XElement("Name", "ProManager"),
new XElement("Version", null)
)

View File

@@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class PowerModeEventHandler
{

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RomeOnlinePartner.Utils.Queries
namespace ProManagerPartner.Utils.Queries
{
class JobsQueries
{

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RomeOnlinePartner.Utils.Queries
namespace ProManagerPartner.Utils.Queries
{
public static class VehicleQueries
{

View File

@@ -6,12 +6,12 @@ using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
using RomeOnlinePartner.Utils.Growls;
using ProManagerPartner.Utils.Growls;
using Interop.QBFC16;
using Interop.QBXMLRP2;
using ToastNotifications.Messages;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class QuickBooksInterop
{
@@ -20,8 +20,8 @@ namespace RomeOnlinePartner.Utils
private static RequestProcessor2 rp;
private static string maxVersion;
private static QBFileMode mode = QBFileMode.qbFileOpenDoNotCare;
private static string appID = "RomePartner";
private static string appName = "RomeOnlinePartner";
private static string appID = "ProManagerPartner";
private static string appName = "ProManagerPartner";
private static GrowlNotification Growler;
public static void ConnectToQuickBooks()

View File

@@ -1,7 +1,7 @@
using System;
using System.Windows.Input;
namespace RomeOnlinePartner
namespace ProManagerPartner
{
public class RelayCommand : ICommand
{

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
using Microsoft.Win32.TaskScheduler;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class ScheduledTaskConfig
{
@@ -19,12 +19,12 @@ namespace RomeOnlinePartner.Utils
try
{
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("Rome Online Partner - Paint Scale Connection Export");
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("ProManager Partner - Paint Scale Connection Export");
if (existingTask != null)
{
TaskService.Instance.RootFolder.DeleteTask("Rome Online Partner - Paint Scale Connection Export");
TaskService.Instance.RootFolder.DeleteTask("ProManager Partner - Paint Scale Connection Export");
}
Microsoft.Win32.TaskScheduler.Task newTask = TaskService.Instance.AddTask("Rome Online Partner - Paint Scale Connection Export", QuickTriggerType.Hourly, "powershell.exe", @"-ExecutionPolicy Bypass -File " + AppMetaData.globalScriptsPath + @"\PaintScaleExport.ps1");
Microsoft.Win32.TaskScheduler.Task newTask = TaskService.Instance.AddTask("ProManager Partner - Paint Scale Connection Export", QuickTriggerType.Hourly, "powershell.exe", @"-ExecutionPolicy Bypass -File " + AppMetaData.globalScriptsPath + @"\PaintScaleExport.ps1");
newTask.Run();
@@ -41,12 +41,12 @@ namespace RomeOnlinePartner.Utils
try
{
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("Rome Online Partner - ARMS");
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("ProManager Partner - ARMS");
if (existingTask != null)
{
TaskService.Instance.RootFolder.DeleteTask("Rome Online Partner - ARMS");
TaskService.Instance.RootFolder.DeleteTask("ProManager Partner - ARMS");
}
Microsoft.Win32.TaskScheduler.Task newTask = TaskService.Instance.AddTask("Rome Online Partner - ARMS", QuickTriggerType.Daily, "powershell.exe", @"-ExecutionPolicy Bypass -File " + AppMetaData.globalScriptsPath + @"\ArmsExport.ps1");
Microsoft.Win32.TaskScheduler.Task newTask = TaskService.Instance.AddTask("ProManager Partner - ARMS", QuickTriggerType.Daily, "powershell.exe", @"-ExecutionPolicy Bypass -File " + AppMetaData.globalScriptsPath + @"\ArmsExport.ps1");
newTask.Run();

View File

@@ -1,7 +1,7 @@
#Verify that the partner is running. If not, strat it.
if((Get-Process -Name RomeOnlinePartner -ErrorAction SilentlyContinue) -eq $null){
& "$Env:USERPROFILE\AppData\Local\RomeOnlinePartner\RomeOnlinePartner.exe"
if((Get-Process -Name ProManagerPartner -ErrorAction SilentlyContinue) -eq $null){
& "$Env:USERPROFILE\AppData\Local\ProManagerPartner\ProManagerPartner.exe"
}
$PSversion = $PSVersionTable.PSVersion.Major
@@ -11,7 +11,7 @@ function v2 {
# Post request to the partner to trigger the export.
Invoke-WebRequest -Uri http://localhost:1337/arms/rodata/ -Method POST
#Start the Arms Uploader.
Start-Process -FilePath "C:\Rome\Applications\ARMSUploader\ROUpload.exe"
Start-Process -FilePath "C:\Web-Est\Applications\ARMSUploader\ROUpload.exe"
}
function v1 {
@@ -23,7 +23,7 @@ ResponseStream = $Response.GetResponseStream()
ReadStream = New-Object System.IO.StreamReader $ResponseStream
#Data=$ReadStream.ReadToEnd()
#Start the Arms Uploader.
Start-Process -FilePath "C:\Rome\Applications\ARMSUploader\ROUpload.exe"
Start-Process -FilePath "C:\Web-Est\Applications\ARMSUploader\ROUpload.exe"
}

View File

@@ -1,7 +1,7 @@
#Verify that the partner is running. If not, strat it.
if((Get-Process -Name RomeOnlinePartner -ErrorAction SilentlyContinue) -eq $null){
& "$Env:USERPROFILE\AppData\Local\RomeOnlinePartner\RomeOnlinePartner.exe"
if((Get-Process -Name ProManagerPartner -ErrorAction SilentlyContinue) -eq $null){
& "$Env:USERPROFILE\AppData\Local\ProManagerPartner\ProManagerPartner.exe"
}
$PSversion = $PSVersionTable.PSVersion.Major

View File

@@ -12,7 +12,7 @@ Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\imexmedia\shell\open]
[HKEY_CURRENT_USER\Software\Classes\imexmedia\shell\open\command]
@="\"C:\\Rome\\PartnerScripts\\imexmedia.bat\" %1"
@="\"C:\\Web-Est\\PartnerScripts\\imexmedia.bat\" %1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
"ExternalProtocolDialogShowAlwaysOpenCheckbox"=dword:00000001

View File

@@ -9,7 +9,7 @@ using Microsoft.Win32.TaskScheduler;
using System.IO;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class SquirrelAwareHelper
{
@@ -69,10 +69,10 @@ namespace RomeOnlinePartner.Utils
//The paint scale accidentally got added to all people running v31. This was added to remove it.
try
{
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("Rome Online Partner - Paint Scale Connection");
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("ProManager Partner - Paint Scale Connection");
if (existingTask != null)
{
TaskService.Instance.RootFolder.DeleteTask("Rome Online Partner - Paint Scale Connection");
TaskService.Instance.RootFolder.DeleteTask("ProManager Partner - Paint Scale Connection");
}
}
catch (Exception ex)
@@ -150,10 +150,10 @@ namespace RomeOnlinePartner.Utils
mgr.RemoveShortcutForThisExe();
try
{
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("Rome Online Partner - Paint Scale Connection Export"); //This is the old scale path. This was accidentally added for everyone.
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("ProManager Partner - Paint Scale Connection Export"); //This is the old scale path. This was accidentally added for everyone.
if (existingTask != null)
{
TaskService.Instance.RootFolder.DeleteTask("Rome Online Partner - Paint Scale Connection");
TaskService.Instance.RootFolder.DeleteTask("ProManager Partner - Paint Scale Connection");
}
}
catch (Exception ex)
@@ -162,10 +162,10 @@ namespace RomeOnlinePartner.Utils
}
try
{
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("Rome Online Partner - Paint Scale Connection Export");
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("ProManager Partner - Paint Scale Connection Export");
if (existingTask != null)
{
TaskService.Instance.RootFolder.DeleteTask("Rome Online Partner - Paint Scale Connection Export");
TaskService.Instance.RootFolder.DeleteTask("ProManager Partner - Paint Scale Connection Export");
}
}
catch (Exception ex)
@@ -174,10 +174,10 @@ namespace RomeOnlinePartner.Utils
}
try
{
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("Rome Online Partner - ARMS");
Microsoft.Win32.TaskScheduler.Task existingTask = TaskService.Instance.FindTask("ProManager Partner - ARMS");
if (existingTask != null)
{
TaskService.Instance.RootFolder.DeleteTask("Rome Online Partner - ARMS");
TaskService.Instance.RootFolder.DeleteTask("ProManager Partner - ARMS");
}
}
catch (Exception ex)

View File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public class OpenMainWindowCommand : ICommand
{

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public class BoolVisibilityConverter : IValueConverter
{

View File

@@ -10,7 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace RomeOnlinePartner.Utils
namespace ProManagerPartner.Utils
{
public static class UpdateHandler
{
@@ -35,7 +35,7 @@ namespace RomeOnlinePartner.Utils
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
public const string UpdatePath = @"http://partner.romeonline.io/";
public const string UpdatePath = @"http://partner.promanager.web-est.com/";
public static async Task<bool> AreUpdatesAvailable()
{