Ok demo mode...
This commit is contained in:
+2
-2
@@ -170,10 +170,10 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="reportPrinter.cs" />
|
||||
<Compile Include="utils.cs" />
|
||||
<EmbeddedResource Include="demo\DemoA4.rdlc">
|
||||
<EmbeddedResource Include="reports\DemoA4.rdlc">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="demo\DemoLetter.rdlc">
|
||||
<EmbeddedResource Include="reports\DemoLetter.rdlc">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
|
||||
+57
-1
@@ -38,7 +38,14 @@ namespace LPA
|
||||
/// <summary>
|
||||
/// File conf x setup code
|
||||
/// </summary>
|
||||
protected string qSetFilePath = "queueSetup.json";
|
||||
protected string qSetFilePath
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = demoMode ? "queueSetupDemo.json" : "queueSetup.json";
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Configurazione CORRENTE delle code di stampa (coda --> printer disponibile)
|
||||
/// </summary>
|
||||
@@ -462,7 +469,55 @@ namespace LPA
|
||||
/// <param name="e"></param>
|
||||
private void printDemoToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
string rawData = "";
|
||||
string filePath = "";
|
||||
// leggo da file locale e chiamo procedura di stampa!
|
||||
if (demoMode)
|
||||
{
|
||||
// se ho stampe in coda --> verifico code gestite
|
||||
foreach (var coda in queueSetupConf)
|
||||
{
|
||||
filePath = $"{baseDir}demo\\{coda.Key}.json";
|
||||
rawData = File.ReadAllText(filePath);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
// deserializzo
|
||||
List<reportData> report2print = JsonConvert.DeserializeObject<List<reportData>>(rawData);
|
||||
if (report2print != null)
|
||||
{
|
||||
// aggiorno contatore...
|
||||
coda.Value.NumWaiting = report2print.Count;
|
||||
// verifico sia RUNNING...
|
||||
if (coda.Value.isRunning)
|
||||
{
|
||||
// verifico non ci sia veto print..
|
||||
DateTime adesso = DateTime.Now;
|
||||
if (vetoPrint < adesso)
|
||||
{
|
||||
vetoPrint = adesso.AddSeconds(300);
|
||||
foreach (var item in report2print)
|
||||
{
|
||||
reportPrinter rPrint = new reportPrinter();
|
||||
bool fatto = false;
|
||||
bool fattoPdf = false;
|
||||
// se ho almeno 1 stampa --> lancio!
|
||||
queueConf confCoda = listQueue.Find(conf => conf.name == coda.Key);
|
||||
if (confCoda != null)
|
||||
{
|
||||
fatto = rPrint.printReport(confCoda.template, confCoda.rdsName, localReportPath, coda.Value.Printer, item.rdsTable, confCoda.deviceInfoParam, true);
|
||||
}
|
||||
}
|
||||
vetoPrint = adesso;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void btnDemo_Click(object sender, EventArgs e)
|
||||
@@ -480,6 +535,7 @@ namespace LPA
|
||||
btnDemo.Text = demoMode ? "Exit Demo" : "Demo";
|
||||
setupButtons();
|
||||
// aggiorno code...
|
||||
setupQueuePrinter();
|
||||
refreshQueueAvail();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user