KlassenDLL im Main integriert
This commit is contained in:
107
SanSystem/BerichtGen/FrmOptions.cs
Normal file
107
SanSystem/BerichtGen/FrmOptions.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
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();
|
||||
Dongle dongle = new Dongle(60);
|
||||
Trace.WriteLine("FrmOptions: " + dongle.SyncfusionKey);
|
||||
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(dongle.SyncfusionKey);
|
||||
dongle.CleanDongle();
|
||||
|
||||
|
||||
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));
|
||||
Process process = new Process();
|
||||
process.StartInfo.FileName = "explorer";
|
||||
process.StartInfo.Arguments = pfad;
|
||||
//** Verbuggt
|
||||
FrmPDFViewer frmPDFViewer = new FrmPDFViewer(pfad);
|
||||
frmPDFViewer.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void btn_start_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenerateBericht();
|
||||
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user