Man kann jetzt einen Ausrduck erzeugen für das ausgeben einer Kalibrierliste

This commit is contained in:
Husky
2018-07-14 14:03:26 +02:00
parent f7e3042daa
commit d87c3d5971
10 changed files with 231 additions and 68 deletions

View File

@@ -3,6 +3,7 @@ using Syncfusion.DocIO.DLS;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
@@ -23,17 +24,20 @@ namespace BerichtGen
/// <param name="daten">Inhalt vom Dokument </param> /// <param name="daten">Inhalt vom Dokument </param>
/// <param name="erzeugeDoc">Ein doc datei soll erzeugt werden</param> /// <param name="erzeugeDoc">Ein doc datei soll erzeugt werden</param>
/// <param name="erzeugePDF">Ein Pdf datei soll erzeugt werden</param> /// <param name="erzeugePDF">Ein Pdf datei soll erzeugt werden</param>
public void Erzeuge(string firma, string vorlage, string savepath, Hashtable daten,List<BilderObject> bilderObjects, bool erzeugeDOC = false , bool erzeugePDF = true) public void Erzeuge(string source, string savepath, Hashtable daten,List<BilderObject> bilderObjects,DataTable tableContents, bool erzeugeDOC = false , bool erzeugePDF = true)
{ {
_listImages = new List<Image>(); if (bilderObjects != null)
foreach(BilderObject current in bilderObjects)
{ {
Image image = Image.FromFile(current.Path); _listImages = new List<Image>();
_listImages.Add(ResizeImage(image, CalculateImageSizeForDocument(image.Height, image.Width))); foreach (BilderObject current in bilderObjects)
image.Dispose(); {
Image image = Image.FromFile(current.Path);
_listImages.Add(ResizeImage(image, CalculateImageSizeForDocument(image.Height, image.Width)));
image.Dispose();
}
} }
WordDocument wordDocument = new WordDocument("./documents/JUME/liner_einbau.docx"); WordDocument wordDocument = new WordDocument(source);
string[] fieldnames = null; string[] fieldnames = null;
string[] fieldvalues = null; string[] fieldvalues = null;
@@ -66,6 +70,10 @@ namespace BerichtGen
//string[] fieldNames = new string[] { "UVImage" }; //string[] fieldNames = new string[] { "UVImage" };
//string[] fieldValues = new string[] { "test.png" }; //string[] fieldValues = new string[] { "test.png" };
if (tableContents != null)
wordDocument.MailMerge.ExecuteGroup(tableContents);
wordDocument.MailMerge.Execute(fieldnames, fieldvalues); wordDocument.MailMerge.Execute(fieldnames, fieldvalues);
wordDocument.Save("test.docx", Syncfusion.DocIO.FormatType.Docx); wordDocument.Save("test.docx", Syncfusion.DocIO.FormatType.Docx);
//wordDocument.Close(); //wordDocument.Close();

View File

@@ -6,6 +6,7 @@ using System.ComponentModel;
using System.Data; using System.Data;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
@@ -21,10 +22,12 @@ namespace BerichtGen
string firma; string firma;
string vorlage; string vorlage;
string speicherpfad; string speicherpfad;
string source;
List<BilderObject> bilderObjects; List<BilderObject> bilderObjects;
DataTable tableContent = null;
public Options(string firma, string vorlage, string speicherpfad, Hashtable grunddaten, List<BilderObject> bilderObjects) public Options(string firma, string vorlage, string speicherpfad, Hashtable grunddaten, List<BilderObject> bilderObjects, DataTable tableContent = null)
{ {
InitializeComponent(); InitializeComponent();
this.firma = firma; this.firma = firma;
@@ -32,12 +35,14 @@ namespace BerichtGen
this.speicherpfad = speicherpfad; this.speicherpfad = speicherpfad;
this.grundDaten = grunddaten; this.grundDaten = grunddaten;
this.bilderObjects = bilderObjects; this.bilderObjects = bilderObjects;
this.tableContent = tableContent;
this.source = Path.Combine("documents",firma, vorlage);
} }
void Gen() void Gen()
{ {
Bericht bericht = new Bericht(); Bericht bericht = new Bericht();
bericht.Erzeuge(firma,vorlage, speicherpfad, grundDaten,bilderObjects); bericht.Erzeuge(source, speicherpfad, grundDaten,bilderObjects,tableContent);
} }
private void btn_start_Click(object sender, EventArgs e) private void btn_start_Click(object sender, EventArgs e)

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms;
namespace SanSystem.Einstellungen namespace SanSystem.Einstellungen
{ {
@@ -10,17 +11,39 @@ namespace SanSystem.Einstellungen
{ {
public ObjecteListSetting() : base("ObjecteList") { } public ObjecteListSetting() : base("ObjecteList") { }
public override int GetWidth(DataGridViewColumn dataGridViewColumn)
{
int result = -1;
try
{
result = getConfiguration(dataGridViewColumn.HeaderText);
}
catch(Exception )
{
result = 20;
}
return result;
}
public override void SetWidth(DataGridViewColumn dataGridViewColumn)
{
setConfig(dataGridViewColumn.HeaderText, dataGridViewColumn.Width);
}
public override void InitDevValues() public override void InitDevValues()
{ {
// Hausnummer // Hausnummer
// Von punkt // Von punkt
// Bis punkt // Bis punkt
// Haltungslänge // Haltungslänge
configuration.Add("Auswahl", 20);
configuration.Add("Hausnummer", 40); configuration.Add("Hausnummer", 40);
configuration.Add("VonPunkt", 100); configuration.Add("VonPunkt", 100);
configuration.Add("BisPunkt", 100); configuration.Add("BisPunkt", 100);
configuration.Add("Haltungslaenge", 40); configuration.Add("Haltungslaenge", 40);
} }
} }
} }

View File

@@ -5,12 +5,13 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms;
namespace SanSystem.Einstellungen namespace SanSystem.Einstellungen
{ {
abstract class Settings : IDisposable abstract class Settings : IDisposable
{ {
public Dictionary<string, int> configuration = new Dictionary<string, int>(); protected Dictionary<string, int> configuration = new Dictionary<string, int>();
const string pfad = "Settings"; const string pfad = "Settings";
@@ -33,7 +34,33 @@ namespace SanSystem.Einstellungen
} }
} }
protected int getConfiguration(string keyName, int retry = 0)
{
if (retry >= 3)
throw new Exception("Fehler, zuviele versuche");
int result = -1;
if(!configuration.TryGetValue(keyName,out result))
{
configuration.Add(keyName, 20);
//return -1;
result = getConfiguration(keyName,retry++);
SaveSettings();
return result;
}
else
{
return result;
}
}
protected void setConfig(string keyName, int value)
{
configuration[keyName] = value;
}
public abstract void InitDevValues(); public abstract void InitDevValues();
public abstract int GetWidth(DataGridViewColumn dataGridViewColumn);
public abstract void SetWidth(DataGridViewColumn dataGridViewColumn);
public virtual void SaveSettings() public virtual void SaveSettings()
{ {

View File

@@ -154,6 +154,9 @@
<EmbeddedResource Include="UCSchachtanbindung.resx"> <EmbeddedResource Include="UCSchachtanbindung.resx">
<DependentUpon>UCSchachtanbindung.cs</DependentUpon> <DependentUpon>UCSchachtanbindung.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<None Include="documents\JUME\KalibrierungAuflistung.docx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="documents\JUME\liner_einbau.docx"> <None Include="documents\JUME\liner_einbau.docx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>

Binary file not shown.

View File

@@ -30,6 +30,8 @@
{ {
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.txt_ort = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.txt_bemerkung = new System.Windows.Forms.TextBox(); this.txt_bemerkung = new System.Windows.Forms.TextBox();
this.txt_objekt_name = new System.Windows.Forms.TextBox(); this.txt_objekt_name = new System.Windows.Forms.TextBox();
this.lbl_objektname = new System.Windows.Forms.Label(); this.lbl_objektname = new System.Windows.Forms.Label();
@@ -58,8 +60,6 @@
this.btn_close = new System.Windows.Forms.Button(); this.btn_close = new System.Windows.Forms.Button();
this.btn_add_san = new System.Windows.Forms.Button(); this.btn_add_san = new System.Windows.Forms.Button();
this.btn_delete = new System.Windows.Forms.Button(); this.btn_delete = new System.Windows.Forms.Button();
this.label7 = new System.Windows.Forms.Label();
this.txt_ort = new System.Windows.Forms.TextBox();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
@@ -104,15 +104,33 @@
this.tabPage1.Controls.Add(this.label2); this.tabPage1.Controls.Add(this.label2);
this.tabPage1.Controls.Add(this.label1); this.tabPage1.Controls.Add(this.label1);
this.tabPage1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tabPage1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabPage1.Location = new System.Drawing.Point(4, 34); this.tabPage1.Location = new System.Drawing.Point(4, 29);
this.tabPage1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.tabPage1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tabPage1.Name = "tabPage1"; this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); this.tabPage1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.tabPage1.Size = new System.Drawing.Size(1256, 574); this.tabPage1.Size = new System.Drawing.Size(1256, 579);
this.tabPage1.TabIndex = 0; this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Grunddaten"; this.tabPage1.Text = "Grunddaten";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// txt_ort
//
this.txt_ort.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_ort.Location = new System.Drawing.Point(745, 139);
this.txt_ort.Name = "txt_ort";
this.txt_ort.Size = new System.Drawing.Size(191, 26);
this.txt_ort.TabIndex = 28;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label7.Location = new System.Drawing.Point(584, 136);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(31, 20);
this.label7.TabIndex = 27;
this.label7.Text = "Ort";
//
// txt_bemerkung // txt_bemerkung
// //
this.txt_bemerkung.Location = new System.Drawing.Point(730, 191); this.txt_bemerkung.Location = new System.Drawing.Point(730, 191);
@@ -126,7 +144,7 @@
this.txt_objekt_name.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_objekt_name.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_objekt_name.Location = new System.Drawing.Point(192, 67); this.txt_objekt_name.Location = new System.Drawing.Point(192, 67);
this.txt_objekt_name.Name = "txt_objekt_name"; this.txt_objekt_name.Name = "txt_objekt_name";
this.txt_objekt_name.Size = new System.Drawing.Size(330, 30); this.txt_objekt_name.Size = new System.Drawing.Size(330, 26);
this.txt_objekt_name.TabIndex = 2; this.txt_objekt_name.TabIndex = 2;
// //
// lbl_objektname // lbl_objektname
@@ -135,7 +153,7 @@
this.lbl_objektname.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbl_objektname.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbl_objektname.Location = new System.Drawing.Point(9, 70); this.lbl_objektname.Location = new System.Drawing.Point(9, 70);
this.lbl_objektname.Name = "lbl_objektname"; this.lbl_objektname.Name = "lbl_objektname";
this.lbl_objektname.Size = new System.Drawing.Size(118, 25); this.lbl_objektname.Size = new System.Drawing.Size(95, 20);
this.lbl_objektname.TabIndex = 25; this.lbl_objektname.TabIndex = 25;
this.lbl_objektname.Text = "Objektname"; this.lbl_objektname.Text = "Objektname";
// //
@@ -180,7 +198,7 @@
"Ziegelwerk"}); "Ziegelwerk"});
this.cb_material.Location = new System.Drawing.Point(192, 252); this.cb_material.Location = new System.Drawing.Point(192, 252);
this.cb_material.Name = "cb_material"; this.cb_material.Name = "cb_material";
this.cb_material.Size = new System.Drawing.Size(323, 33); this.cb_material.Size = new System.Drawing.Size(323, 28);
this.cb_material.TabIndex = 6; this.cb_material.TabIndex = 6;
// //
// groupBox2 // groupBox2
@@ -202,7 +220,7 @@
this.txt_haltungslaenge.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_haltungslaenge.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_haltungslaenge.Location = new System.Drawing.Point(188, 21); this.txt_haltungslaenge.Location = new System.Drawing.Point(188, 21);
this.txt_haltungslaenge.Name = "txt_haltungslaenge"; this.txt_haltungslaenge.Name = "txt_haltungslaenge";
this.txt_haltungslaenge.Size = new System.Drawing.Size(136, 30); this.txt_haltungslaenge.Size = new System.Drawing.Size(136, 26);
this.txt_haltungslaenge.TabIndex = 11; this.txt_haltungslaenge.TabIndex = 11;
// //
// txt_laenge_schacht // txt_laenge_schacht
@@ -210,7 +228,7 @@
this.txt_laenge_schacht.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txt_laenge_schacht.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_laenge_schacht.Location = new System.Drawing.Point(188, 112); this.txt_laenge_schacht.Location = new System.Drawing.Point(188, 112);
this.txt_laenge_schacht.Name = "txt_laenge_schacht"; this.txt_laenge_schacht.Name = "txt_laenge_schacht";
this.txt_laenge_schacht.Size = new System.Drawing.Size(136, 30); this.txt_laenge_schacht.Size = new System.Drawing.Size(136, 26);
this.txt_laenge_schacht.TabIndex = 13; this.txt_laenge_schacht.TabIndex = 13;
// //
// label21 // label21
@@ -219,7 +237,7 @@
this.label21.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label21.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label21.Location = new System.Drawing.Point(6, 114); this.label21.Location = new System.Drawing.Point(6, 114);
this.label21.Name = "label21"; this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(132, 25); this.label21.Size = new System.Drawing.Size(107, 20);
this.label21.TabIndex = 21; this.label21.TabIndex = 21;
this.label21.Text = "Schachtlänge"; this.label21.Text = "Schachtlänge";
// //
@@ -229,7 +247,7 @@
this.checkBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.checkBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.checkBox1.Location = new System.Drawing.Point(9, 75); this.checkBox1.Location = new System.Drawing.Point(9, 75);
this.checkBox1.Name = "checkBox1"; this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(210, 29); this.checkBox1.Size = new System.Drawing.Size(172, 24);
this.checkBox1.TabIndex = 12; this.checkBox1.TabIndex = 12;
this.checkBox1.Text = "Geschlossene Ende"; this.checkBox1.Text = "Geschlossene Ende";
this.checkBox1.UseVisualStyleBackColor = true; this.checkBox1.UseVisualStyleBackColor = true;
@@ -241,7 +259,7 @@
this.label6.Location = new System.Drawing.Point(5, 26); this.label6.Location = new System.Drawing.Point(5, 26);
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label6.Name = "label6"; this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(137, 25); this.label6.Size = new System.Drawing.Size(112, 20);
this.label6.TabIndex = 5; this.label6.TabIndex = 5;
this.label6.Text = "Haltungslänge"; this.label6.Text = "Haltungslänge";
// //
@@ -254,7 +272,7 @@
this.dt_haltunggemessen_datum.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.dt_haltunggemessen_datum.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.dt_haltunggemessen_datum.Name = "dt_haltunggemessen_datum"; this.dt_haltunggemessen_datum.Name = "dt_haltunggemessen_datum";
this.dt_haltunggemessen_datum.RightToLeft = System.Windows.Forms.RightToLeft.No; this.dt_haltunggemessen_datum.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.dt_haltunggemessen_datum.Size = new System.Drawing.Size(354, 30); this.dt_haltunggemessen_datum.Size = new System.Drawing.Size(354, 26);
this.dt_haltunggemessen_datum.TabIndex = 10; this.dt_haltunggemessen_datum.TabIndex = 10;
// //
// label20 // label20
@@ -264,7 +282,7 @@
this.label20.Location = new System.Drawing.Point(8, 300); this.label20.Location = new System.Drawing.Point(8, 300);
this.label20.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label20.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label20.Name = "label20"; this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(265, 25); this.label20.Size = new System.Drawing.Size(216, 20);
this.label20.TabIndex = 16; this.label20.TabIndex = 16;
this.label20.Text = "Haltungslänge gemessen am"; this.label20.Text = "Haltungslänge gemessen am";
// //
@@ -274,7 +292,7 @@
this.txt_hausnummer.Location = new System.Drawing.Point(758, 85); this.txt_hausnummer.Location = new System.Drawing.Point(758, 85);
this.txt_hausnummer.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_hausnummer.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txt_hausnummer.Name = "txt_hausnummer"; this.txt_hausnummer.Name = "txt_hausnummer";
this.txt_hausnummer.Size = new System.Drawing.Size(148, 30); this.txt_hausnummer.Size = new System.Drawing.Size(148, 26);
this.txt_hausnummer.TabIndex = 8; this.txt_hausnummer.TabIndex = 8;
// //
// txt_strasse // txt_strasse
@@ -283,7 +301,7 @@
this.txt_strasse.Location = new System.Drawing.Point(758, 35); this.txt_strasse.Location = new System.Drawing.Point(758, 35);
this.txt_strasse.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_strasse.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txt_strasse.Name = "txt_strasse"; this.txt_strasse.Name = "txt_strasse";
this.txt_strasse.Size = new System.Drawing.Size(320, 30); this.txt_strasse.Size = new System.Drawing.Size(320, 26);
this.txt_strasse.TabIndex = 7; this.txt_strasse.TabIndex = 7;
// //
// label19 // label19
@@ -293,7 +311,7 @@
this.label19.Location = new System.Drawing.Point(560, 89); this.label19.Location = new System.Drawing.Point(560, 89);
this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label19.Name = "label19"; this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(129, 25); this.label19.Size = new System.Drawing.Size(105, 20);
this.label19.TabIndex = 13; this.label19.TabIndex = 13;
this.label19.Text = "Hausnummer"; this.label19.Text = "Hausnummer";
// //
@@ -304,7 +322,7 @@
this.label18.Location = new System.Drawing.Point(560, 40); this.label18.Location = new System.Drawing.Point(560, 40);
this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label18.Name = "label18"; this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(79, 25); this.label18.Size = new System.Drawing.Size(64, 20);
this.label18.TabIndex = 12; this.label18.TabIndex = 12;
this.label18.Text = "Strasse"; this.label18.Text = "Strasse";
// //
@@ -314,7 +332,7 @@
this.txt_dn.Location = new System.Drawing.Point(192, 201); this.txt_dn.Location = new System.Drawing.Point(192, 201);
this.txt_dn.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_dn.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txt_dn.Name = "txt_dn"; this.txt_dn.Name = "txt_dn";
this.txt_dn.Size = new System.Drawing.Size(330, 30); this.txt_dn.Size = new System.Drawing.Size(330, 26);
this.txt_dn.TabIndex = 5; this.txt_dn.TabIndex = 5;
// //
// txt_punkt_bis // txt_punkt_bis
@@ -323,7 +341,7 @@
this.txt_punkt_bis.Location = new System.Drawing.Point(192, 153); this.txt_punkt_bis.Location = new System.Drawing.Point(192, 153);
this.txt_punkt_bis.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_punkt_bis.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txt_punkt_bis.Name = "txt_punkt_bis"; this.txt_punkt_bis.Name = "txt_punkt_bis";
this.txt_punkt_bis.Size = new System.Drawing.Size(330, 30); this.txt_punkt_bis.Size = new System.Drawing.Size(330, 26);
this.txt_punkt_bis.TabIndex = 4; this.txt_punkt_bis.TabIndex = 4;
// //
// txt_punkt_von // txt_punkt_von
@@ -332,7 +350,7 @@
this.txt_punkt_von.Location = new System.Drawing.Point(192, 107); this.txt_punkt_von.Location = new System.Drawing.Point(192, 107);
this.txt_punkt_von.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_punkt_von.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txt_punkt_von.Name = "txt_punkt_von"; this.txt_punkt_von.Name = "txt_punkt_von";
this.txt_punkt_von.Size = new System.Drawing.Size(330, 30); this.txt_punkt_von.Size = new System.Drawing.Size(330, 26);
this.txt_punkt_von.TabIndex = 3; this.txt_punkt_von.TabIndex = 3;
// //
// txt_pro_nr // txt_pro_nr
@@ -341,7 +359,7 @@
this.txt_pro_nr.Location = new System.Drawing.Point(192, 31); this.txt_pro_nr.Location = new System.Drawing.Point(192, 31);
this.txt_pro_nr.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.txt_pro_nr.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txt_pro_nr.Name = "txt_pro_nr"; this.txt_pro_nr.Name = "txt_pro_nr";
this.txt_pro_nr.Size = new System.Drawing.Size(330, 30); this.txt_pro_nr.Size = new System.Drawing.Size(330, 26);
this.txt_pro_nr.TabIndex = 1; this.txt_pro_nr.TabIndex = 1;
// //
// label5 // label5
@@ -351,7 +369,7 @@
this.label5.Location = new System.Drawing.Point(9, 255); this.label5.Location = new System.Drawing.Point(9, 255);
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label5.Name = "label5"; this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(81, 25); this.label5.Size = new System.Drawing.Size(65, 20);
this.label5.TabIndex = 4; this.label5.TabIndex = 4;
this.label5.Text = "Material"; this.label5.Text = "Material";
// //
@@ -362,7 +380,7 @@
this.label4.Location = new System.Drawing.Point(9, 204); this.label4.Location = new System.Drawing.Point(9, 204);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(128, 25); this.label4.Size = new System.Drawing.Size(104, 20);
this.label4.TabIndex = 3; this.label4.TabIndex = 3;
this.label4.Text = "Durchmesser"; this.label4.Text = "Durchmesser";
// //
@@ -373,7 +391,7 @@
this.label3.Location = new System.Drawing.Point(9, 156); this.label3.Location = new System.Drawing.Point(9, 156);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(94, 25); this.label3.Size = new System.Drawing.Size(76, 20);
this.label3.TabIndex = 2; this.label3.TabIndex = 2;
this.label3.Text = "Bis Punkt"; this.label3.Text = "Bis Punkt";
// //
@@ -384,7 +402,7 @@
this.label2.Location = new System.Drawing.Point(9, 110); this.label2.Location = new System.Drawing.Point(9, 110);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(103, 25); this.label2.Size = new System.Drawing.Size(83, 20);
this.label2.TabIndex = 1; this.label2.TabIndex = 1;
this.label2.Text = "Von Punkt"; this.label2.Text = "Von Punkt";
// //
@@ -395,7 +413,7 @@
this.label1.Location = new System.Drawing.Point(9, 35); this.label1.Location = new System.Drawing.Point(9, 35);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(143, 25); this.label1.Size = new System.Drawing.Size(116, 20);
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
this.label1.Text = "Projektnummer"; this.label1.Text = "Projektnummer";
// //
@@ -431,27 +449,9 @@
this.btn_delete.UseVisualStyleBackColor = true; this.btn_delete.UseVisualStyleBackColor = true;
this.btn_delete.Click += new System.EventHandler(this.btn_delete_Click); this.btn_delete.Click += new System.EventHandler(this.btn_delete_Click);
// //
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label7.Location = new System.Drawing.Point(584, 136);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(39, 25);
this.label7.TabIndex = 27;
this.label7.Text = "Ort";
//
// txt_ort
//
this.txt_ort.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_ort.Location = new System.Drawing.Point(745, 139);
this.txt_ort.Name = "txt_ort";
this.txt_ort.Size = new System.Drawing.Size(191, 30);
this.txt_ort.TabIndex = 28;
//
// frmObjektEdit // frmObjektEdit
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true; this.AutoSize = true;
this.ClientSize = new System.Drawing.Size(1290, 702); this.ClientSize = new System.Drawing.Size(1290, 702);
@@ -464,7 +464,7 @@
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "frmObjektEdit"; this.Name = "frmObjektEdit";
this.Text = "FrmObjektEdit"; this.Text = "Editieren";
this.Load += new System.EventHandler(this.frmObjektEdit_Load); this.Load += new System.EventHandler(this.frmObjektEdit_Load);
this.tabControl1.ResumeLayout(false); this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);

View File

@@ -47,6 +47,8 @@
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.lbl_grounddata = new System.Windows.Forms.Label(); this.lbl_grounddata = new System.Windows.Forms.Label();
this.gb_error_messages = new System.Windows.Forms.GroupBox(); this.gb_error_messages = new System.Windows.Forms.GroupBox();
this.btn_search = new System.Windows.Forms.Button();
this.btn_make_ausdruck = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dGObjekte)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dGObjekte)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.strasseBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.strasseBindingSource)).BeginInit();
this.gb_error_messages.SuspendLayout(); this.gb_error_messages.SuspendLayout();
@@ -222,11 +224,32 @@
this.gb_error_messages.TabStop = false; this.gb_error_messages.TabStop = false;
this.gb_error_messages.Text = "error_messages"; this.gb_error_messages.Text = "error_messages";
// //
// btn_search
//
this.btn_search.Location = new System.Drawing.Point(640, 214);
this.btn_search.Name = "btn_search";
this.btn_search.Size = new System.Drawing.Size(119, 101);
this.btn_search.TabIndex = 17;
this.btn_search.Text = "Suchen";
this.btn_search.UseVisualStyleBackColor = true;
//
// btn_make_ausdruck
//
this.btn_make_ausdruck.Location = new System.Drawing.Point(780, 222);
this.btn_make_ausdruck.Name = "btn_make_ausdruck";
this.btn_make_ausdruck.Size = new System.Drawing.Size(84, 92);
this.btn_make_ausdruck.TabIndex = 18;
this.btn_make_ausdruck.Text = "Ausdruck für Pregnieren";
this.btn_make_ausdruck.UseVisualStyleBackColor = true;
this.btn_make_ausdruck.Click += new System.EventHandler(this.btn_make_ausdruck_Click);
//
// frmObjekteList // frmObjekteList
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(879, 338); this.ClientSize = new System.Drawing.Size(879, 338);
this.Controls.Add(this.btn_make_ausdruck);
this.Controls.Add(this.btn_search);
this.Controls.Add(this.gb_error_messages); this.Controls.Add(this.gb_error_messages);
this.Controls.Add(this.txt_ort); this.Controls.Add(this.txt_ort);
this.Controls.Add(this.lbl_ort); this.Controls.Add(this.lbl_ort);
@@ -243,7 +266,7 @@
this.Margin = new System.Windows.Forms.Padding(2); this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "frmObjekteList"; this.Name = "frmObjekteList";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "frmObjekteList"; this.Text = "Objekte List";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmObjekteList_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmObjekteList_FormClosing);
this.Load += new System.EventHandler(this.frmObjekteList_Load); this.Load += new System.EventHandler(this.frmObjekteList_Load);
((System.ComponentModel.ISupportInitialize)(this.dGObjekte)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dGObjekte)).EndInit();
@@ -275,5 +298,7 @@
private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label lbl_grounddata; private System.Windows.Forms.Label lbl_grounddata;
private System.Windows.Forms.GroupBox gb_error_messages; private System.Windows.Forms.GroupBox gb_error_messages;
private System.Windows.Forms.Button btn_search;
private System.Windows.Forms.Button btn_make_ausdruck;
} }
} }

View File

@@ -2,6 +2,7 @@
using KlassenBIB; using KlassenBIB;
using SanSystem.Einstellungen; using SanSystem.Einstellungen;
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
@@ -22,6 +23,12 @@ namespace SanSystem
private void loadObjekte(string streetname) private void loadObjekte(string streetname)
{ {
DataGridViewCheckBoxColumn checkBoxColumn = new DataGridViewCheckBoxColumn();
checkBoxColumn.Name = "Auswahl";
checkBoxColumn.HeaderText = "Auswahl";
//checkBoxColumn.Width = objecteListSetting.configuration["Auswahl"];
dGObjekte.Columns.Add(checkBoxColumn);
dGObjekte.DataSource = null; dGObjekte.DataSource = null;
inspektionsobjekte = Datenbank.Instance.loadedProjekt.Objekte.FindAll(x => x.StrasseName.Equals(streetname)); inspektionsobjekte = Datenbank.Instance.loadedProjekt.Objekte.FindAll(x => x.StrasseName.Equals(streetname));
@@ -195,10 +202,15 @@ namespace SanSystem
dGObjekte.Columns["Haltunggemessen"].Visible = false; dGObjekte.Columns["Haltunggemessen"].Visible = false;
dGObjekte.Columns["Bemerkung"].Visible = false; dGObjekte.Columns["Bemerkung"].Visible = false;
dGObjekte.Columns["Hausnummer"].Width = objecteListSetting.configuration["Hausnummer"];
dGObjekte.Columns["VonPunkt"].Width = objecteListSetting.configuration["VonPunkt"];
dGObjekte.Columns["BisPunkt"].Width = objecteListSetting.configuration["BisPunkt"]; dGObjekte.Columns["Auswahl"].Width = objecteListSetting.GetWidth(dGObjekte.Columns["Auswahl"]); // objecteListSetting.configuration["Auswahl"];
dGObjekte.Columns["Haltungslaenge"].Width = objecteListSetting.configuration["Haltungslaenge"]; dGObjekte.Columns["Hausnummer"].Width = objecteListSetting.GetWidth(dGObjekte.Columns["Hausnummer"]);//objecteListSetting.configuration["Hausnummer"];
dGObjekte.Columns["VonPunkt"].Width = objecteListSetting.GetWidth(dGObjekte.Columns["VonPunkt"]);//objecteListSetting.configuration["VonPunkt"];
dGObjekte.Columns["BisPunkt"].Width = objecteListSetting.GetWidth(dGObjekte.Columns["BisPunkt"]);// objecteListSetting.configuration["BisPunkt"];
dGObjekte.Columns["Haltungslaenge"].Width = objecteListSetting.GetWidth(dGObjekte.Columns["Haltungslaenge"]); //objecteListSetting.configuration["Haltungslaenge"];
//dGObjekte.Columns["Sanierung"].Visible = false; //dGObjekte.Columns["Sanierung"].Visible = false;
} }
@@ -209,11 +221,71 @@ namespace SanSystem
private void frmObjekteList_FormClosing(object sender, FormClosingEventArgs e) private void frmObjekteList_FormClosing(object sender, FormClosingEventArgs e)
{ {
objecteListSetting.configuration["Hausnummer"] = dGObjekte.Columns["Hausnummer"].Width; objecteListSetting.SetWidth(dGObjekte.Columns["Hausnummer"]);
objecteListSetting.configuration["VonPunkt"] = dGObjekte.Columns["VonPunkt"].Width; objecteListSetting.SetWidth(dGObjekte.Columns["VonPunkt"]);
objecteListSetting.configuration["BisPunkt"] = dGObjekte.Columns["BisPunkt"].Width; objecteListSetting.SetWidth(dGObjekte.Columns["BisPunkt"]);
objecteListSetting.configuration["Haltungslaenge"] = dGObjekte.Columns["Haltungslaenge"].Width; objecteListSetting.SetWidth(dGObjekte.Columns["Haltungslaenge"]);
objecteListSetting.SetWidth(dGObjekte.Columns["Auswahl"]);
objecteListSetting.SaveSettings(); objecteListSetting.SaveSettings();
}
private void btn_make_ausdruck_Click(object sender, EventArgs e)
{
List<Inspektionsobjekt> ausdruck = new List<Inspektionsobjekt>();
DataGridViewCheckBoxCell checkBoxCell = null;
foreach(DataGridViewRow dr in dGObjekte.Rows)
{
checkBoxCell = (DataGridViewCheckBoxCell)dr.Cells["Auswahl"];
if (checkBoxCell == null) break;
if (checkBoxCell.Value == null) continue;
if ((bool)checkBoxCell.Value) ausdruck.Add((dr.DataBoundItem as Inspektionsobjekt));
}
if (ausdruck.Count <= 0) return;
Hashtable grundDaten = new Hashtable()
{
{"Ausdruck_datum","" },
{"Strasse","" },
{"Ort","" }
};
grundDaten["Ausdruck_datum"] = DateTime.Now.ToLongDateString();
grundDaten["Strasse"] = txt_strasse.Text;
grundDaten["Ort"] = txt_ort.Text;
DataTable linereintraege = getLinerTable();
foreach(Inspektionsobjekt obj in ausdruck)
{
DataRow dr = linereintraege.NewRow();
dr["hausnummer"] = obj.Hausnummer;
dr["liner_laenge"] = obj.Haltungslaenge;
dr["schacht_laenge"] = obj.Schachtlaenge;
dr["bemerkung"] = obj.Bemerkung;
linereintraege.Rows.Add(dr);
}
BerichtGen.Options options = new BerichtGen.Options("JUME", "KalibrierungAuflistung.docx", "", grundDaten, null, linereintraege);
options.ShowDialog();
}
private static DataTable getLinerTable()
{
DataTable dataTable = new DataTable("Liner");
DataColumn dataColumn = new DataColumn("hausnummer") { MaxLength = 80 };
dataTable.Columns.Add(dataColumn);
dataColumn = new DataColumn("liner_laenge") { MaxLength = 50 };
dataTable.Columns.Add(dataColumn);
dataColumn = new DataColumn("schacht_laenge") { MaxLength = 50 };
dataTable.Columns.Add(dataColumn);
dataColumn = new DataColumn("bemerkung") { MaxLength = 255 };
dataTable.Columns.Add(dataColumn);
return dataTable;
} }
} }
} }

View File

@@ -67,7 +67,7 @@
this.Controls.Add(this.lst_strassen); this.Controls.Add(this.lst_strassen);
this.Margin = new System.Windows.Forms.Padding(2); this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "frmStrassenList"; this.Name = "frmStrassenList";
this.Text = "frmStrassenList"; this.Text = "Strassen";
this.Load += new System.EventHandler(this.frmStrassenList_Load); this.Load += new System.EventHandler(this.frmStrassenList_Load);
this.ResumeLayout(false); this.ResumeLayout(false);