Files
Kanalsanierungsverwaltung/BerichtGen/FrmOptions.cs
Husky 2ee98ea823 PDF viewer hinzugefügt
Die dateien können nun als PDF und oder als Doc gespeichert werden,  man kann nach den erzeugen, denn PDF dann anzeigen lassen
2018-07-14 14:34:19 +02:00

71 lines
2.1 KiB
C#

using SanShared;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
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
{
public partial class FrmOptions : Form
{
Thread generateProtokollThread;
Hashtable grundDaten;
string firma;
string vorlage;
string speicherpfad;
string source;
string filename;
List<BilderObject> bilderObjects;
DataTable tableContent = null;
public FrmOptions(string firma, string vorlage, string speicherpfad,string filename, Hashtable grunddaten, List<BilderObject> bilderObjects, DataTable tableContent = null)
{
InitializeComponent();
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;
}
void Gen()
{
Bericht bericht = new Bericht();
bericht.Erzeuge(source, speicherpfad,filename, grundDaten, bilderObjects, tableContent,cb_doc.Checked,cb_pdf.Checked);
}
private void btn_start_Click(object sender, EventArgs e)
{
generateProtokollThread = new Thread(Gen);
generateProtokollThread.IsBackground = true;
generateProtokollThread.Start();
while (generateProtokollThread.IsAlive)
{
}
if (rb_yes.Checked && cb_pdf.Checked)
{
string pfad = Path.Combine(speicherpfad, string.Format("{0}.pdf", filename));
FrmPDFViewer frmPDFViewer = new FrmPDFViewer(pfad);
frmPDFViewer.ShowDialog();
}
this.Close();
}
}
}