From f79d8985f0fcb995a813f89afa8d932fe734da0b Mon Sep 17 00:00:00 2001 From: Husky Date: Mon, 30 Jul 2018 12:26:36 +0200 Subject: [PATCH] =?UTF-8?q?Auftraggeber=20k=C3=B6nnen=20nun=20bearbeitet?= =?UTF-8?q?=20werden=20und=20werden=20gespeichert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KlassenBIB/Auftraggeber.cs | 31 +++++ KlassenBIB/KlassenBIB.csproj | 1 + KlassenBIB/Projekt.cs | 5 + SanSystem/FrmAuftraggeberEdit.Designer.cs | 159 ++++++++++++++++++++++ SanSystem/FrmAuftraggeberEdit.cs | 44 ++++++ SanSystem/FrmAuftraggeberEdit.resx | 120 ++++++++++++++++ SanSystem/SanSystem.csproj | 9 ++ SanSystem/frmMain.Designer.cs | 51 ++++--- SanSystem/frmMain.cs | 6 + 9 files changed, 407 insertions(+), 19 deletions(-) create mode 100644 KlassenBIB/Auftraggeber.cs create mode 100644 SanSystem/FrmAuftraggeberEdit.Designer.cs create mode 100644 SanSystem/FrmAuftraggeberEdit.cs create mode 100644 SanSystem/FrmAuftraggeberEdit.resx diff --git a/KlassenBIB/Auftraggeber.cs b/KlassenBIB/Auftraggeber.cs new file mode 100644 index 0000000..d1886a8 --- /dev/null +++ b/KlassenBIB/Auftraggeber.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace KlassenBIB +{ + /// + /// + /// + public class Auftraggeber + { + /// + /// + /// + public string Name { get; set; } + /// + /// + /// + public string Strasse { get; set; } + /// + /// + /// + public string Ort { get; set; } + /// + /// + /// + public string Ansprechpartner { get; set; } + } +} diff --git a/KlassenBIB/KlassenBIB.csproj b/KlassenBIB/KlassenBIB.csproj index 5236747..6ce9a06 100644 --- a/KlassenBIB/KlassenBIB.csproj +++ b/KlassenBIB/KlassenBIB.csproj @@ -43,6 +43,7 @@ + diff --git a/KlassenBIB/Projekt.cs b/KlassenBIB/Projekt.cs index 2e3cf07..3736576 100644 --- a/KlassenBIB/Projekt.cs +++ b/KlassenBIB/Projekt.cs @@ -25,6 +25,10 @@ namespace KlassenBIB /// /// /// + public Auftraggeber Auftraggeber { get; set; } + /// + /// + /// public AbwasserTechnischeAnlageCollection Objekte { get; set; } /// /// @@ -32,6 +36,7 @@ namespace KlassenBIB public Projekt() { Objekte = new AbwasserTechnischeAnlageCollection(); + Auftraggeber = new Auftraggeber(); } } } diff --git a/SanSystem/FrmAuftraggeberEdit.Designer.cs b/SanSystem/FrmAuftraggeberEdit.Designer.cs new file mode 100644 index 0000000..6318b5f --- /dev/null +++ b/SanSystem/FrmAuftraggeberEdit.Designer.cs @@ -0,0 +1,159 @@ +namespace SanSystem +{ + partial class FrmAuftraggeberEdit + { + /// + /// 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.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.btn_save = new System.Windows.Forms.Button(); + this.txt_name = new System.Windows.Forms.TextBox(); + 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.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.Name = "label1"; + this.label1.Size = new System.Drawing.Size(64, 25); + this.label1.TabIndex = 0; + this.label1.Text = "Name"; + // + // label2 + // + 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.Name = "label2"; + this.label2.Size = new System.Drawing.Size(79, 25); + this.label2.TabIndex = 1; + this.label2.Text = "Strasse"; + // + // label3 + // + 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.Name = "label3"; + this.label3.Size = new System.Drawing.Size(39, 25); + this.label3.TabIndex = 2; + this.label3.Text = "Ort"; + // + // label4 + // + 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.Name = "label4"; + this.label4.Size = new System.Drawing.Size(157, 25); + this.label4.TabIndex = 3; + this.label4.Text = "Ansprechpartner"; + // + // 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.Name = "btn_save"; + this.btn_save.Size = new System.Drawing.Size(581, 105); + this.btn_save.TabIndex = 4; + this.btn_save.Text = "Speichern"; + this.btn_save.UseVisualStyleBackColor = true; + this.btn_save.Click += new System.EventHandler(this.btn_save_Click); + // + // 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.Name = "txt_name"; + this.txt_name.Size = new System.Drawing.Size(383, 30); + this.txt_name.TabIndex = 5; + // + // 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.Name = "txt_strasse"; + this.txt_strasse.Size = new System.Drawing.Size(383, 30); + this.txt_strasse.TabIndex = 6; + // + // 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.Name = "txt_ort"; + this.txt_ort.Size = new System.Drawing.Size(383, 30); + this.txt_ort.TabIndex = 7; + // + // 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.Name = "txt_ansp"; + this.txt_ansp.Size = new System.Drawing.Size(383, 30); + this.txt_ansp.TabIndex = 8; + // + // 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.Controls.Add(this.txt_ansp); + this.Controls.Add(this.txt_ort); + this.Controls.Add(this.txt_strasse); + this.Controls.Add(this.txt_name); + this.Controls.Add(this.btn_save); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "FrmAuftraggeberEdit"; + this.Text = "FrmAuftraggeberEdit"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmAuftraggeberEdit_FormClosing); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Button btn_save; + private System.Windows.Forms.TextBox txt_name; + private System.Windows.Forms.TextBox txt_strasse; + private System.Windows.Forms.TextBox txt_ort; + private System.Windows.Forms.TextBox txt_ansp; + } +} \ No newline at end of file diff --git a/SanSystem/FrmAuftraggeberEdit.cs b/SanSystem/FrmAuftraggeberEdit.cs new file mode 100644 index 0000000..83d535a --- /dev/null +++ b/SanSystem/FrmAuftraggeberEdit.cs @@ -0,0 +1,44 @@ +using KlassenBIB; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SanSystem +{ + /// + /// + /// + public partial class FrmAuftraggeberEdit : Form + { + /// + /// + /// + public FrmAuftraggeberEdit(Auftraggeber 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"); + } + + private void FrmAuftraggeberEdit_FormClosing(object sender, FormClosingEventArgs e) + { + txt_ansp.DataBindings.Clear(); + txt_name.DataBindings.Clear(); + txt_ort.DataBindings.Clear(); + txt_strasse.DataBindings.Clear(); + } + + private void btn_save_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} diff --git a/SanSystem/FrmAuftraggeberEdit.resx b/SanSystem/FrmAuftraggeberEdit.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SanSystem/FrmAuftraggeberEdit.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/SanSystem.csproj b/SanSystem/SanSystem.csproj index 487a265..fd24655 100644 --- a/SanSystem/SanSystem.csproj +++ b/SanSystem/SanSystem.csproj @@ -82,6 +82,12 @@ + + Form + + + FrmAuftraggeberEdit.cs + Form @@ -172,6 +178,9 @@ UCSchachtanbindung.cs + + FrmAuftraggeberEdit.cs + FrmKalibrierungFestlegung.cs diff --git a/SanSystem/frmMain.Designer.cs b/SanSystem/frmMain.Designer.cs index 25c5cf7..3c823f9 100644 --- a/SanSystem/frmMain.Designer.cs +++ b/SanSystem/frmMain.Designer.cs @@ -35,17 +35,19 @@ this.projektToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.neuToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.öffnenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.stammdatenImportierenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.speichernToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.massenstatistikToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripStatus_projekt_Label = new System.Windows.Forms.ToolStripStatusLabel(); - this.stammdatenImportierenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.auftraggeberToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mainmenu.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // // mainmenu // + this.mainmenu.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.mainmenu.ImageScalingSize = new System.Drawing.Size(20, 20); this.mainmenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.projektToolStripMenuItem, @@ -53,7 +55,8 @@ this.massenstatistikToolStripMenuItem}); this.mainmenu.Location = new System.Drawing.Point(0, 0); this.mainmenu.Name = "mainmenu"; - this.mainmenu.Size = new System.Drawing.Size(596, 24); + this.mainmenu.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2); + this.mainmenu.Size = new System.Drawing.Size(795, 36); this.mainmenu.TabIndex = 1; this.mainmenu.Text = "menuStrip1"; // @@ -62,36 +65,44 @@ this.projektToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.neuToolStripMenuItem, this.öffnenToolStripMenuItem, - this.stammdatenImportierenToolStripMenuItem}); + this.stammdatenImportierenToolStripMenuItem, + this.auftraggeberToolStripMenuItem}); this.projektToolStripMenuItem.Name = "projektToolStripMenuItem"; - this.projektToolStripMenuItem.Size = new System.Drawing.Size(56, 20); + this.projektToolStripMenuItem.Size = new System.Drawing.Size(86, 32); this.projektToolStripMenuItem.Text = "Projekt"; // // neuToolStripMenuItem // this.neuToolStripMenuItem.Name = "neuToolStripMenuItem"; - this.neuToolStripMenuItem.Size = new System.Drawing.Size(207, 22); + this.neuToolStripMenuItem.Size = new System.Drawing.Size(310, 32); this.neuToolStripMenuItem.Text = "Neu"; this.neuToolStripMenuItem.Click += new System.EventHandler(this.neuToolStripMenuItem_Click); // // öffnenToolStripMenuItem // this.öffnenToolStripMenuItem.Name = "öffnenToolStripMenuItem"; - this.öffnenToolStripMenuItem.Size = new System.Drawing.Size(207, 22); + this.öffnenToolStripMenuItem.Size = new System.Drawing.Size(310, 32); this.öffnenToolStripMenuItem.Text = "Öffnen"; this.öffnenToolStripMenuItem.Click += new System.EventHandler(this.öffnenToolStripMenuItem_Click); // + // stammdatenImportierenToolStripMenuItem + // + this.stammdatenImportierenToolStripMenuItem.Name = "stammdatenImportierenToolStripMenuItem"; + this.stammdatenImportierenToolStripMenuItem.Size = new System.Drawing.Size(310, 32); + this.stammdatenImportierenToolStripMenuItem.Text = "Stammdaten importieren"; + this.stammdatenImportierenToolStripMenuItem.Click += new System.EventHandler(this.stammdatenImportierenToolStripMenuItem_Click); + // // speichernToolStripMenuItem // this.speichernToolStripMenuItem.Name = "speichernToolStripMenuItem"; - this.speichernToolStripMenuItem.Size = new System.Drawing.Size(71, 20); + this.speichernToolStripMenuItem.Size = new System.Drawing.Size(110, 32); this.speichernToolStripMenuItem.Text = "Speichern"; this.speichernToolStripMenuItem.Click += new System.EventHandler(this.speichernToolStripMenuItem_Click); // // massenstatistikToolStripMenuItem // this.massenstatistikToolStripMenuItem.Name = "massenstatistikToolStripMenuItem"; - this.massenstatistikToolStripMenuItem.Size = new System.Drawing.Size(99, 20); + this.massenstatistikToolStripMenuItem.Size = new System.Drawing.Size(156, 32); this.massenstatistikToolStripMenuItem.Text = "Massenstatistik"; this.massenstatistikToolStripMenuItem.Click += new System.EventHandler(this.massenstatistikToolStripMenuItem_Click); // @@ -100,35 +111,36 @@ 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, 351); + this.statusStrip1.Location = new System.Drawing.Point(0, 434); this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Size = new System.Drawing.Size(596, 22); + this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0); + this.statusStrip1.Size = new System.Drawing.Size(795, 25); 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(44, 17); + this.toolStripStatus_projekt_Label.Size = new System.Drawing.Size(55, 20); this.toolStripStatus_projekt_Label.Text = "Projekt"; // - // stammdatenImportierenToolStripMenuItem + // auftraggeberToolStripMenuItem // - this.stammdatenImportierenToolStripMenuItem.Name = "stammdatenImportierenToolStripMenuItem"; - this.stammdatenImportierenToolStripMenuItem.Size = new System.Drawing.Size(207, 22); - this.stammdatenImportierenToolStripMenuItem.Text = "Stammdaten importieren"; - this.stammdatenImportierenToolStripMenuItem.Click += new System.EventHandler(this.stammdatenImportierenToolStripMenuItem_Click); + this.auftraggeberToolStripMenuItem.Name = "auftraggeberToolStripMenuItem"; + this.auftraggeberToolStripMenuItem.Size = new System.Drawing.Size(310, 32); + this.auftraggeberToolStripMenuItem.Text = "Auftraggeber"; + this.auftraggeberToolStripMenuItem.Click += new System.EventHandler(this.auftraggeberToolStripMenuItem_Click); // // frmMain // - 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(596, 373); + this.ClientSize = new System.Drawing.Size(795, 459); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.mainmenu); this.IsMdiContainer = true; this.MainMenuStrip = this.mainmenu; - this.Margin = new System.Windows.Forms.Padding(2); + this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.Name = "frmMain"; this.Text = "Kanalsanierungsverwaltung"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frm_main_FormClosing); @@ -153,6 +165,7 @@ private System.Windows.Forms.ToolStripMenuItem speichernToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem massenstatistikToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem stammdatenImportierenToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem auftraggeberToolStripMenuItem; } } diff --git a/SanSystem/frmMain.cs b/SanSystem/frmMain.cs index dfbaaa0..b9dcb6d 100644 --- a/SanSystem/frmMain.cs +++ b/SanSystem/frmMain.cs @@ -141,5 +141,11 @@ namespace SanSystem strassenList.Show(); #endif } + + private void auftraggeberToolStripMenuItem_Click(object sender, EventArgs e) + { + FrmAuftraggeberEdit frmAuftraggeberEdit = new FrmAuftraggeberEdit(Datenbank.Instance.loadedProjekt.Auftraggeber); + frmAuftraggeberEdit.ShowDialog(); + } } }