diff --git a/Jenkinsfile b/Jenkinsfile index 34b4295..7e19c49 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,15 +9,9 @@ pipeline { stage('Checkout') { agent any steps { - /* build delle SteamWare libs! */ - /* build 'SteamWare/SteamWareLib' */ - /* copio le libs...*/ - // mirroring directory x SteamWare Libs - // bat "robocopy /MIR ..\\..\\SteamWare\\SteamWareLib ..\\SteamWare\\SteamWareLib || EXIT /B 0" - /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=255']) { + withEnv(['NEXT_BUILD_NUMBER=256']) { // env.versionNumber = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.versionNumberBeta = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') diff --git a/NKC_WF/Controllers/PrintController.cs b/NKC_WF/Controllers/PrintController.cs new file mode 100644 index 0000000..25c0305 --- /dev/null +++ b/NKC_WF/Controllers/PrintController.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using Newtonsoft.Json; +using SteamWare; +using System.IO; +using System.Web; + +namespace NKC_WF.Controllers +{ + public class PrintController : ApiController + { + // GET: api/Print + public IEnumerable Get() + { + return new string[] { "value1", "value2" }; + } + + // GET: api/Print/5 + public string Get(string id) + { + return $"requested id is {id}"; + } + +#if false + // POST: api/Print + public void Post([FromBody]string value) + { + } + + // PUT: api/Print/5 + public void Put(int id, [FromBody]string value) + { + } + + // DELETE: api/Print/5 + public void Delete(int id) + { + } +#endif + + } +} diff --git a/NKC_WF/Controllers/ReportController.cs b/NKC_WF/Controllers/ReportController.cs new file mode 100644 index 0000000..b34a9f4 --- /dev/null +++ b/NKC_WF/Controllers/ReportController.cs @@ -0,0 +1,109 @@ +using Newtonsoft.Json; +using SteamWare; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web; +using System.Web.Http; + +namespace NKC_WF.Controllers +{ + public class ReportController : ApiController + { + + /// + /// Restituisce un array JSon dei files report template del progetto + /// GET: api/Report + /// + /// ID della printer associata + /// Oggetto Json in formato SteamwareSDK.filePack + public filePack Get() + { + filePack answ = new filePack(); + // procedo a deserializzare in blocco l'oggetto... + try + { + // recupero TUTTI i files della folder della printer richiesta + string dirPath = HttpContext.Current.Server.MapPath("~/Reports/"); + var fileList = fileMover.obj.elencoFilesDir(dirPath); + smallFile currFile = null; + string fileContent = ""; + foreach (var item in fileList) + { + fileContent = File.ReadAllText($"{dirPath}\\{item.Nome}"); + currFile = new smallFile() + { + fileName = item.Nome, + content = fileContent.Replace("\r\n", Environment.NewLine) + }; + answ.fileList.Add(currFile); + } + } + catch (Exception exc) + { + logger.lg.scriviLog($"Errore in get elenco reports{Environment.NewLine}{exc}"); + } + return answ; + } + + + /// + /// Restituisce oggetto JSon del files report template richeisto + /// GET: api/Report/print_01 + /// + /// nome report (SENZA estensione .rdlc) + /// Oggetto Json in formato SteamwareSDK.filePack + public filePack Get(string id) + { + filePack answ = new filePack(); + // procedo a deserializzare in blocco l'oggetto... + try + { + // recupero TUTTI i files della folder della printer richiesta + string dirPath = HttpContext.Current.Server.MapPath("~/Reports/"); + var fileList = fileMover.obj.elencoFilesDir(dirPath); + smallFile currFile = null; + string fileContent = ""; + foreach (var item in fileList) + { + // se è uguale all'id richeisto... + if (item.Nome.Replace(".rdlc", "") == id.Replace(".rdlc", "")) + { + fileContent = File.ReadAllText($"{dirPath}\\{item.Nome}"); + currFile = new smallFile() + { + fileName = item.Nome, + content = fileContent.Replace("\r\n", Environment.NewLine) + }; + answ.fileList.Add(currFile); + } + } + } + catch (Exception exc) + { + logger.lg.scriviLog($"Errore in get singolo report{Environment.NewLine}{exc}"); + } + return answ; + } + +#if false + // POST: api/Report + public void Post([FromBody]string value) + { + } + + // PUT: api/Report/5 + public void Put(int id, [FromBody]string value) + { + } + + // DELETE: api/Report/5 + public void Delete(int id) + { + } +#endif + } +} diff --git a/NKC_WF/NKC_WF.csproj b/NKC_WF/NKC_WF.csproj index 4efc123..d04efcc 100644 --- a/NKC_WF/NKC_WF.csproj +++ b/NKC_WF/NKC_WF.csproj @@ -125,8 +125,8 @@ ..\packages\StackExchange.Redis.2.0.601\lib\net461\StackExchange.Redis.dll - - ..\packages\SteamWare.3.5.2001.709\lib\net462\SteamWare.dll + + ..\packages\SteamWare.3.5.2002.716\lib\net462\SteamWare.dll ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll @@ -512,6 +512,8 @@ VersGen.cs + + Default.aspx ASPXCodeBehind diff --git a/NKC_WF/Web.config b/NKC_WF/Web.config index af313a9..a074241 100644 --- a/NKC_WF/Web.config +++ b/NKC_WF/Web.config @@ -1,4 +1,4 @@ - +