101 lines
2.9 KiB
C#
101 lines
2.9 KiB
C#
using SanShared;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Diagnostics;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace BerichtGen
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public partial class FrmOptions : Form
|
|
{
|
|
Thread generateProtokollThread;
|
|
Hashtable grundDaten;
|
|
string firma;
|
|
string vorlage;
|
|
string speicherpfad;
|
|
string source;
|
|
string filename;
|
|
bool hidden = false;
|
|
List<BilderObject> bilderObjects;
|
|
|
|
DataTable tableContent = null;
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="firma"></param>
|
|
/// <param name="vorlage"></param>
|
|
/// <param name="speicherpfad"></param>
|
|
/// <param name="filename"></param>
|
|
/// <param name="grunddaten"></param>
|
|
/// <param name="bilderObjects"></param>
|
|
/// <param name="tableContent"></param>
|
|
public FrmOptions(string firma, string vorlage, string speicherpfad, string filename, Hashtable grunddaten, List<BilderObject> bilderObjects, DataTable tableContent = null, bool hidden = false)
|
|
{
|
|
|
|
InitializeComponent();
|
|
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MTU0ODAyQDMxMzcyZTMzMmUzMFNsK0VsVStJUHA5NzFMQUphWTRBNmcvWU5xdGpsUmpkN0h4UGVMM083RFE9");
|
|
|
|
|
|
this.firma = firma;
|
|
this.vorlage = vorlage;
|
|
this.speicherpfad = speicherpfad;
|
|
this.grundDaten = grunddaten;
|
|
this.bilderObjects = bilderObjects;
|
|
this.tableContent = tableContent;
|
|
this.source = Path.Combine("documents", firma, vorlage);
|
|
this.filename = filename;
|
|
this.hidden = hidden;
|
|
if(hidden)
|
|
{
|
|
GenerateBericht();
|
|
}
|
|
|
|
}
|
|
|
|
void Gen()
|
|
{
|
|
|
|
Bericht bericht = new Bericht();
|
|
bericht.Erzeuge(source, speicherpfad,filename, grundDaten, bilderObjects, tableContent,cb_doc.Checked,cb_pdf.Checked);
|
|
}
|
|
|
|
private void GenerateBericht()
|
|
{
|
|
generateProtokollThread = new Thread(Gen);
|
|
generateProtokollThread.IsBackground = true;
|
|
generateProtokollThread.Start();
|
|
|
|
while (generateProtokollThread.IsAlive)
|
|
{
|
|
|
|
}
|
|
|
|
if (rb_yes.Checked && cb_pdf.Checked && !hidden)
|
|
{
|
|
string pfad = Path.Combine(speicherpfad, string.Format("{0}.pdf", filename));
|
|
FrmPDFViewer frmPDFViewer = new FrmPDFViewer(pfad);
|
|
frmPDFViewer.ShowDialog();
|
|
}
|
|
}
|
|
|
|
private void btn_start_Click(object sender, EventArgs e)
|
|
{
|
|
GenerateBericht();
|
|
|
|
this.Close();
|
|
}
|
|
}
|
|
}
|