Merge branch 'release/FixReportConfMissing01'
This commit is contained in:
@@ -6,6 +6,10 @@ using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using static NKC_WF.WebUserControls.cmp_OOIL_drawings;
|
||||
using SteamWare;
|
||||
using SteamWare.Reports;
|
||||
using System.Web;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NKC_WF.Controllers
|
||||
{
|
||||
@@ -16,13 +20,13 @@ namespace NKC_WF.Controllers
|
||||
/// GET: api/PrintQueueConf
|
||||
/// </summary>
|
||||
/// <returns>lista oggetto Json in formato SteamwareSDK.queueConf</returns>
|
||||
public List<SteamWare.Reports.reportConf> Get()
|
||||
public List<reportConf> Get()
|
||||
{
|
||||
List<SteamWare.Reports.reportConf> answ = MagData.MagDataLayer.man.reportConfJson;
|
||||
List<reportConf> answ = reportConfJson;
|
||||
// se vuoto... creo!
|
||||
if (answ.Count == 0)
|
||||
{
|
||||
SteamWare.Reports.reportConf currConf = new SteamWare.Reports.reportConf()
|
||||
reportConf currConf = new reportConf()
|
||||
{
|
||||
name = "none",
|
||||
template = "none.rdlc"
|
||||
@@ -31,5 +35,36 @@ namespace NKC_WF.Controllers
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce un array JSon x le conf dei report/template di stampa leggendo dal file
|
||||
/// </summary>
|
||||
/// <returns>lista oggetto Json in formato SteamwareSDK.templateConf</returns>
|
||||
protected List<reportConf> reportConfJson
|
||||
{
|
||||
get
|
||||
{
|
||||
List<reportConf> answ = new List<reportConf>();
|
||||
string dirPath = HttpContext.Current.Server.MapPath("~/Reports/");
|
||||
string nomeFile = "reportConf.json";
|
||||
bool fileExist = fileMover.obj.fileExist(dirPath, nomeFile);
|
||||
if (fileExist)
|
||||
{
|
||||
string rawData = File.ReadAllText($"{dirPath}\\{nomeFile}");
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = JsonConvert.DeserializeObject<List<reportConf>>(rawData);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
SteamWare.Logger.Logging.Instance.Error(exc, "Eccezione in decodifica file conf reportConfJson");
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,6 +352,7 @@
|
||||
<Content Include="App_Readme\SteamWare_demo\example-NLog.config" />
|
||||
<Content Include="App_Readme\SteamWare_demo\example-app.config" />
|
||||
<None Include="Properties\PublishProfiles\IIS04.pubxml" />
|
||||
<Content Include="Reports\reportConf.json" />
|
||||
<None Include="Scripts\jquery-3.6.0.intellisense.js" />
|
||||
<Content Include="Scripts\jquery-3.6.0.js" />
|
||||
<Content Include="Scripts\jquery-3.6.0.min.js" />
|
||||
@@ -704,6 +705,7 @@
|
||||
<Compile Include="Controllers\BatchStatsController.cs" />
|
||||
<Compile Include="Controllers\getMUSheetRevController.cs" />
|
||||
<Compile Include="Controllers\MachineStatController.cs" />
|
||||
<Compile Include="Controllers\ReportConfController.cs" />
|
||||
<Compile Include="Controllers\SheetStatsController.cs" />
|
||||
<Compile Include="Controllers\PrintQueueController.cs" />
|
||||
<Compile Include="Controllers\PrintQueueConfController.cs" />
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
[
|
||||
//{
|
||||
// "name": "docPaint",
|
||||
// "template": "Bin.rdlc"
|
||||
//},
|
||||
//{
|
||||
// "name": "docPaintPost",
|
||||
// "template": "Bin.rdlc"
|
||||
//},
|
||||
//{
|
||||
// "name": "docCart",
|
||||
// "template": "Cart.rdlc"
|
||||
//},
|
||||
//{
|
||||
// "name": "docCartIRK",
|
||||
// "template": "IRK_Kitting_List.rdlc"
|
||||
//},
|
||||
//{
|
||||
// "name": "docCartIRKSum",
|
||||
// "template": "IRK_Kitting_Group.rdlc"
|
||||
//},
|
||||
//{
|
||||
// "name": "docPart",
|
||||
// "template": "Part.rdlc"
|
||||
//},
|
||||
//{
|
||||
// "name": "docOffline",
|
||||
// "template": "Part.rdlc"
|
||||
//},
|
||||
//{
|
||||
// "name": "docOtherPart",
|
||||
// "template": "OtherPart.rdlc"
|
||||
//},
|
||||
//{
|
||||
// "name": "docCartSpecialPart",
|
||||
// "template": "SpecialParts.rdlc"
|
||||
//},
|
||||
//{
|
||||
// "name": "docStack",
|
||||
// "template": "BunkGroup.rdlc"
|
||||
//},
|
||||
//{
|
||||
// "name": "docStack",
|
||||
// "template": "BunkList.rdlc"
|
||||
//}
|
||||
]
|
||||
Reference in New Issue
Block a user