diff --git a/Database/Datenbank.cs b/Database/Datenbank.cs index 92aa2b9..4a7d165 100644 --- a/Database/Datenbank.cs +++ b/Database/Datenbank.cs @@ -71,6 +71,7 @@ namespace Database UpdateDatabase.UpdateNewGuids(); UpdateDatabase.TransferAuftraggeber(); + UpdateDatabase.TransferSanierteObjekte(); return true; } diff --git a/Database/UpdateDatabase.cs b/Database/UpdateDatabase.cs index 4f795fb..d25eb0d 100644 --- a/Database/UpdateDatabase.cs +++ b/Database/UpdateDatabase.cs @@ -2,6 +2,7 @@ using SanShared; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Text; @@ -31,6 +32,65 @@ namespace Database return; } + public static void TransferSanierteObjekte() + { + List projekte = new List(); + + Projekt tempProjekt = null; + foreach (DirectoryInfo projekt in (new DirectoryInfo("./projekte").GetDirectories())) + { + projekte.Add(projekt.Name); + } + + foreach (string t in projekte) + { + Dictionary> SanObjekte = new Dictionary>(); + + + string filepath = Path.Combine("projekte", t, string.Format("{0}.xaml", t)); + if (!File.Exists(filepath)) continue; + tempProjekt = XamlServices.Load(filepath) as KlassenBIB.Projekt; + SanierteObjekte sanierteObjekte = new SanierteObjekte(); + sanierteObjekte.Projektnummer = tempProjekt.Nummer; + foreach (var d in tempProjekt.Objekte) + { + foreach(var s in d.Sanierung) + { + if(s is InlinerSanierung) + { + var x = s as InlinerSanierung; + if (x.LinerTyp != null && x.LinerTyp.Contains("Multiflex")) + break; + else + { + if ((WerkseitigImprägniert)x.Imprägnierungsbericht == null) continue; + WerkseitigImprägniert werkseitig = (WerkseitigImprägniert)x.Imprägnierungsbericht; + + + if(SanObjekte.ContainsKey(werkseitig.Imprägniernummer)) { + SanObjekte[werkseitig.Imprägniernummer].Add(d); + } + else + { + List ob = new List(); + ob.Add(d); + SanObjekte.Add(werkseitig.Imprägniernummer, ob); + } + } + } + } + } + + + + if (SanObjekte.Count > 0) + { + + } + //Debugger.Break(); + } + } + public static void TransferAuftraggeber() { List projekte = new List(); @@ -58,9 +118,6 @@ namespace Database Datenbank.Instance.MainDatenbank.AuftraggeberListe.Add(tempProjekt.Auftraggeber); - - - } } } diff --git a/KlassenBIB/Auftraggeber.cs b/KlassenBIB/Auftraggeber.cs index e06e88d..845ebf3 100644 --- a/KlassenBIB/Auftraggeber.cs +++ b/KlassenBIB/Auftraggeber.cs @@ -28,5 +28,10 @@ namespace KlassenBIB /// /// public string Ansprechpartner { get; set; } + + public override string ToString() + { + return string.Format("{0} / {1}", Name, Ansprechpartner); + } } } diff --git a/KlassenBIB/Sanierung/Renovation/AbstractImprägnier.cs b/KlassenBIB/Sanierung/Renovation/AbstractImprägnier.cs index 72d63c4..c20edfb 100644 --- a/KlassenBIB/Sanierung/Renovation/AbstractImprägnier.cs +++ b/KlassenBIB/Sanierung/Renovation/AbstractImprägnier.cs @@ -28,5 +28,6 @@ namespace KlassenBIB public double Vakuum { get; set; } public string HarzTyp { get; set; } public double Walzenabstand { get; set; } + public bool NochVorhanden { get; set; } } } diff --git a/KlassenBIB/Sanierung/Renovation/WerkseitigImprägniert.cs b/KlassenBIB/Sanierung/Renovation/WerkseitigImprägniert.cs index 904f110..2fac02e 100644 --- a/KlassenBIB/Sanierung/Renovation/WerkseitigImprägniert.cs +++ b/KlassenBIB/Sanierung/Renovation/WerkseitigImprägniert.cs @@ -12,6 +12,8 @@ namespace KlassenBIB public string Imprägniernummer { get; set; } public bool LagerungKorrekt { get; set; } public string LängeCode { get; set; } + public decimal LinerLänge { get; set; } + public List MitLinerSanierteObjekte { get; set; } public override string ToString() @@ -19,4 +21,10 @@ namespace KlassenBIB return string.Format("{0} ({1})",Imprägniernummer,DN); } } + + public class SanierteObjekte + { + public string Projektnummer { get; set; } + public List Objekt { get; set; } + } } diff --git a/SanSystem/FrmAuftraggeberEdit.Designer.cs b/SanSystem/FrmAuftraggeberEdit.Designer.cs index bce05c5..d7752a7 100644 --- a/SanSystem/FrmAuftraggeberEdit.Designer.cs +++ b/SanSystem/FrmAuftraggeberEdit.Designer.cs @@ -37,13 +37,14 @@ this.txt_strasse = new System.Windows.Forms.TextBox(); this.txt_ort = new System.Windows.Forms.TextBox(); this.txt_ansp = new System.Windows.Forms.TextBox(); + this.cb_auftraggeberlist = new System.Windows.Forms.ComboBox(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(12, 15); + this.label1.Location = new System.Drawing.Point(7, 62); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(64, 25); this.label1.TabIndex = 0; @@ -53,7 +54,7 @@ // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.Location = new System.Drawing.Point(12, 54); + this.label2.Location = new System.Drawing.Point(7, 101); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(79, 25); this.label2.TabIndex = 1; @@ -63,7 +64,7 @@ // this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label3.Location = new System.Drawing.Point(12, 90); + this.label3.Location = new System.Drawing.Point(7, 137); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(39, 25); this.label3.TabIndex = 2; @@ -73,7 +74,7 @@ // this.label4.AutoSize = true; this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label4.Location = new System.Drawing.Point(12, 136); + this.label4.Location = new System.Drawing.Point(7, 183); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(157, 25); this.label4.TabIndex = 3; @@ -82,7 +83,7 @@ // btn_save // this.btn_save.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_save.Location = new System.Drawing.Point(17, 185); + this.btn_save.Location = new System.Drawing.Point(12, 232); this.btn_save.Name = "btn_save"; this.btn_save.Size = new System.Drawing.Size(581, 105); this.btn_save.TabIndex = 4; @@ -93,7 +94,7 @@ // txt_name // this.txt_name.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txt_name.Location = new System.Drawing.Point(215, 12); + this.txt_name.Location = new System.Drawing.Point(210, 59); this.txt_name.Name = "txt_name"; this.txt_name.Size = new System.Drawing.Size(383, 30); this.txt_name.TabIndex = 5; @@ -101,7 +102,7 @@ // txt_strasse // this.txt_strasse.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txt_strasse.Location = new System.Drawing.Point(215, 51); + this.txt_strasse.Location = new System.Drawing.Point(210, 98); this.txt_strasse.Name = "txt_strasse"; this.txt_strasse.Size = new System.Drawing.Size(383, 30); this.txt_strasse.TabIndex = 6; @@ -109,7 +110,7 @@ // 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(215, 90); + this.txt_ort.Location = new System.Drawing.Point(210, 137); this.txt_ort.Name = "txt_ort"; this.txt_ort.Size = new System.Drawing.Size(383, 30); this.txt_ort.TabIndex = 7; @@ -117,16 +118,27 @@ // txt_ansp // this.txt_ansp.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txt_ansp.Location = new System.Drawing.Point(215, 133); + this.txt_ansp.Location = new System.Drawing.Point(210, 180); this.txt_ansp.Name = "txt_ansp"; this.txt_ansp.Size = new System.Drawing.Size(383, 30); this.txt_ansp.TabIndex = 8; // - // FrmAuftraggeberEdit + // cb_auftraggeberlist + // + this.cb_auftraggeberlist.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cb_auftraggeberlist.FormattingEnabled = true; + this.cb_auftraggeberlist.Location = new System.Drawing.Point(12, 12); + this.cb_auftraggeberlist.Name = "cb_auftraggeberlist"; + this.cb_auftraggeberlist.Size = new System.Drawing.Size(482, 33); + this.cb_auftraggeberlist.TabIndex = 9; + this.cb_auftraggeberlist.SelectionChangeCommitted += new System.EventHandler(this.Cb_auftraggeberlist_SelectionChangeCommitted); + // + // frmAuftraggeberEdit // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(631, 304); + this.ClientSize = new System.Drawing.Size(631, 365); + this.Controls.Add(this.cb_auftraggeberlist); this.Controls.Add(this.txt_ansp); this.Controls.Add(this.txt_ort); this.Controls.Add(this.txt_strasse); @@ -136,7 +148,7 @@ this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.label1); - this.Name = "FrmAuftraggeberEdit"; + this.Name = "frmAuftraggeberEdit"; this.Text = "FrmAuftraggeberEdit"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmAuftraggeberEdit_FormClosing); this.ResumeLayout(false); @@ -155,5 +167,6 @@ private System.Windows.Forms.TextBox txt_strasse; private System.Windows.Forms.TextBox txt_ort; private System.Windows.Forms.TextBox txt_ansp; + private System.Windows.Forms.ComboBox cb_auftraggeberlist; } } \ No newline at end of file diff --git a/SanSystem/FrmAuftraggeberEdit.cs b/SanSystem/FrmAuftraggeberEdit.cs index 67e6ed7..86ba40a 100644 --- a/SanSystem/FrmAuftraggeberEdit.cs +++ b/SanSystem/FrmAuftraggeberEdit.cs @@ -1,9 +1,11 @@ -using KlassenBIB; +using Database; +using KlassenBIB; using SanShared; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; @@ -17,29 +19,51 @@ namespace SanSystem /// public partial class frmAuftraggeberEdit : Form { + IAuftraggeber auftraggeber; /// /// /// public frmAuftraggeberEdit(IAuftraggeber auftraggeber) { InitializeComponent(); - txt_name.DataBindings.Add("Text", auftraggeber, "Name"); - txt_ort.DataBindings.Add("Text", auftraggeber, "Ort"); - txt_strasse.DataBindings.Add("Text", auftraggeber, "Strasse"); - txt_ansp.DataBindings.Add("Text", auftraggeber, "Ansprechpartner"); + this.auftraggeber = auftraggeber; + cb_auftraggeberlist.DataSource = Datenbank.Instance.MainDatenbank.AuftraggeberListe; + MakeBindings(); } private void FrmAuftraggeberEdit_FormClosing(object sender, FormClosingEventArgs e) { - txt_ansp.DataBindings.Clear(); - txt_name.DataBindings.Clear(); - txt_ort.DataBindings.Clear(); - txt_strasse.DataBindings.Clear(); + ClearBindings(); } private void btn_save_Click(object sender, EventArgs e) { this.Close(); } + + private void MakeBindings() + { + txt_name.DataBindings.Add("Text", this.auftraggeber, "Name"); + txt_ort.DataBindings.Add("Text", this.auftraggeber, "Ort"); + txt_strasse.DataBindings.Add("Text", this.auftraggeber, "Strasse"); + txt_ansp.DataBindings.Add("Text", this.auftraggeber, "Ansprechpartner"); + } + private void ClearBindings() + { + txt_name.DataBindings.Clear(); + txt_ort.DataBindings.Clear(); + txt_strasse.DataBindings.Clear(); + txt_ansp.DataBindings.Clear(); + } + + private void Cb_auftraggeberlist_SelectionChangeCommitted(object sender, EventArgs e) + { + ClearBindings(); + Auftraggeber selected = (Auftraggeber)cb_auftraggeberlist.SelectedItem; + if (selected == null) return; + auftraggeber = selected; + MakeBindings(); + + } } } diff --git a/SanSystem/FrmGetDataFromBluelight.Designer.cs b/SanSystem/FrmGetDataFromBluelight.Designer.cs new file mode 100644 index 0000000..bacd2e5 --- /dev/null +++ b/SanSystem/FrmGetDataFromBluelight.Designer.cs @@ -0,0 +1,48 @@ +namespace SanSystem +{ + partial class FrmGetDataFromBluelight + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // FrmGetDataFromBluelight + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(675, 232); + this.Name = "FrmGetDataFromBluelight"; + this.Text = "FrmGetDataFromBluelight"; + this.Load += new System.EventHandler(this.FrmGetDataFromBluelight_Load); + this.Shown += new System.EventHandler(this.FrmGetDataFromBluelight_Shown); + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/SanSystem/FrmGetDataFromBluelight.cs b/SanSystem/FrmGetDataFromBluelight.cs new file mode 100644 index 0000000..31a887c --- /dev/null +++ b/SanSystem/FrmGetDataFromBluelight.cs @@ -0,0 +1,40 @@ +using System; +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.Tasks; +using System.Windows.Forms; + +namespace SanSystem +{ + public partial class FrmGetDataFromBluelight : Form + { + public FrmGetDataFromBluelight() + { + InitializeComponent(); + } + + private void FrmGetDataFromBluelight_Load(object sender, EventArgs e) + { + try + { + File.Copy(@"\\192.168.2.248\samp01\1", "./daten.csv", false) ; + } + catch(Exception ex) + { + MessageBox.Show(ex.Message); + } + Debugger.Break(); + } + + private void FrmGetDataFromBluelight_Shown(object sender, EventArgs e) + { + + } + } +} diff --git a/SanSystem/FrmGetDataFromBluelight.resx b/SanSystem/FrmGetDataFromBluelight.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SanSystem/FrmGetDataFromBluelight.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SanSystem/FrmLinerReste.Designer.cs b/SanSystem/FrmLinerReste.Designer.cs new file mode 100644 index 0000000..77c5a01 --- /dev/null +++ b/SanSystem/FrmLinerReste.Designer.cs @@ -0,0 +1,66 @@ +namespace SanSystem +{ + partial class FrmLinerReste + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.list_liner = new System.Windows.Forms.ListBox(); + this.SuspendLayout(); + // + // list_liner + // + this.list_liner.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.list_liner.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.list_liner.FormattingEnabled = true; + this.list_liner.ItemHeight = 25; + this.list_liner.Location = new System.Drawing.Point(12, 12); + this.list_liner.Name = "list_liner"; + this.list_liner.Size = new System.Drawing.Size(385, 379); + this.list_liner.TabIndex = 0; + // + // FrmLinerReste + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(409, 407); + this.ControlBox = false; + this.Controls.Add(this.list_liner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "FrmLinerReste"; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "FrmLinerReste"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListBox list_liner; + } +} \ No newline at end of file diff --git a/SanSystem/FrmLinerReste.cs b/SanSystem/FrmLinerReste.cs new file mode 100644 index 0000000..5222625 --- /dev/null +++ b/SanSystem/FrmLinerReste.cs @@ -0,0 +1,49 @@ +using Database; +using KlassenBIB; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SanSystem +{ + public partial class FrmLinerReste : Form + { + private void BuildListe() + { + list_liner.Items.Clear(); + foreach (WerkseitigImprägniert linerTruhe in Datenbank.Instance.MainDatenbank.ImprägnierBerichtListe) + { + double verbrauch = 0; + decimal rest = linerTruhe.LinerLänge; + if (linerTruhe.NochVorhanden == false) continue; + if (linerTruhe.MitLinerSanierteObjekte != null) + { + linerTruhe.MitLinerSanierteObjekte.ForEach(x => x.Objekt.ForEach(d => verbrauch += d.Haltungslaenge)); + rest -= Convert.ToDecimal(verbrauch); + } + + + string listoutput = string.Format("({0}) DN: {1} G: {2} R: {3}", linerTruhe.Imprägniernummer, linerTruhe.DN, linerTruhe.LinerLänge, rest); + list_liner.Items.Add(listoutput); + } + } + public FrmLinerReste() + { + InitializeComponent(); + Global.Instance.RequestBuildNewLinerReste += Instance_RequestBuildNewLinerReste; + BuildListe(); + } + + private void Instance_RequestBuildNewLinerReste(object sender, EventArgs e) + { + BuildListe(); + } + } +} diff --git a/SanSystem/FrmLinerReste.resx b/SanSystem/FrmLinerReste.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SanSystem/FrmLinerReste.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SanSystem/FrmSelectNewSan.Designer.cs b/SanSystem/FrmSelectNewSan.Designer.cs index 95b796d..a228108 100644 --- a/SanSystem/FrmSelectNewSan.Designer.cs +++ b/SanSystem/FrmSelectNewSan.Designer.cs @@ -37,58 +37,63 @@ // btn_inliner // this.btn_inliner.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_inliner.Location = new System.Drawing.Point(12, 12); + this.btn_inliner.Location = new System.Drawing.Point(16, 15); + this.btn_inliner.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btn_inliner.Name = "btn_inliner"; - this.btn_inliner.Size = new System.Drawing.Size(187, 58); + this.btn_inliner.Size = new System.Drawing.Size(249, 71); this.btn_inliner.TabIndex = 0; - this.btn_inliner.Text = "button1"; + this.btn_inliner.Text = "btn_inliner"; this.btn_inliner.UseVisualStyleBackColor = true; this.btn_inliner.Click += new System.EventHandler(this.btn_inliner_Click); // // btn_schacht_anb // this.btn_schacht_anb.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_schacht_anb.Location = new System.Drawing.Point(212, 12); + this.btn_schacht_anb.Location = new System.Drawing.Point(283, 15); + this.btn_schacht_anb.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btn_schacht_anb.Name = "btn_schacht_anb"; - this.btn_schacht_anb.Size = new System.Drawing.Size(187, 58); + this.btn_schacht_anb.Size = new System.Drawing.Size(249, 71); this.btn_schacht_anb.TabIndex = 1; - this.btn_schacht_anb.Text = "button2"; + this.btn_schacht_anb.Text = "btn_schachtanb"; this.btn_schacht_anb.UseVisualStyleBackColor = true; this.btn_schacht_anb.Click += new System.EventHandler(this.btn_schacht_anb_Click); // // btn_kurzliner // this.btn_kurzliner.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_kurzliner.Location = new System.Drawing.Point(412, 12); + this.btn_kurzliner.Location = new System.Drawing.Point(549, 15); + this.btn_kurzliner.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btn_kurzliner.Name = "btn_kurzliner"; - this.btn_kurzliner.Size = new System.Drawing.Size(187, 58); + this.btn_kurzliner.Size = new System.Drawing.Size(249, 71); this.btn_kurzliner.TabIndex = 2; - this.btn_kurzliner.Text = "button3"; + this.btn_kurzliner.Text = "btn_kurzliner"; this.btn_kurzliner.UseVisualStyleBackColor = true; this.btn_kurzliner.Click += new System.EventHandler(this.btn_kurzliner_Click); // // btn_hut // this.btn_hut.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_hut.Location = new System.Drawing.Point(612, 12); + this.btn_hut.Location = new System.Drawing.Point(816, 15); + this.btn_hut.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btn_hut.Name = "btn_hut"; - this.btn_hut.Size = new System.Drawing.Size(187, 58); + this.btn_hut.Size = new System.Drawing.Size(249, 71); this.btn_hut.TabIndex = 3; - this.btn_hut.Text = "button4"; + this.btn_hut.Text = "btn_hutprofil"; this.btn_hut.UseVisualStyleBackColor = true; this.btn_hut.Click += new System.EventHandler(this.btn_hut_Click); // - // FrmSelectNewSan + // frmSelectNewSan // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(814, 87); + this.ClientSize = new System.Drawing.Size(1085, 107); this.Controls.Add(this.btn_hut); this.Controls.Add(this.btn_kurzliner); this.Controls.Add(this.btn_schacht_anb); this.Controls.Add(this.btn_inliner); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Name = "FrmSelectNewSan"; + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.Name = "frmSelectNewSan"; this.Text = "FrmSelectNewSan"; this.ResumeLayout(false); diff --git a/SanSystem/Global.cs b/SanSystem/Global.cs index 5adef44..3bfe4e5 100644 --- a/SanSystem/Global.cs +++ b/SanSystem/Global.cs @@ -13,6 +13,7 @@ namespace SanSystem { class Global { + public event EventHandler RequestBuildNewLinerReste; public static readonly Global instance = new Global(); const string userroot = "HKEY_CURRENT_USER\\Software"; @@ -23,6 +24,13 @@ namespace SanSystem string projektpfad = "18-850"; + public void BuildNewLinerReste(EventArgs args) + { + EventHandler handler = RequestBuildNewLinerReste; + if (handler != null) + handler(this, args); + } + public string PROGRAMMVERSION { get diff --git a/SanSystem/SanSystem.csproj b/SanSystem/SanSystem.csproj index 8b44dd2..87e3712 100644 --- a/SanSystem/SanSystem.csproj +++ b/SanSystem/SanSystem.csproj @@ -131,6 +131,12 @@ frmExceptionWindow.cs + + Form + + + FrmGetDataFromBluelight.cs + Form @@ -149,6 +155,12 @@ frmKalibrierungFestlegung.cs + + Form + + + FrmLinerReste.cs + Form @@ -248,6 +260,9 @@ frmExceptionWindow.cs + + FrmGetDataFromBluelight.cs + frmImprägnierBerichtEdit.cs @@ -257,6 +272,9 @@ frmKalibrierungFestlegung.cs + + FrmLinerReste.cs + frmNewProjekt.cs diff --git a/SanSystem/UCInliner.Designer.cs b/SanSystem/UCInliner.Designer.cs index af3b617..2cb79ba 100644 --- a/SanSystem/UCInliner.Designer.cs +++ b/SanSystem/UCInliner.Designer.cs @@ -30,6 +30,7 @@ { this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.btn_gen_dp = new System.Windows.Forms.Button(); this.label6 = new System.Windows.Forms.Label(); this.txt_einbaudruck = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); @@ -62,7 +63,6 @@ this.cb_stvo = new System.Windows.Forms.CheckBox(); this.cb_wasserhaltung = new System.Windows.Forms.CheckBox(); this.cb_genehmigung = new System.Windows.Forms.CheckBox(); - this.btn_gen_dp = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage2.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -113,6 +113,16 @@ this.tabPage2.Text = "Vorraussetzungen"; this.tabPage2.UseVisualStyleBackColor = true; // + // btn_gen_dp + // + this.btn_gen_dp.Location = new System.Drawing.Point(840, 323); + this.btn_gen_dp.Name = "btn_gen_dp"; + this.btn_gen_dp.Size = new System.Drawing.Size(167, 103); + this.btn_gen_dp.TabIndex = 43; + this.btn_gen_dp.Text = "button1"; + this.btn_gen_dp.UseVisualStyleBackColor = true; + this.btn_gen_dp.Click += new System.EventHandler(this.Btn_gen_dp_Click); + // // label6 // this.label6.AutoSize = true; @@ -248,7 +258,6 @@ this.btn_transfer_ftp.TabIndex = 28; this.btn_transfer_ftp.Text = "Daten von der Anlage downloaden"; this.btn_transfer_ftp.UseVisualStyleBackColor = true; - this.btn_transfer_ftp.Visible = false; this.btn_transfer_ftp.Click += new System.EventHandler(this.btn_transfer_ftp_Click); // // label1 @@ -437,16 +446,6 @@ this.cb_genehmigung.Text = "Genehmigung wurde eingeholt"; this.cb_genehmigung.UseVisualStyleBackColor = true; // - // btn_gen_dp - // - this.btn_gen_dp.Location = new System.Drawing.Point(808, 387); - this.btn_gen_dp.Name = "btn_gen_dp"; - this.btn_gen_dp.Size = new System.Drawing.Size(167, 103); - this.btn_gen_dp.TabIndex = 43; - this.btn_gen_dp.Text = "button1"; - this.btn_gen_dp.UseVisualStyleBackColor = true; - this.btn_gen_dp.Click += new System.EventHandler(this.Btn_gen_dp_Click); - // // UCInliner // this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); diff --git a/SanSystem/UCInliner.cs b/SanSystem/UCInliner.cs index fa81cb6..926e655 100644 --- a/SanSystem/UCInliner.cs +++ b/SanSystem/UCInliner.cs @@ -95,8 +95,6 @@ namespace SanSystem inliner.Datum = new DateTime(2018, 01, 01, 12, 0, 0); } dt_eingebaut.DataBindings.Add(new Binding("Value", inliner, "Datum")); - /*else - dt_eingebaut.Enabled = false;*/ cb_genehmigung.DataBindings.Add(new Binding("Checked", inliner, "genehmigungVorhanden")); cb_stvo.DataBindings.Add(new Binding("Checked", inliner, "sTVOAbsicherung")); cb_wasserhaltung.DataBindings.Add(new Binding("Checked", inliner, "wasserhaltungEingerichtet")); @@ -199,12 +197,28 @@ namespace SanSystem private void btn_transfer_ftp_Click(object sender, EventArgs e) { - filenames.Clear(); - if (MessageBox.Show("Bitte stellen Sie sicher, dass der Server antwortet und dass nur die Dateien vorhanden sind!, Bitte beachten Sie, dass das fenster einfrieren kann", "WARNUNG", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop) == DialogResult.OK) + if (true) { - DownloadFromUV(); + OpenFileDialog openFileDialog = new OpenFileDialog(); + openFileDialog.InitialDirectory = @"\\192.168.2.248"; + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + string source = openFileDialog.FileName; + string destFile = string.Format("{0}.csv", inliner.Inspektionsobjekt.Sanierungsnummer); + destFile = Path.Combine(destinationPath, destFile); + File.Copy(source, destFile, false); + File.Delete(source); + } + } + else + { + filenames.Clear(); + if (MessageBox.Show("Bitte stellen Sie sicher, dass der Server antwortet und dass nur die Dateien vorhanden sind!, Bitte beachten Sie, dass das fenster einfrieren kann", "WARNUNG", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop) == DialogResult.OK) + { + DownloadFromUV(); + } + } } - } private void ListFiles(FtpClient client, string directory) { @@ -222,19 +236,13 @@ namespace SanSystem } } - - - - private bool AccessCSV() { string myPath = Path.Combine(destinationPath); if (!Directory.Exists(myPath)) return false; - IEnumerable files = Directory.EnumerateFiles(myPath, "*.csv", SearchOption.AllDirectories); - - + IEnumerable files = Directory.EnumerateFiles(myPath, "*.csv", SearchOption.TopDirectoryOnly); IReadCSVData csvFile = null; List struktures = null; @@ -264,8 +272,6 @@ namespace SanSystem return makeGraphic.GetGraphics(struktures, destinationPath); } - - private void Btn_open_file_Click(object sender, EventArgs e) { Process prozess = new Process(); @@ -281,10 +287,8 @@ namespace SanSystem } } - private void Btn_create_protokol_MouseDown(object sender, MouseEventArgs e) { - //DateTime offset = DateTime.MinValue; if(e.Button == MouseButtons.Right) { @@ -331,8 +335,6 @@ namespace SanSystem Kommentar = komment }) ; } - - } } BerichtGen.FrmOptions options = new BerichtGen.FrmOptions("JUME", "liner_einbauBlueLight.docx", speicherpfad, inliner.Inspektionsobjekt.Objektbezeichnung, hashtable, bilderObjects); @@ -365,9 +367,6 @@ namespace SanSystem protokollWriter.Ersetzen(); protokollWriter.WriteFile(); MessageBox.Show("Fertig"); - - - } } } diff --git a/SanSystem/UCWeitereFotos.cs b/SanSystem/UCWeitereFotos.cs index 4732758..bbeed30 100644 --- a/SanSystem/UCWeitereFotos.cs +++ b/SanSystem/UCWeitereFotos.cs @@ -60,7 +60,9 @@ namespace SanSystem { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { - if(openFileDialog.ShowDialog() == DialogResult.OK) + if (txt_schachtnummer.Text == "") + openFileDialog.InitialDirectory = @"C:\K2000w\BILDER"; + if (openFileDialog.ShowDialog() == DialogResult.OK) { string source = openFileDialog.FileName; SavedBilder bilder = new SavedBilder(); @@ -69,7 +71,6 @@ namespace SanSystem try { - if (pt_box == null) throw new Exception(); string speicherpfad = Path.Combine(mydestination, targetname); File.Copy(source, speicherpfad); diff --git a/SanSystem/UCWerkseitigImprägniert.cs b/SanSystem/UCWerkseitigImprägniert.cs index 72cc884..9d1eb41 100644 --- a/SanSystem/UCWerkseitigImprägniert.cs +++ b/SanSystem/UCWerkseitigImprägniert.cs @@ -50,7 +50,35 @@ namespace SanSystem private void Btn_save_Click(object sender, EventArgs e) { + WerkseitigImprägniert imprignier = (WerkseitigImprägniert)lst_imprägnierberichte.SelectedItem; + if (imprignier == null) + { + MessageBox.Show("Imprignierung is null"); + return; + } inliner.Imprägnierungsbericht = (WerkseitigImprägniert)lst_imprägnierberichte.SelectedItem; + if(imprignier.MitLinerSanierteObjekte == null) + { + imprignier.MitLinerSanierteObjekte = new List(); + } + SanierteObjekte objekt = null; + if(imprignier.MitLinerSanierteObjekte.Count > 0) + { + objekt = imprignier.MitLinerSanierteObjekte.FindLast(x => x.Projektnummer.Equals(Global.Instance.ProjektNummer)); + } + if (objekt == null) + { + objekt = new SanierteObjekte(); + objekt.Projektnummer = Global.Instance.ProjektNummer; + } + if(objekt.Objekt == null) + objekt.Objekt = new List(); + + if (objekt.Objekt.FindAll(x => x.Guid.Equals(inliner.Inspektionsobjekt.Guid)).Count < 1) + { + objekt.Objekt.Add(inliner.Inspektionsobjekt); + imprignier.MitLinerSanierteObjekte.Add(objekt); + } } } } diff --git a/SanSystem/frmImprägnierBerichtEdit.Designer.cs b/SanSystem/frmImprägnierBerichtEdit.Designer.cs index a93bc9b..2ee9afa 100644 --- a/SanSystem/frmImprägnierBerichtEdit.Designer.cs +++ b/SanSystem/frmImprägnierBerichtEdit.Designer.cs @@ -40,6 +40,9 @@ this.btn_save = new System.Windows.Forms.Button(); this.label2 = new System.Windows.Forms.Label(); this.txt_dn = new System.Windows.Forms.TextBox(); + this.txt_liner_laenge = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.cb_vorhanden = new System.Windows.Forms.CheckBox(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); // @@ -78,7 +81,7 @@ this.groupBox2.Controls.Add(this.mtxt_impanfang_datum); this.groupBox2.Controls.Add(this.label8); this.groupBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.groupBox2.Location = new System.Drawing.Point(12, 193); + this.groupBox2.Location = new System.Drawing.Point(17, 225); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(315, 91); this.groupBox2.TabIndex = 8; @@ -91,7 +94,7 @@ this.mtxt_impanfang_datum.Mask = "00/00/0000"; this.mtxt_impanfang_datum.Name = "mtxt_impanfang_datum"; this.mtxt_impanfang_datum.Size = new System.Drawing.Size(192, 30); - this.mtxt_impanfang_datum.TabIndex = 5; + this.mtxt_impanfang_datum.TabIndex = 6; this.mtxt_impanfang_datum.ValidatingType = typeof(System.DateTime); // // label8 @@ -134,7 +137,7 @@ this.btn_save.Location = new System.Drawing.Point(440, 6); this.btn_save.Name = "btn_save"; this.btn_save.Size = new System.Drawing.Size(209, 278); - this.btn_save.TabIndex = 6; + this.btn_save.TabIndex = 7; this.btn_save.Text = "Speichern"; this.btn_save.UseVisualStyleBackColor = true; this.btn_save.Click += new System.EventHandler(this.Btn_save_Click); @@ -157,11 +160,43 @@ this.txt_dn.Size = new System.Drawing.Size(100, 30); this.txt_dn.TabIndex = 4; // + // txt_liner_laenge + // + this.txt_liner_laenge.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txt_liner_laenge.Location = new System.Drawing.Point(213, 180); + this.txt_liner_laenge.Name = "txt_liner_laenge"; + this.txt_liner_laenge.Size = new System.Drawing.Size(157, 30); + this.txt_liner_laenge.TabIndex = 5; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.Location = new System.Drawing.Point(12, 180); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(115, 25); + this.label5.TabIndex = 22; + this.label5.Text = "Liner Länge"; + // + // cb_vorhanden + // + this.cb_vorhanden.AutoSize = true; + this.cb_vorhanden.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cb_vorhanden.Location = new System.Drawing.Point(17, 322); + this.cb_vorhanden.Name = "cb_vorhanden"; + this.cb_vorhanden.Size = new System.Drawing.Size(131, 29); + this.cb_vorhanden.TabIndex = 23; + this.cb_vorhanden.Text = "Vorhanden"; + this.cb_vorhanden.UseVisualStyleBackColor = true; + // // frmImprägnierBerichtEdit // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(671, 294); + this.ClientSize = new System.Drawing.Size(671, 387); + this.Controls.Add(this.cb_vorhanden); + this.Controls.Add(this.label5); + this.Controls.Add(this.txt_liner_laenge); this.Controls.Add(this.txt_dn); this.Controls.Add(this.label2); this.Controls.Add(this.btn_save); @@ -196,5 +231,8 @@ private System.Windows.Forms.MaskedTextBox mtxt_impanfang_datum; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox txt_dn; + private System.Windows.Forms.TextBox txt_liner_laenge; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.CheckBox cb_vorhanden; } } \ No newline at end of file diff --git a/SanSystem/frmImprägnierBerichtEdit.cs b/SanSystem/frmImprägnierBerichtEdit.cs index be4acc3..e5d98a4 100644 --- a/SanSystem/frmImprägnierBerichtEdit.cs +++ b/SanSystem/frmImprägnierBerichtEdit.cs @@ -24,6 +24,8 @@ namespace SanSystem txt_schlauchnummer.DataBindings.Add("Text", werkseitigImprägniert, "Schlauchnummer"); txt_wanddicke.DataBindings.Add("Text", werkseitigImprägniert, "Wanddicke"); txt_dn.DataBindings.Add("Text", werkseitigImprägniert, "DN"); + txt_liner_laenge.DataBindings.Add("Text", werkseitigImprägniert, "LinerLänge"); + cb_vorhanden.DataBindings.Add("Checked", werkseitigImprägniert, "NochVorhanden"); if(werkseitigImprägniert.ImprägnierungBeginn != null) { mtxt_impanfang_datum.Text = werkseitigImprägniert.ImprägnierungBeginn.Zeitstempel.ToShortDateString(); @@ -56,6 +58,7 @@ namespace SanSystem private void Btn_save_Click(object sender, EventArgs e) { save(); + this.Close(); } private void FrmImprägnierBerichtEdit_FormClosing(object sender, FormClosingEventArgs e) diff --git a/SanSystem/frmImprägnierBerichtList.cs b/SanSystem/frmImprägnierBerichtList.cs index 6882f6c..6029717 100644 --- a/SanSystem/frmImprägnierBerichtList.cs +++ b/SanSystem/frmImprägnierBerichtList.cs @@ -27,9 +27,10 @@ namespace SanSystem WerkseitigImprägniert werkseitigImprägnierts = new WerkseitigImprägniert(); Database.Datenbank.Instance.MainDatenbank.ImprägnierBerichtListe.Add(werkseitigImprägnierts); frmImprägnierBerichtEdit frmImprägnierBerichtEdit = new frmImprägnierBerichtEdit(werkseitigImprägnierts); + frmImprägnierBerichtEdit.FormClosed += FrmImprägnierBerichtEdit_FormClosed; frmImprägnierBerichtEdit.ShowDialog(); - } + } private void Lst_imprägnierBerichtNr_DoubleClick(object sender, EventArgs e) { if ((sender as ListBox).SelectedItem == null) return; diff --git a/SanSystem/frmMain.Designer.cs b/SanSystem/frmMain.Designer.cs index f3cb517..ae6228e 100644 --- a/SanSystem/frmMain.Designer.cs +++ b/SanSystem/frmMain.Designer.cs @@ -42,10 +42,11 @@ this.projektordnerÖffnenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.imprägnierberichteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStripStatus_projekt_Label = new System.Windows.Forms.ToolStripStatusLabel(); this.berichteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.massenberichteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.toolStripStatus_projekt_Label = new System.Windows.Forms.ToolStripStatusLabel(); + this.verbrauchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mainmenu.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.SuspendLayout(); @@ -65,7 +66,7 @@ this.mainmenu.Location = new System.Drawing.Point(0, 0); this.mainmenu.Name = "mainmenu"; this.mainmenu.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2); - this.mainmenu.Size = new System.Drawing.Size(938, 36); + this.mainmenu.Size = new System.Drawing.Size(1084, 36); this.mainmenu.TabIndex = 1; this.mainmenu.Text = "menuStrip1"; // @@ -141,28 +142,11 @@ this.imprägnierberichteToolStripMenuItem.Text = "Imprägnierberichte"; this.imprägnierberichteToolStripMenuItem.Click += new System.EventHandler(this.ImprägnierberichteToolStripMenuItem_Click); // - // statusStrip1 - // - this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); - this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripStatus_projekt_Label}); - this.statusStrip1.Location = new System.Drawing.Point(0, 433); - this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0); - this.statusStrip1.Size = new System.Drawing.Size(938, 26); - this.statusStrip1.TabIndex = 3; - this.statusStrip1.Text = "statusStrip1"; - // - // toolStripStatus_projekt_Label - // - this.toolStripStatus_projekt_Label.Name = "toolStripStatus_projekt_Label"; - this.toolStripStatus_projekt_Label.Size = new System.Drawing.Size(55, 20); - this.toolStripStatus_projekt_Label.Text = "Projekt"; - // // berichteToolStripMenuItem // this.berichteToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.massenberichteToolStripMenuItem}); + this.massenberichteToolStripMenuItem, + this.verbrauchToolStripMenuItem}); this.berichteToolStripMenuItem.Name = "berichteToolStripMenuItem"; this.berichteToolStripMenuItem.Size = new System.Drawing.Size(101, 32); this.berichteToolStripMenuItem.Text = "Berichte "; @@ -174,11 +158,36 @@ this.massenberichteToolStripMenuItem.Text = "Massenberichte"; this.massenberichteToolStripMenuItem.Click += new System.EventHandler(this.MassenberichteToolStripMenuItem_Click); // + // statusStrip1 + // + this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatus_projekt_Label}); + this.statusStrip1.Location = new System.Drawing.Point(0, 532); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0); + this.statusStrip1.Size = new System.Drawing.Size(1084, 26); + this.statusStrip1.TabIndex = 3; + this.statusStrip1.Text = "statusStrip1"; + // + // toolStripStatus_projekt_Label + // + this.toolStripStatus_projekt_Label.Name = "toolStripStatus_projekt_Label"; + this.toolStripStatus_projekt_Label.Size = new System.Drawing.Size(55, 20); + this.toolStripStatus_projekt_Label.Text = "Projekt"; + // + // verbrauchToolStripMenuItem + // + this.verbrauchToolStripMenuItem.Name = "verbrauchToolStripMenuItem"; + this.verbrauchToolStripMenuItem.Size = new System.Drawing.Size(234, 32); + this.verbrauchToolStripMenuItem.Text = "Verbrauch"; + this.verbrauchToolStripMenuItem.Click += new System.EventHandler(this.VerbrauchToolStripMenuItem_Click); + // // frmMain // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(938, 459); + this.ClientSize = new System.Drawing.Size(1084, 558); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.mainmenu); this.IsMdiContainer = true; @@ -214,6 +223,7 @@ private System.Windows.Forms.ToolStripMenuItem imprägnierberichteToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem berichteToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem massenberichteToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem verbrauchToolStripMenuItem; } } diff --git a/SanSystem/frmMain.cs b/SanSystem/frmMain.cs index 368f54c..12792bc 100644 --- a/SanSystem/frmMain.cs +++ b/SanSystem/frmMain.cs @@ -32,8 +32,7 @@ namespace SanSystem { InitializeComponent(); - //Global.Instance. - + if (!Directory.Exists(Global.Instance.Projektpfad)) Directory.CreateDirectory(Global.Instance.Projektpfad); try { @@ -45,6 +44,8 @@ namespace SanSystem frmException.FormClosed += FrmException_FormClosed; frmException.ShowDialog(); } + + //Datenbank.Instance.CreateProjekt(""); this.Width = Screen.PrimaryScreen.WorkingArea.Width; @@ -66,9 +67,16 @@ namespace SanSystem if (Wupi.QueryInfo(0, QueryInfoOption.FirmCode) == 0) this.Text += " nicht geschützter Version nur für TESTZWECKE!"; - + FrmLinerReste frmLinerReste = new FrmLinerReste(); + frmLinerReste.MdiParent = this; + Point start = new Point(this.Width - frmLinerReste.Width-40, 10); + frmLinerReste.Location = start; + //frmLinerReste.IsMdiChild = true; + frmLinerReste.Show(); + + } private void FrmException_FormClosed(object sender, FormClosedEventArgs e) @@ -127,6 +135,14 @@ namespace SanSystem strassenList.Location = new Point(0, 0); strassenList.StartPosition = FormStartPosition.Manual; strassenList.Show(); + + FrmLinerReste frmLinerReste = new FrmLinerReste(); + frmLinerReste.MdiParent = this; + Point start = new Point(this.Width - frmLinerReste.Width - 40, 10); + frmLinerReste.Location = start; + + //frmLinerReste.IsMdiChild = true; + frmLinerReste.Show(); } private void speichernToolStripMenuItem_Click(object sender, EventArgs e) @@ -242,5 +258,11 @@ namespace SanSystem //options.ShowDialog(); MessageBox.Show("Fertig"); } + + private void VerbrauchToolStripMenuItem_Click(object sender, EventArgs e) + { + FrmGetDataFromBluelight frmGetDataFromBluelight = new FrmGetDataFromBluelight(); + frmGetDataFromBluelight.ShowDialog(); + } } } diff --git a/SanSystem/frmObjektEdit.cs b/SanSystem/frmObjektEdit.cs index 1c717ad..a1ecdce 100644 --- a/SanSystem/frmObjektEdit.cs +++ b/SanSystem/frmObjektEdit.cs @@ -121,6 +121,7 @@ namespace SanSystem cb_geschlossenesEnde.DataBindings.Clear(); //MessageBox.Show(string.Format("width: {0} height: {1}", width, height)); + Global.Instance.BuildNewLinerReste(EventArgs.Empty); this.Close(); }