Compare commits

..

11 Commits

Author SHA1 Message Date
PAL\cbo e4c393c484 Change release location 2026-05-10 17:19:36 +02:00
PAL\cbo c1ccd3b2a3 Fix logo display 2023-04-11 09:24:58 +02:00
PAL\cbo 15c0ebdc57 disable drag splashscreen 2023-02-07 15:17:55 +01:00
PAL\cbo fa4f0b0057 dotnet-6.0 => dotnet-7.0 2023-02-07 15:07:56 +01:00
PAL\cbo 98c3aeb9ea Fix SplashScreen loading 2023-02-07 15:06:43 +01:00
PAL\cbo b2220452b2 SplashScreen 2023-02-07 11:52:39 +01:00
PAL\cbo b6a6f92605 Refactory 2023-02-07 11:52:25 +01:00
PAL\cbo 9431f85720 Add button for clear .auc file 2022-11-15 13:27:49 +01:00
PAL\cbo 467dbcfc62 Apply the changes on UserWindows as previously made on MainWindows 2022-05-05 08:49:46 +02:00
Davide Conforti 4980d300d7 Added check on network axc files (if exists, take that), added resources for static strings 2022-05-04 10:58:47 +02:00
Davide Conforti 9efae80126 Added publish profiles to git 2022-05-04 08:05:11 +02:00
24 changed files with 754 additions and 283 deletions
+39 -18
View File
@@ -4,6 +4,9 @@ using System.Windows;
using System.Security.Principal;
using Serilog;
using Serilog.Sinks.Graylog;
using DevExpress.Mvvm;
using DevExpress.Xpf.Core;
using System.Threading;
namespace wpf_ax_utility
{
@@ -15,24 +18,7 @@ namespace wpf_ax_utility
public static string userName { get { return WindowsIdentity.GetCurrent().Name.Replace("PAL\\", ""); } }
public App()
{
Log.Logger = new LoggerConfiguration().WriteTo.Graylog(new GraylogSinkOptions
{
HostnameOrAddress = "palgraylog01.pal.it",
Port = 12202,
MinimumLogEventLevel = Serilog.Events.LogEventLevel.Verbose,
Facility = "(WPF) AX Utility"
}).CreateLogger();
var userGroups = GetGroups(userName);
var uriString = "/wpf_ax_utility;component/UserWindow.xaml";
if (userGroups.Contains("PAL\\BRAIN FORCE - AX DEV ADMINS") || userGroups.Contains("PAL\\PAL GG IT"))
{
uriString = "/wpf_ax_utility;component/MainWindow.xaml";
}
this.StartupUri = new Uri(uriString, UriKind.Relative);
BeforeStart();
}
private List<string> GetGroups(string userName)
@@ -54,5 +40,40 @@ namespace wpf_ax_utility
result.Sort();
return result;
}
private void BeforeStart()
{
//SplashScreen
var splashScreenViewModel = new DXSplashScreenViewModel() {
Title = "PAL Ax Utility",
Copyright = "",
Logo = new Uri("res/pallogo.png", UriKind.Relative),
};
SplashScreenManager.Create(() => new AxUtilitySplashScreen(), splashScreenViewModel).ShowOnStartup();
//Log Endpoint
Log.Logger = new LoggerConfiguration().WriteTo.Graylog(new GraylogSinkOptions
{
HostnameOrAddress = "palgraylog01.pal.it",
Port = 12202,
MinimumLogEventLevel = Serilog.Events.LogEventLevel.Verbose,
Facility = "(WPF) AX Utility"
}).CreateLogger();
//View selection with group filter
var userGroups = GetGroups(userName);
var uriString = "/wpf_ax_utility;component/AppUserWindow.xaml";
if (userGroups.Contains("PAL\\BRAIN FORCE - AX DEV ADMINS") || userGroups.Contains("PAL\\PAL GG IT"))
{
uriString = "/wpf_ax_utility;component/AppMainWindow.xaml";
}
Thread.Sleep(2000);
this.StartupUri = new Uri(uriString, UriKind.Relative);
}
}
}
+185
View File
@@ -0,0 +1,185 @@
<Window x:Class="wpf_ax_utility.AppMainWindow"
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:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
dx:ThemeManager.ThemeName="None"
mc:Ignorable="d"
MouseLeftButtonDown="MouseLeftDrag"
Height="300" Width="400"
ResizeMode="NoResize"
WindowStyle="None"
WindowStartupLocation="CenterScreen"
AllowsTransparency="True"
Background="Transparent"
Title="PAL Ax Utility"
Icon="res/axlogo.ico">
<Window.Resources>
<Style TargetType="Button" x:Key="TabButton">
<Setter Property="Background" Value="White"/>
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
<Style.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="3"/>
</Style>
</Style.Resources>
</Style>
</Window.Resources>
<Grid>
<Border BorderBrush="#0082C4" BorderThickness="1.5" CornerRadius="10" Background="White">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<DockPanel>
<Border Height="25" Width="25" CornerRadius="5" Margin="4,3,0,0">
<Border.Background>
<ImageBrush Stretch="Fill" ImageSource="res/axlogo.ico"/>
</Border.Background>
</Border>
<TextBlock Margin="5,2,0,0" FontWeight="DemiBold" Text="PAL Ax Utility" VerticalAlignment="Center"/>
<Button Style="{StaticResource TabButton}"
Click="CloseButton"
Height="25"
Width="25"
FontSize="15"
FontWeight="DemiBold"
Background="Transparent"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="0,3,3,0"
BorderBrush="{x:Null}">
<TextBlock Text="x"
Height="25"
Width="25" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Button>
</DockPanel>
<GroupBox Margin="10,2,10,2"
VerticalAlignment="Stretch"
BorderBrush="LightGray"
BorderThickness="1"
Header="Ambienti"
Grid.Row="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="60" />
</Grid.RowDefinitions>
<Button Style="{StaticResource TabButton}"
x:Name="LIVE"
Click="ButtonClicked"
Margin="5"
Content="LIVE"
FontSize="36"
Background="LightGray"
Grid.ColumnSpan="4" />
<Button Style="{StaticResource TabButton}"
x:Name="LIVE02"
Click="ButtonClicked"
Margin="5"
Content="LIVE 02"
FontSize="16"
FontWeight="DemiBold"
Background="LightGray"
Grid.Row="1"/>
<Button Style="{StaticResource TabButton}"
x:Name="DEV"
Click="ButtonClicked"
Margin="5"
Content="DEV"
FontSize="16"
FontWeight="DemiBold"
Background="#00FF80"
Grid.Row="1"
Grid.Column="1"/>
<Button Style="{StaticResource TabButton}"
x:Name="TEST"
Click="ButtonClicked"
Margin="5"
Content="TEST"
FontSize="16"
FontWeight="DemiBold"
Background="#8080FF"
Grid.Row="1"
Grid.Column="2"/>
<Button Style="{StaticResource TabButton}"
x:Name="STAGING"
Click="ButtonClicked"
Margin="5"
Content="STAGING"
FontSize="16"
FontWeight="DemiBold"
Background="#FFFF00"
Grid.Row="1"
Grid.Column="3"/>
</Grid>
</GroupBox>
<GroupBox Margin="10,2,10,10"
VerticalAlignment="Stretch"
BorderBrush="LightGray"
BorderThickness="1"
Header="Utility"
Grid.Row="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="330"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Style="{StaticResource TabButton}"
Click="AucCleanerButton"
Margin="5"
FontSize="12"
FontWeight="DemiBold"
Background="LightGray"
Grid.Column="0">
<StackPanel Orientation="Horizontal">
<!--<Path Margin="5,0,5,0" Height="15" Width="13.125" Stretch="Fill" Fill="Black" Stroke="Black" StrokeThickness="0.1" StrokeStartLineCap="Flat" StrokeEndLineCap="Round" Data="{StaticResource tashCan}" VerticalAlignment="Center"/>-->
<TextBlock>Elimina .AUC</TextBlock>
</StackPanel>
</Button>
<Button Style="{StaticResource TabButton}"
Click="InfoButtonButton"
Margin="5"
Content="?"
FontSize="12"
FontWeight="DemiBold"
Background="LightGray"
Grid.Column="1">
</Button>
</Grid>
</GroupBox>
</Grid>
</Border>
</Grid>
</Window>
+44
View File
@@ -0,0 +1,44 @@
using System.Windows;
using System.Windows.Input;
namespace wpf_ax_utility
{
public partial class AppMainWindow : Window
{
public AppMainWindow()
{
InitializeComponent();
}
private void MouseLeftDrag(object sender, MouseButtonEventArgs e)
{
DragMove();
}
private void CloseButton(object sender, RoutedEventArgs e)
{
Close();
}
private void AucCleanerButton(object sender, RoutedEventArgs e)
{
Utility.AucCleaner();
const string message = "I file .auc sono stati cancellati!";
const string caption = "Informazioni";
MessageBox.Show(message, caption, MessageBoxButton.OK, MessageBoxImage.Information);
}
private void InfoButtonButton(object sender, RoutedEventArgs e)
{
const string message = "Durante il normale utilizzo del software Microsoft Dynamics Ax 2012, potrebbero generarsi dei conflitti nelle impostazioni utente, che bloccano l'apertura del programma.\r\n\r\nÈ possibile tentare di sbloccare la situazione eliminando i file AUC dalla cache locale dell'utente.";
const string caption = "Informazioni";
MessageBox.Show(message, caption, MessageBoxButton.OK, MessageBoxImage.Information);
}
private void ButtonClicked(object sender, RoutedEventArgs e)
{
Utility.AxEnvironmentSelection(sender, e);
}
}
}
@@ -1,8 +1,10 @@
<Window x:Class="wpf_ax_utility.UserWindow"
<Window x:Class="wpf_ax_utility.AppUserWindow"
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:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
dx:ThemeManager.ThemeName="None"
mc:Ignorable="d"
MouseLeftButtonDown="MouseLeftDrag"
Height="260" Width="400"
@@ -12,7 +14,7 @@
AllowsTransparency="True"
Background="Transparent"
Title="PAL Ax Utility"
Icon="/axlogo.ico">
Icon="res/axlogo.ico">
<Window.Resources>
<Style TargetType="Button" x:Key="TabButton">
@@ -41,7 +43,7 @@
<DockPanel>
<Border Height="25" Width="25" CornerRadius="5" Margin="4,3,0,0">
<Border.Background>
<ImageBrush Stretch="Fill" ImageSource="/axlogo.ico"/>
<ImageBrush Stretch="Fill" ImageSource="res/axlogo.ico"/>
</Border.Background>
</Border>
<TextBlock Margin="5,0,0,0" FontWeight="DemiBold" Text="PAL Ax Utility" VerticalAlignment="Center"/>
+32
View File
@@ -0,0 +1,32 @@
using Serilog;
using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace wpf_ax_utility
{
public partial class AppUserWindow : Window
{
public AppUserWindow()
{
InitializeComponent();
}
private void MouseLeftDrag(object sender, MouseButtonEventArgs e)
{
DragMove();
}
private void CloseButton(object sender, RoutedEventArgs e)
{
Close();
}
private void ButtonClicked(object sender, RoutedEventArgs e)
{
Utility.AxEnvironmentSelection(sender, e);
}
}
}
+48
View File
@@ -0,0 +1,48 @@
<dx:SplashScreenWindow x:Class="wpf_ax_utility.AxUtilitySplashScreen"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxt="http://schemas.devexpress.com/winfx/2008/xaml/core/themekeys"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
MinWidth="550"
MinHeight="300"
ResizeMode="NoResize"
WindowStyle="None"
WindowStartupLocation="CenterScreen"
AllowsTransparency="True"
IsHitTestVisible="false"
Background="Transparent"
Title="PAL Ax Utility"
mc:Ignorable="d"
d:DataContext="{x:Static dxmvvm:DXSplashScreenViewModel.DesignTimeData}">
<Grid>
<Border Background="#02188f" CornerRadius="15" Opacity="0.95"/>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="2*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<dx:DXImage x:Name="PART_Logo" Height="67" Width="155" Source="res/pallogo.png" Style="{DynamicResource ResourceKey={dxt:FluentSplashScreenThemeKey ResourceKey=LogoImageStyle}}" Stretch="Fill" Grid.RowSpan="2" Margin="15,15,0,0"/>
<Border Grid.Row="1" Height="100" Width="100" CornerRadius="15">
<Border.Background>
<ImageBrush Stretch="Fill" ImageSource="res/axlogo.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="PART_Title" Grid.Row="1" Text="PAL Ax Utility" Style="{DynamicResource ResourceKey={dxt:FluentSplashScreenThemeKey ResourceKey=TitleTextBoxStyle}}"/>
<StackPanel Orientation="Vertical" Grid.Row="2" VerticalAlignment="Top">
<!--<TextBlock x:Name="PART_SubTitle" Text="{Binding Subtitle}" Style="{DynamicResource ResourceKey={dxt:FluentSplashScreenThemeKey ResourceKey=SubTitleTextBoxStyle}}"/>-->
<ProgressBar IsIndeterminate="{Binding IsIndeterminate}" Value="{Binding Progress}" Grid.Row="2" Style="{DynamicResource ResourceKey={dxt:FluentSplashScreenThemeKey ResourceKey=ProgressBarStyle}}"/>
</StackPanel>
<TextBlock x:Name="PART_Copyright" Text='Copyright © 2023 PAL s.r.l. All rights reserved.' Grid.Row="2" Style="{DynamicResource ResourceKey={dxt:FluentSplashScreenThemeKey ResourceKey=CopyrightTextBoxStyle}}"/>
<TextBlock x:Name="PART_Status" Text="{Binding Status}" Grid.Row="2" Style="{DynamicResource ResourceKey={dxt:FluentSplashScreenThemeKey ResourceKey=StatusTextBoxStyle}}"/>
</Grid>
</Grid>
</dx:SplashScreenWindow>
@@ -0,0 +1,27 @@
using DevExpress.Xpf.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Shapes;
namespace wpf_ax_utility
{
/// <summary>
/// Interaction logic for AxUtilitySplashScreen.xaml
/// </summary>
public partial class AxUtilitySplashScreen : SplashScreenWindow
{
public AxUtilitySplashScreen()
{
InitializeComponent();
}
}
}
-135
View File
@@ -1,135 +0,0 @@
<Window x:Class="wpf_ax_utility.MainWindow"
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"
mc:Ignorable="d"
MouseLeftButtonDown="MouseLeftDrag"
Height="260" Width="400"
ResizeMode="NoResize"
WindowStyle="None"
WindowStartupLocation="CenterScreen"
AllowsTransparency="True"
Background="Transparent"
Title="PAL Ax Utility"
Icon="/axlogo.ico">
<Window.Resources>
<Style TargetType="Button" x:Key="TabButton">
<Setter Property="Background" Value="White"/>
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
<Style.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="3"/>
</Style>
</Style.Resources>
</Style>
</Window.Resources>
<Grid>
<Border BorderBrush="#0082C4" BorderThickness="1.5" CornerRadius="10" Background="White">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<DockPanel>
<Border Height="25" Width="25" CornerRadius="5" Margin="4,3,0,0">
<Border.Background>
<ImageBrush Stretch="Fill" ImageSource="/axlogo.ico"/>
</Border.Background>
</Border>
<TextBlock Margin="5,0,0,0" FontWeight="DemiBold" Text="PAL Ax Utility" VerticalAlignment="Center"/>
<Button Style="{StaticResource TabButton}"
Click="CloseButton"
Height="25" Width="25"
FontSize="18"
FontWeight="DemiBold"
Background="Transparent"
HorizontalAlignment="Right"
BorderBrush="{x:Null}"
Margin="0,3,3,0">
<TextBlock Text="x" Margin="0,-5,0,0"/>
</Button>
</DockPanel>
<GroupBox Margin="10,2,10,10"
VerticalAlignment="Stretch"
BorderBrush="LightGray"
BorderThickness="1"
Header="Ambienti"
Grid.Row="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="60" />
</Grid.RowDefinitions>
<Button Style="{StaticResource TabButton}"
x:Name="LIVE"
Click="ButtonClicked"
Margin="5"
Content="LIVE"
FontSize="36"
Background="LightGray"
Grid.ColumnSpan="4" />
<Button Style="{StaticResource TabButton}"
x:Name="LIVE02"
Click="ButtonClicked"
Margin="5"
Content="LIVE 02"
FontSize="16"
FontWeight="DemiBold"
Background="LightGray"
Grid.Row="1"/>
<Button Style="{StaticResource TabButton}"
x:Name="DEV"
Click="ButtonClicked"
Margin="5"
Content="DEV"
FontSize="16"
FontWeight="DemiBold"
Background="#00FF80"
Grid.Row="1"
Grid.Column="1"/>
<Button Style="{StaticResource TabButton}"
x:Name="TEST"
Click="ButtonClicked"
Margin="5"
Content="TEST"
FontSize="16"
FontWeight="DemiBold"
Background="#8080FF"
Grid.Row="1"
Grid.Column="2"/>
<Button Style="{StaticResource TabButton}"
x:Name="STAGING"
Click="ButtonClicked"
Margin="5"
Content="STAGING"
FontSize="16"
FontWeight="DemiBold"
Background="#FFFF00"
Grid.Row="1"
Grid.Column="3"/>
</Grid>
</GroupBox>
</Grid>
</Border>
</Grid>
</Window>
-57
View File
@@ -1,57 +0,0 @@
using Serilog;
using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace wpf_ax_utility
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void MouseLeftDrag(object sender, MouseButtonEventArgs e)
{
DragMove();
}
private void CloseButton(object sender, RoutedEventArgs e)
{
Close();
}
private void ButtonClicked(object sender, RoutedEventArgs e)
{
Utility.AucCleaner();
string AxArgs = string.Empty;
switch (((Button)sender).Name)
{
case "LIVE":
AxArgs = @"-regConfig=axc\PAL_LIVE_USR.axc";
break;
case "LIVE02":
AxArgs = @"-regConfig=axc\PAL_LIVE_02_USR.axc";
break;
case "DEV":
AxArgs = @"-regConfig=axc\PAL_DEVELOP_USR.axc";
break;
case "TEST":
AxArgs = @"-regConfig=axc\PAL_TEST_USR.axc";
break;
case "STAGING":
AxArgs = @"-regConfig=axc\PAL_STAGING_USR.axc";
break; ;
}
Utility.AxExecution(AxArgs);
Log.Logger.Information("Running AX client with this parameter: " + AxArgs);
}
}
}
@@ -6,12 +6,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>J:\PAL_DEV\AxUtility\</PublishDir>
<PublishDir>C:\Users\cbo\Desktop\PAU</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<SelfContained>false</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
</Project>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>\\palfile01\NET-SW.DIR\PAL_TEST\PAL_Ax_Utility</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
</PropertyGroup>
</Project>
+135
View File
@@ -0,0 +1,135 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Il codice è stato generato da uno strumento.
// Versione runtime:4.0.30319.42000
//
// Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
// il codice viene rigenerato.
// </auto-generated>
//------------------------------------------------------------------------------
namespace wpf_ax_utility.Properties {
using System;
/// <summary>
/// Classe di risorse fortemente tipizzata per la ricerca di stringhe localizzate e così via.
/// </summary>
// Questa classe è stata generata automaticamente dalla classe StronglyTypedResourceBuilder.
// tramite uno strumento quale ResGen o Visual Studio.
// Per aggiungere o rimuovere un membro, modificare il file con estensione ResX ed eseguire nuovamente ResGen
// con l'opzione /str oppure ricompilare il progetto VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.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() {
}
/// <summary>
/// Restituisce l'istanza di ResourceManager nella cache utilizzata da questa classe.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("wpf_ax_utility.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Esegue l'override della proprietà CurrentUICulture del thread corrente per tutte le
/// ricerche di risorse eseguite utilizzando questa classe di risorse fortemente tipizzata.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Cerca una stringa localizzata simile a C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe.
/// </summary>
internal static string Ax32_exe_filepath {
get {
return ResourceManager.GetString("Ax32_exe_filepath", resourceCulture);
}
}
/// <summary>
/// Cerca una stringa localizzata simile a PAL_DEVELOP_USR.axc.
/// </summary>
internal static string DEV_axc_filename {
get {
return ResourceManager.GetString("DEV_axc_filename", resourceCulture);
}
}
/// <summary>
/// Cerca una stringa localizzata simile a PAL_LIVE_USR.axc.
/// </summary>
internal static string LIVE_axc_filename {
get {
return ResourceManager.GetString("LIVE_axc_filename", resourceCulture);
}
}
/// <summary>
/// Cerca una stringa localizzata simile a PAL_LIVE_02_USR.axc.
/// </summary>
internal static string LIVE02_axc_filename {
get {
return ResourceManager.GetString("LIVE02_axc_filename", resourceCulture);
}
}
/// <summary>
/// Cerca una stringa localizzata simile a axc\.
/// </summary>
internal static string local_axc_path {
get {
return ResourceManager.GetString("local_axc_path", resourceCulture);
}
}
/// <summary>
/// Cerca una stringa localizzata simile a \\palaxaos01\XVOL11\Link\.
/// </summary>
internal static string network_axc_path {
get {
return ResourceManager.GetString("network_axc_path", resourceCulture);
}
}
/// <summary>
/// Cerca una stringa localizzata simile a PAL_STAGING_USR.axc.
/// </summary>
internal static string STAGING_axc_filename {
get {
return ResourceManager.GetString("STAGING_axc_filename", resourceCulture);
}
}
/// <summary>
/// Cerca una stringa localizzata simile a PAL_TEST_USR.axc.
/// </summary>
internal static string TEST_axc_filename {
get {
return ResourceManager.GetString("TEST_axc_filename", resourceCulture);
}
}
}
}
+144
View File
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Ax32_exe_filepath" xml:space="preserve">
<value>C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe</value>
</data>
<data name="DEV_axc_filename" xml:space="preserve">
<value>PAL_DEVELOP_USR.axc</value>
</data>
<data name="LIVE02_axc_filename" xml:space="preserve">
<value>PAL_LIVE_02_USR.axc</value>
</data>
<data name="LIVE_axc_filename" xml:space="preserve">
<value>PAL_LIVE_USR.axc</value>
</data>
<data name="local_axc_path" xml:space="preserve">
<value>axc\</value>
</data>
<data name="network_axc_path" xml:space="preserve">
<value>\\palaxaos01\XVOL11\Link\</value>
</data>
<data name="STAGING_axc_filename" xml:space="preserve">
<value>PAL_STAGING_USR.axc</value>
</data>
<data name="TEST_axc_filename" xml:space="preserve">
<value>PAL_TEST_USR.axc</value>
</data>
</root>
-50
View File
@@ -1,50 +0,0 @@
using Serilog;
using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace wpf_ax_utility
{
public partial class UserWindow : Window
{
public UserWindow()
{
InitializeComponent();
}
private void MouseLeftDrag(object sender, MouseButtonEventArgs e)
{
DragMove();
}
private void CloseButton(object sender, RoutedEventArgs e)
{
Close();
}
private void ButtonClicked(object sender, RoutedEventArgs e)
{
Utility.AucCleaner();
string AxArgs = string.Empty;
switch (((Button)sender).Name)
{
case "LIVE":
AxArgs = @"-regConfig=axc\PAL_LIVE_USR.axc";
break;
case "TEST":
AxArgs = @"-regConfig=axc\PAL_TEST_USR.axc";
break; ;
}
Utility.AxExecution(AxArgs);
Log.Logger.Information("Running AX client with this parameter: " + AxArgs);
}
}
}
+47 -4
View File
@@ -6,6 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace wpf_ax_utility
{
@@ -14,18 +15,17 @@ namespace wpf_ax_utility
Informational,
Error
}
public static class Utility
{
public static void AxExecution(string AxArgs)
{
try
{
string AxClient = @"C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe";
if (System.IO.File.Exists(AxClient))
if (System.IO.File.Exists(Properties.Resources.Ax32_exe_filepath))
{
var p = new System.Diagnostics.Process();
p.StartInfo.FileName = AxClient;
p.StartInfo.FileName = Properties.Resources.Ax32_exe_filepath;
p.StartInfo.Arguments = AxArgs;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
@@ -69,6 +69,49 @@ namespace wpf_ax_utility
}
}
public static void AxEnvironmentSelection(object sender, RoutedEventArgs e)
{
Utility.AucCleaner();
string AxcFilePath = "";
switch (((Button)sender).Name)
{
case "LIVE":
AxcFilePath = Properties.Resources.network_axc_path + Properties.Resources.LIVE_axc_filename;
if (!File.Exists(AxcFilePath))
AxcFilePath = Properties.Resources.local_axc_path + Properties.Resources.LIVE_axc_filename;
break;
case "LIVE02":
AxcFilePath = Properties.Resources.network_axc_path + Properties.Resources.LIVE02_axc_filename;
if (!File.Exists(AxcFilePath))
AxcFilePath = Properties.Resources.local_axc_path + Properties.Resources.LIVE02_axc_filename;
break;
case "DEV":
AxcFilePath = Properties.Resources.network_axc_path + Properties.Resources.DEV_axc_filename;
if (!File.Exists(AxcFilePath))
AxcFilePath = Properties.Resources.local_axc_path + Properties.Resources.DEV_axc_filename;
break;
case "TEST":
AxcFilePath = Properties.Resources.network_axc_path + Properties.Resources.TEST_axc_filename;
if (!File.Exists(AxcFilePath))
AxcFilePath = Properties.Resources.local_axc_path + Properties.Resources.TEST_axc_filename;
break;
case "STAGING":
AxcFilePath = Properties.Resources.network_axc_path + Properties.Resources.STAGING_axc_filename;
if (!File.Exists(AxcFilePath))
AxcFilePath = Properties.Resources.local_axc_path + Properties.Resources.STAGING_axc_filename;
break;
}
var AxArgs = @"-regConfig=" + AxcFilePath;
Utility.AxExecution(AxArgs);
Log.Logger.Information("Running AX client with this parameter: " + AxArgs);
}
public static void WriteLogMessage(string message, LogMessageSeverity Severity = LogMessageSeverity.Informational, Exception exc = null)
{
try

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

+31 -11
View File
@@ -2,53 +2,73 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ApplicationIcon>axlogo.ico</ApplicationIcon>
<ApplicationIcon>res\axlogo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<None Remove="axlogo.ico" />
<None Remove="axlogo.png" />
<None Remove="rdrect1197.png" />
<None Remove="res\axlogo.png" />
<None Remove="res\pallogo.png" />
</ItemGroup>
<ItemGroup>
<Content Include="axlogo.ico">
<Content Include="res\axlogo.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="res\axlogo.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="res\pallogo.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="DevExpress.Wpf.Core" Version="22.2.4" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Sinks.Graylog" Version="2.3.0" />
</ItemGroup>
<ItemGroup>
<Resource Include="axlogo.ico">
<Resource Include="res\axlogo.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup>
<Folder Include="axc\" />
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="axc\PAL_DEVELOP_USR.axc">
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="res\axc\PAL_DEVELOP_USR.axc">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="axc\PAL_LIVE_02_USR.axc">
<None Update="res\axc\PAL_LIVE_02_USR.axc">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="axc\PAL_LIVE_USR.axc">
<None Update="res\axc\PAL_LIVE_USR.axc">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="axc\PAL_STAGING_USR.axc">
<None Update="res\axc\PAL_STAGING_USR.axc">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="axc\PAL_TEST_USR.axc">
<None Update="res\axc\PAL_TEST_USR.axc">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>