From d87c3d5971822057f313070c13e802da1f13b955 Mon Sep 17 00:00:00 2001 From: Husky Date: Sat, 14 Jul 2018 14:03:26 +0200 Subject: [PATCH] =?UTF-8?q?Man=20kann=20jetzt=20einen=20Ausrduck=20erzeuge?= =?UTF-8?q?n=20f=C3=BCr=20das=20ausgeben=20einer=20Kalibrierliste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BerichtGen/Bericht.cs | 22 ++-- BerichtGen/Options.cs | 9 +- SanSystem/Einstellungen/ObjecteListSetting.cs | 25 ++++- SanSystem/Einstellungen/Settings.cs | 29 +++++- SanSystem/SanSystem.csproj | 3 + .../JUME/KalibrierungAuflistung.docx | Bin 0 -> 12729 bytes SanSystem/frmObjektEdit.Designer.cs | 94 +++++++++--------- SanSystem/frmObjekteList.Designer.cs | 27 ++++- SanSystem/frmObjekteList.cs | 88 ++++++++++++++-- SanSystem/frmStrassenList.Designer.cs | 2 +- 10 files changed, 231 insertions(+), 68 deletions(-) create mode 100644 SanSystem/documents/JUME/KalibrierungAuflistung.docx diff --git a/BerichtGen/Bericht.cs b/BerichtGen/Bericht.cs index 47bb42a..e7a09d2 100644 --- a/BerichtGen/Bericht.cs +++ b/BerichtGen/Bericht.cs @@ -3,6 +3,7 @@ using Syncfusion.DocIO.DLS; using System; using System.Collections; using System.Collections.Generic; +using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; @@ -23,17 +24,20 @@ namespace BerichtGen /// Inhalt vom Dokument /// Ein doc datei soll erzeugt werden /// Ein Pdf datei soll erzeugt werden - public void Erzeuge(string firma, string vorlage, string savepath, Hashtable daten,List bilderObjects, bool erzeugeDOC = false , bool erzeugePDF = true) + public void Erzeuge(string source, string savepath, Hashtable daten,List bilderObjects,DataTable tableContents, bool erzeugeDOC = false , bool erzeugePDF = true) { - _listImages = new List(); - foreach(BilderObject current in bilderObjects) + if (bilderObjects != null) { - Image image = Image.FromFile(current.Path); - _listImages.Add(ResizeImage(image, CalculateImageSizeForDocument(image.Height, image.Width))); - image.Dispose(); + _listImages = new List(); + foreach (BilderObject current in bilderObjects) + { + 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[] fieldvalues = null; @@ -66,6 +70,10 @@ namespace BerichtGen //string[] fieldNames = new string[] { "UVImage" }; //string[] fieldValues = new string[] { "test.png" }; + + if (tableContents != null) + wordDocument.MailMerge.ExecuteGroup(tableContents); + wordDocument.MailMerge.Execute(fieldnames, fieldvalues); wordDocument.Save("test.docx", Syncfusion.DocIO.FormatType.Docx); //wordDocument.Close(); diff --git a/BerichtGen/Options.cs b/BerichtGen/Options.cs index 2948f62..bda280b 100644 --- a/BerichtGen/Options.cs +++ b/BerichtGen/Options.cs @@ -6,6 +6,7 @@ using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; +using System.IO; using System.Linq; using System.Text; using System.Threading; @@ -21,10 +22,12 @@ namespace BerichtGen string firma; string vorlage; string speicherpfad; + string source; List bilderObjects; + DataTable tableContent = null; - public Options(string firma, string vorlage, string speicherpfad, Hashtable grunddaten, List bilderObjects) + public Options(string firma, string vorlage, string speicherpfad, Hashtable grunddaten, List bilderObjects, DataTable tableContent = null) { InitializeComponent(); this.firma = firma; @@ -32,12 +35,14 @@ namespace BerichtGen this.speicherpfad = speicherpfad; this.grundDaten = grunddaten; this.bilderObjects = bilderObjects; + this.tableContent = tableContent; + this.source = Path.Combine("documents",firma, vorlage); } void Gen() { 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) diff --git a/SanSystem/Einstellungen/ObjecteListSetting.cs b/SanSystem/Einstellungen/ObjecteListSetting.cs index 0b603fd..60f329b 100644 --- a/SanSystem/Einstellungen/ObjecteListSetting.cs +++ b/SanSystem/Einstellungen/ObjecteListSetting.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Forms; namespace SanSystem.Einstellungen { @@ -10,17 +11,39 @@ namespace SanSystem.Einstellungen { 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() { // Hausnummer // Von punkt // Bis punkt // Haltungslänge - + configuration.Add("Auswahl", 20); configuration.Add("Hausnummer", 40); configuration.Add("VonPunkt", 100); configuration.Add("BisPunkt", 100); configuration.Add("Haltungslaenge", 40); } + + } } diff --git a/SanSystem/Einstellungen/Settings.cs b/SanSystem/Einstellungen/Settings.cs index 2a5fce4..d6b6a42 100644 --- a/SanSystem/Einstellungen/Settings.cs +++ b/SanSystem/Einstellungen/Settings.cs @@ -5,12 +5,13 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Forms; namespace SanSystem.Einstellungen { abstract class Settings : IDisposable { - public Dictionary configuration = new Dictionary(); + protected Dictionary configuration = new Dictionary(); 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 int GetWidth(DataGridViewColumn dataGridViewColumn); + public abstract void SetWidth(DataGridViewColumn dataGridViewColumn); public virtual void SaveSettings() { diff --git a/SanSystem/SanSystem.csproj b/SanSystem/SanSystem.csproj index cf8257b..0361ac6 100644 --- a/SanSystem/SanSystem.csproj +++ b/SanSystem/SanSystem.csproj @@ -154,6 +154,9 @@ UCSchachtanbindung.cs + + PreserveNewest + PreserveNewest diff --git a/SanSystem/documents/JUME/KalibrierungAuflistung.docx b/SanSystem/documents/JUME/KalibrierungAuflistung.docx new file mode 100644 index 0000000000000000000000000000000000000000..1558d101971ee6bdcc5b80c826a88e7a83087c35 GIT binary patch literal 12729 zcmeHt1#?_U(rwFPMvIvlEM{BGU@or$9kqnnL2aX!Q=>RiAp(EI;;{tvG}L*lUQXJ!=9+oT`Jam^}*`}rSfUquKc zGrT{5#`b)r`V`;a@%#z>m7)q*9Go>N1?%k^tLoQ)$)$8_Sky*WiX$xkWWNMm3r@Pl z`E3SYV;stjMCP@3gB%~M**ZFLWH`W>$r^j(N0s2@GYc{UUaQ{$qG^+2RLMP}SP26k zF~VVE{+20;1k_iCP1c%TgL_P?#TtdmJzHLyBO|3FU(&FOT}&B z6SG={jWY+&bH5qiU0BKtFC4SK0<$RC68ySWZCyELu?}E4nD*7lkeD+YhrYJSeM>N~ zyZm5t2Mz$dynq7~{^62@ak$NAAUl%-c^o{*CG{LktR0ycf6D*4;{Rd)`{mOs;(IK6 znGxQe1v~{zb}BCQU>C?S8BHu>FG9m;Ny?xvFIdh$Kk+RrywW)^5FehJPMGj;%oKB8 zPt-ZbO;$k+?}VMZ*X`AM=x_rh1$7j$xXsyZB4q5|m_7}WNzx1jL}U%-DVU&b495q~RIoOM zl_56f^IDxwpYmZs%bO@mnrnJoYi1^j%s9geINbA&$wQBVu97cdLG-YBuwhIOUZ&b; zn$LUTyEuXzXCxX8dK*BzOr3Y%L4oN%{bSC!UhxXF7%U*~!3V&AxdI)Gnf~P@#y}%y z8&LH68Mgj%7%))m0_pj`{ZzycgA4|=cLzNOq(}M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s index 6e20396..8888ac9 100644 --- a/SanSystem/frmObjektEdit.Designer.cs +++ b/SanSystem/frmObjektEdit.Designer.cs @@ -30,6 +30,8 @@ { this.tabControl1 = new System.Windows.Forms.TabControl(); 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_objekt_name = new System.Windows.Forms.TextBox(); this.lbl_objektname = new System.Windows.Forms.Label(); @@ -58,8 +60,6 @@ this.btn_close = new System.Windows.Forms.Button(); this.btn_add_san = 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.tabPage1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -104,15 +104,33 @@ this.tabPage1.Controls.Add(this.label2); 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.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.Name = "tabPage1"; 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.Text = "Grunddaten"; 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 // 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.Location = new System.Drawing.Point(192, 67); 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; // // 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.Location = new System.Drawing.Point(9, 70); 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.Text = "Objektname"; // @@ -180,7 +198,7 @@ "Ziegelwerk"}); this.cb_material.Location = new System.Drawing.Point(192, 252); 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; // // 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.Location = new System.Drawing.Point(188, 21); 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; // // 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.Location = new System.Drawing.Point(188, 112); 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; // // 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.Location = new System.Drawing.Point(6, 114); 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.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.Location = new System.Drawing.Point(9, 75); 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.Text = "Geschlossene Ende"; this.checkBox1.UseVisualStyleBackColor = true; @@ -241,7 +259,7 @@ this.label6.Location = new System.Drawing.Point(5, 26); this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 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.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.Name = "dt_haltunggemessen_datum"; 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; // // label20 @@ -264,7 +282,7 @@ this.label20.Location = new System.Drawing.Point(8, 300); this.label20.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 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.Text = "Haltungslänge gemessen am"; // @@ -274,7 +292,7 @@ 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.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; // // txt_strasse @@ -283,7 +301,7 @@ 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.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; // // label19 @@ -293,7 +311,7 @@ this.label19.Location = new System.Drawing.Point(560, 89); this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 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.Text = "Hausnummer"; // @@ -304,7 +322,7 @@ this.label18.Location = new System.Drawing.Point(560, 40); this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 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.Text = "Strasse"; // @@ -314,7 +332,7 @@ 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.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; // // txt_punkt_bis @@ -323,7 +341,7 @@ 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.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; // // txt_punkt_von @@ -332,7 +350,7 @@ 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.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; // // txt_pro_nr @@ -341,7 +359,7 @@ 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.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; // // label5 @@ -351,7 +369,7 @@ this.label5.Location = new System.Drawing.Point(9, 255); this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 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.Text = "Material"; // @@ -362,7 +380,7 @@ this.label4.Location = new System.Drawing.Point(9, 204); this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 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.Text = "Durchmesser"; // @@ -373,7 +391,7 @@ this.label3.Location = new System.Drawing.Point(9, 156); this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 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.Text = "Bis Punkt"; // @@ -384,7 +402,7 @@ this.label2.Location = new System.Drawing.Point(9, 110); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 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.Text = "Von Punkt"; // @@ -395,7 +413,7 @@ this.label1.Location = new System.Drawing.Point(9, 35); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 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.Text = "Projektnummer"; // @@ -431,27 +449,9 @@ this.btn_delete.UseVisualStyleBackColor = true; 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 // - this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.ClientSize = new System.Drawing.Size(1290, 702); @@ -464,7 +464,7 @@ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Name = "frmObjektEdit"; - this.Text = "FrmObjektEdit"; + this.Text = "Editieren"; this.Load += new System.EventHandler(this.frmObjektEdit_Load); this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); diff --git a/SanSystem/frmObjekteList.Designer.cs b/SanSystem/frmObjekteList.Designer.cs index 9bfcc12..5667db4 100644 --- a/SanSystem/frmObjekteList.Designer.cs +++ b/SanSystem/frmObjekteList.Designer.cs @@ -47,6 +47,8 @@ this.label5 = new System.Windows.Forms.Label(); this.lbl_grounddata = new System.Windows.Forms.Label(); 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.strasseBindingSource)).BeginInit(); this.gb_error_messages.SuspendLayout(); @@ -222,11 +224,32 @@ this.gb_error_messages.TabStop = false; 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 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 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.txt_ort); this.Controls.Add(this.lbl_ort); @@ -243,7 +266,7 @@ this.Margin = new System.Windows.Forms.Padding(2); this.Name = "frmObjekteList"; 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.Load += new System.EventHandler(this.frmObjekteList_Load); ((System.ComponentModel.ISupportInitialize)(this.dGObjekte)).EndInit(); @@ -275,5 +298,7 @@ private System.Windows.Forms.Label label5; private System.Windows.Forms.Label lbl_grounddata; private System.Windows.Forms.GroupBox gb_error_messages; + private System.Windows.Forms.Button btn_search; + private System.Windows.Forms.Button btn_make_ausdruck; } } \ No newline at end of file diff --git a/SanSystem/frmObjekteList.cs b/SanSystem/frmObjekteList.cs index c1eaa02..8532a75 100644 --- a/SanSystem/frmObjekteList.cs +++ b/SanSystem/frmObjekteList.cs @@ -2,6 +2,7 @@ using KlassenBIB; using SanSystem.Einstellungen; using System; +using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; @@ -22,6 +23,12 @@ namespace SanSystem 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; inspektionsobjekte = Datenbank.Instance.loadedProjekt.Objekte.FindAll(x => x.StrasseName.Equals(streetname)); @@ -195,10 +202,15 @@ namespace SanSystem dGObjekte.Columns["Haltunggemessen"].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["Haltungslaenge"].Width = objecteListSetting.configuration["Haltungslaenge"]; + + + dGObjekte.Columns["Auswahl"].Width = objecteListSetting.GetWidth(dGObjekte.Columns["Auswahl"]); // objecteListSetting.configuration["Auswahl"]; + 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; } @@ -209,11 +221,71 @@ namespace SanSystem private void frmObjekteList_FormClosing(object sender, FormClosingEventArgs e) { - objecteListSetting.configuration["Hausnummer"] = dGObjekte.Columns["Hausnummer"].Width; - objecteListSetting.configuration["VonPunkt"] = dGObjekte.Columns["VonPunkt"].Width; - objecteListSetting.configuration["BisPunkt"] = dGObjekte.Columns["BisPunkt"].Width; - objecteListSetting.configuration["Haltungslaenge"] = dGObjekte.Columns["Haltungslaenge"].Width; + objecteListSetting.SetWidth(dGObjekte.Columns["Hausnummer"]); + objecteListSetting.SetWidth(dGObjekte.Columns["VonPunkt"]); + objecteListSetting.SetWidth(dGObjekte.Columns["BisPunkt"]); + objecteListSetting.SetWidth(dGObjekte.Columns["Haltungslaenge"]); + objecteListSetting.SetWidth(dGObjekte.Columns["Auswahl"]); + objecteListSetting.SaveSettings(); + + } + + private void btn_make_ausdruck_Click(object sender, EventArgs e) + { + List ausdruck = new List(); + + 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; } } } diff --git a/SanSystem/frmStrassenList.Designer.cs b/SanSystem/frmStrassenList.Designer.cs index ed18102..70ed384 100644 --- a/SanSystem/frmStrassenList.Designer.cs +++ b/SanSystem/frmStrassenList.Designer.cs @@ -67,7 +67,7 @@ this.Controls.Add(this.lst_strassen); this.Margin = new System.Windows.Forms.Padding(2); this.Name = "frmStrassenList"; - this.Text = "frmStrassenList"; + this.Text = "Strassen"; this.Load += new System.EventHandler(this.frmStrassenList_Load); this.ResumeLayout(false);