From bba1c2f62007e95c99b2b7cafb8a7b340962c769 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 7 Feb 2022 12:11:11 +0100 Subject: [PATCH] Update post-build x versione Transfer --- Core/Core.csproj | 4 +++ Core/SupportRequest.cs | 52 +++++++++++++++++++++++++++- LiMan.Transfer/LiMan.Transfer.csproj | 4 ++- LiMan.Transfer/post-build.ps1 | 32 +++++++++++++++++ LiMan.UI/LiMan.UI.csproj | 2 +- LiMan.UI/Resources/ChangeLog.html | 2 +- LiMan.UI/Resources/VersNum.txt | 2 +- LiMan.UI/Resources/manifest.xml | 2 +- 8 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 LiMan.Transfer/post-build.ps1 diff --git a/Core/Core.csproj b/Core/Core.csproj index f208d30..47c5a70 100644 --- a/Core/Core.csproj +++ b/Core/Core.csproj @@ -4,4 +4,8 @@ net5.0 + + + + diff --git a/Core/SupportRequest.cs b/Core/SupportRequest.cs index 5cdf111..1f622d1 100644 --- a/Core/SupportRequest.cs +++ b/Core/SupportRequest.cs @@ -1,5 +1,7 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -28,6 +30,54 @@ namespace Core public string MasterKey { get; set; } = ""; public string ReqBody { get; set; } = ""; + /// + /// Istanzia un nuovo ogetto richeista supporto + /// + /// Codice Applicazione (es EBW-UP) + /// Codice Impegno (es codice chiave HW) + /// Codice Cliente/Installazione + /// Email x contatto + /// Nome del richiedente/clietne + /// Tel richeidente/cliente + /// Chiave master di comunicazione da LiMan + /// Testo delal richiesta + /// Idx univoco di sublic (es x gestione utenti) + /// tipo ticket da gestire (default fileUpload) + public SupportRequest(string codApp, string codImp, string codInst, string contactEmail, string contactName, string contactPhone, string masterKey, string ReqBody, int idxSubLic = 0, TipologiaTicket tipo = TipologiaTicket.FileUpload) + { + this.CodApp = CodApp; + this.CodImp = CodImp; + this.CodInst = CodInst; + this.ContactEmail = contactEmail; + this.ContactName = contactName; + this.ContactPhone = contactPhone; + this.MasterKey = masterKey; + this.ReqBody = ReqBody; + this.idxSubLic = idxSubLic; + this.Tipo = tipo; + } + + /// + /// Effettua salvataggio su file di un oggetto richiesta file upload + /// + /// Oggetto richiesta (già istanziato) + /// Path dove salvare il file + public static bool SaveRequest(SupportRequest currReq, string filePath) + { + bool fatto = false; + try + { + string rawData = JsonConvert.SerializeObject(currReq, Formatting.Indented); + File.WriteAllText(filePath, rawData); + fatto = true; + } + catch (Exception ex) + { + Console.Write(ex.ToString()); + } + return fatto; + } + #endregion Public Properties } } \ No newline at end of file diff --git a/LiMan.Transfer/LiMan.Transfer.csproj b/LiMan.Transfer/LiMan.Transfer.csproj index ed4b282..669fdf7 100644 --- a/LiMan.Transfer/LiMan.Transfer.csproj +++ b/LiMan.Transfer/LiMan.Transfer.csproj @@ -26,5 +26,7 @@ Always - + + + diff --git a/LiMan.Transfer/post-build.ps1 b/LiMan.Transfer/post-build.ps1 new file mode 100644 index 0000000..b510ccd --- /dev/null +++ b/LiMan.Transfer/post-build.ps1 @@ -0,0 +1,32 @@ +param([string]$ProjectDir, [string]$ProjectPath); + +$FileMajMin = "..\MajMin.vers" +$FileVers = "Resources\VersNum.txt" +$FileManIn = "Resources\manifest-original.xml" +$FileManOut = "Resources\manifest.xml" +$FileCLogIn = "Resources\ChangeLog-original.html" +$FileCLogOut = "Resources\ChangeLog.html" +$MajMin = Get-Content $FileMajMin # "6.14." +$currentDate = get-date -format yyMM; +$currentTime = get-date -format ddHH; +$find = "(.|\n)*?"; +$currRelNum = $MajMin + $currentDate +"." + $currentTime +$replace = "" + $MajMin + $currentDate +"." + $currentTime + ""; +$csproj = Get-Content $ProjectPath +$csprojUpdated = $csproj -replace $find, $replace + +Set-Content -Path $ProjectPath -Value $csprojUpdated +Set-Content -Path $FileVers -Value $currRelNum + +# replace x manifest +$manData = Get-Content $FileManIn +$manData = $manData -replace "1.0.0.0", $currRelNum +$manData = $manData -replace "{{DIRNAME}}", "LiMan" +$manData = $manData -replace "{{BRANCHNAME}}", "stable/LAST" +$manData = $manData -replace "{{PACKNAME}}", "LiMan.Transfer" +Set-Content -Path $FileManOut -Value $manData + +# replace x ChangeLog +$clogData = Get-Content $FileCLogIn +$clogData = $clogData -replace "{{CURRENT-REL}}", $currRelNum +Set-Content -Path $FileCLogOut -Value $clogData diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj index d07bbc5..74bfa4b 100644 --- a/LiMan.UI/LiMan.UI.csproj +++ b/LiMan.UI/LiMan.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.1.2202.0711 + 1.1.2202.0712 LiMan.UI LiMan.UI diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html index 891b910..55b7115 100644 --- a/LiMan.UI/Resources/ChangeLog.html +++ b/LiMan.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ License Manager -

Versione: 1.1.2202.0711

+

Versione: 1.1.2202.0712


Note di rilascio: