ObjekteList umgeändert

This commit is contained in:
Husky
2018-06-24 11:54:19 +02:00
parent 4ec720182b
commit 21060aa2a5
6 changed files with 162 additions and 26 deletions

View File

@@ -10,6 +10,7 @@ namespace KlassenBIB
[ContentProperty("Objekte")] [ContentProperty("Objekte")]
public class Strasse public class Strasse
{ {
public string Nummer { get; set; }
public string Strassename { get; set; } public string Strassename { get; set; }
public string Ort { get; set; } public string Ort { get; set; }

View File

@@ -30,8 +30,6 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.dGObjekte = new System.Windows.Forms.DataGridView(); this.dGObjekte = new System.Windows.Forms.DataGridView();
this.button1 = new System.Windows.Forms.Button();
this.strasseBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.objektbezeichnungDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.objektbezeichnungDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.vonPunktDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.vonPunktDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.bisPunktDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.bisPunktDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -39,6 +37,18 @@
this.kanalrohrweiteDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.kanalrohrweiteDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.haltungslaengeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.haltungslaengeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.sanierungDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.sanierungDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.strasseBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.txt_strasse = new System.Windows.Forms.TextBox();
this.txt_pro_nr_1 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txt_pro_nr_2 = new System.Windows.Forms.TextBox();
this.txt_pro_nr_3 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txt_ort = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.dGObjekte)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dGObjekte)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.strasseBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.strasseBindingSource)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
@@ -58,28 +68,13 @@
this.sanierungDataGridViewTextBoxColumn}); this.sanierungDataGridViewTextBoxColumn});
this.dGObjekte.DataMember = "Objekte"; this.dGObjekte.DataMember = "Objekte";
this.dGObjekte.DataSource = this.strasseBindingSource; this.dGObjekte.DataSource = this.strasseBindingSource;
this.dGObjekte.Location = new System.Drawing.Point(9, 10); this.dGObjekte.Location = new System.Drawing.Point(9, 133);
this.dGObjekte.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.dGObjekte.Margin = new System.Windows.Forms.Padding(2);
this.dGObjekte.Name = "dGObjekte"; this.dGObjekte.Name = "dGObjekte";
this.dGObjekte.RowTemplate.Height = 24; this.dGObjekte.RowTemplate.Height = 24;
this.dGObjekte.Size = new System.Drawing.Size(951, 361); this.dGObjekte.Size = new System.Drawing.Size(951, 238);
this.dGObjekte.TabIndex = 0; this.dGObjekte.TabIndex = 0;
// //
// button1
//
this.button1.Location = new System.Drawing.Point(763, 387);
this.button1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(102, 101);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// strasseBindingSource
//
this.strasseBindingSource.DataSource = typeof(KlassenBIB.Strasse);
//
// objektbezeichnungDataGridViewTextBoxColumn // objektbezeichnungDataGridViewTextBoxColumn
// //
this.objektbezeichnungDataGridViewTextBoxColumn.DataPropertyName = "Objektbezeichnung"; this.objektbezeichnungDataGridViewTextBoxColumn.DataPropertyName = "Objektbezeichnung";
@@ -123,20 +118,136 @@
this.sanierungDataGridViewTextBoxColumn.Name = "sanierungDataGridViewTextBoxColumn"; this.sanierungDataGridViewTextBoxColumn.Name = "sanierungDataGridViewTextBoxColumn";
this.sanierungDataGridViewTextBoxColumn.Visible = false; this.sanierungDataGridViewTextBoxColumn.Visible = false;
// //
// strasseBindingSource
//
this.strasseBindingSource.DataSource = typeof(KlassenBIB.Strasse);
//
// button1
//
this.button1.Location = new System.Drawing.Point(763, 387);
this.button1.Margin = new System.Windows.Forms.Padding(2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(102, 101);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// 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(6, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(104, 20);
this.label1.TabIndex = 2;
this.label1.Text = "Strassename";
//
// 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(6, 49);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(116, 20);
this.label2.TabIndex = 3;
this.label2.Text = "Projektnummer";
//
// 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(157, 6);
this.txt_strasse.Name = "txt_strasse";
this.txt_strasse.Size = new System.Drawing.Size(352, 26);
this.txt_strasse.TabIndex = 4;
//
// txt_pro_nr_1
//
this.txt_pro_nr_1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_pro_nr_1.Location = new System.Drawing.Point(157, 46);
this.txt_pro_nr_1.Name = "txt_pro_nr_1";
this.txt_pro_nr_1.Size = new System.Drawing.Size(100, 26);
this.txt_pro_nr_1.TabIndex = 5;
//
// 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(263, 49);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(14, 20);
this.label3.TabIndex = 6;
this.label3.Text = "-";
//
// 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(389, 49);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(14, 20);
this.label4.TabIndex = 7;
this.label4.Text = "-";
//
// txt_pro_nr_2
//
this.txt_pro_nr_2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_pro_nr_2.Location = new System.Drawing.Point(283, 46);
this.txt_pro_nr_2.Name = "txt_pro_nr_2";
this.txt_pro_nr_2.Size = new System.Drawing.Size(100, 26);
this.txt_pro_nr_2.TabIndex = 8;
//
// txt_pro_nr_3
//
this.txt_pro_nr_3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_pro_nr_3.Location = new System.Drawing.Point(409, 46);
this.txt_pro_nr_3.Name = "txt_pro_nr_3";
this.txt_pro_nr_3.Size = new System.Drawing.Size(100, 26);
this.txt_pro_nr_3.TabIndex = 9;
//
// 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(549, 9);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(31, 20);
this.label5.TabIndex = 10;
this.label5.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(604, 6);
this.txt_ort.Name = "txt_ort";
this.txt_ort.Size = new System.Drawing.Size(235, 26);
this.txt_ort.TabIndex = 11;
//
// frmObjekteList // frmObjekteList
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(971, 499); this.ClientSize = new System.Drawing.Size(971, 499);
this.Controls.Add(this.txt_ort);
this.Controls.Add(this.label5);
this.Controls.Add(this.txt_pro_nr_3);
this.Controls.Add(this.txt_pro_nr_2);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.txt_pro_nr_1);
this.Controls.Add(this.txt_strasse);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.button1); this.Controls.Add(this.button1);
this.Controls.Add(this.dGObjekte); this.Controls.Add(this.dGObjekte);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "frmObjekteList"; this.Name = "frmObjekteList";
this.Text = "frmObjekteList"; this.Text = "frmObjekteList";
this.Load += new System.EventHandler(this.frmObjekteList_Load); this.Load += new System.EventHandler(this.frmObjekteList_Load);
((System.ComponentModel.ISupportInitialize)(this.dGObjekte)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dGObjekte)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.strasseBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.strasseBindingSource)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
@@ -152,5 +263,15 @@
private System.Windows.Forms.DataGridViewTextBoxColumn haltungslaengeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn haltungslaengeDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn sanierungDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn sanierungDataGridViewTextBoxColumn;
private System.Windows.Forms.BindingSource strasseBindingSource; private System.Windows.Forms.BindingSource strasseBindingSource;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txt_strasse;
private System.Windows.Forms.TextBox txt_pro_nr_1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txt_pro_nr_2;
private System.Windows.Forms.TextBox txt_pro_nr_3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txt_ort;
} }
} }

View File

@@ -28,6 +28,11 @@ namespace SanSystem
//dGObjekte.BindingContext = strasse.Objekte; //dGObjekte.BindingContext = strasse.Objekte;
//dGObjekte.DataSource = strasse.Objekte;// bs; //strasse.Objekte; //dGObjekte.DataSource = strasse.Objekte;// bs; //strasse.Objekte;
//dGObjekte.AutoGenerateColumns = false; //dGObjekte.AutoGenerateColumns = false;
txt_strasse.DataBindings.Add(new Binding("Text", strasse, "Strassename"));
txt_ort.DataBindings.Add(new Binding("Text", strasse, "Ort"));
txt_pro_nr_3.DataBindings.Add(new Binding("Text", strasse, "Nummer"));
} }
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)

View File

@@ -120,7 +120,4 @@
<metadata name="strasseBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="strasseBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="strasseBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>

View File

@@ -36,11 +36,12 @@
// //
this.lst_strassen.FormattingEnabled = true; this.lst_strassen.FormattingEnabled = true;
this.lst_strassen.Location = new System.Drawing.Point(7, 15); this.lst_strassen.Location = new System.Drawing.Point(7, 15);
this.lst_strassen.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.lst_strassen.Margin = new System.Windows.Forms.Padding(2);
this.lst_strassen.Name = "lst_strassen"; this.lst_strassen.Name = "lst_strassen";
this.lst_strassen.Size = new System.Drawing.Size(190, 277); this.lst_strassen.Size = new System.Drawing.Size(190, 277);
this.lst_strassen.TabIndex = 0; this.lst_strassen.TabIndex = 0;
this.lst_strassen.SelectedIndexChanged += new System.EventHandler(this.lst_strassen_SelectedIndexChanged); this.lst_strassen.SelectedIndexChanged += new System.EventHandler(this.lst_strassen_SelectedIndexChanged);
this.lst_strassen.DoubleClick += new System.EventHandler(this.lst_strassen_DoubleClick);
// //
// button1 // button1
// //
@@ -60,7 +61,7 @@
this.ControlBox = false; this.ControlBox = false;
this.Controls.Add(this.button1); this.Controls.Add(this.button1);
this.Controls.Add(this.lst_strassen); this.Controls.Add(this.lst_strassen);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "frmStrassenList"; this.Name = "frmStrassenList";
this.Text = "frmStrassenList"; this.Text = "frmStrassenList";
this.Load += new System.EventHandler(this.frmStrassenList_Load); this.Load += new System.EventHandler(this.frmStrassenList_Load);

View File

@@ -32,6 +32,7 @@ namespace SanSystem
private void lst_strassen_SelectedIndexChanged(object sender, EventArgs e) private void lst_strassen_SelectedIndexChanged(object sender, EventArgs e)
{ {
return;
KlassenBIB.Strasse strasse = ((sender as ListBox).SelectedItem as KlassenBIB.Strasse); KlassenBIB.Strasse strasse = ((sender as ListBox).SelectedItem as KlassenBIB.Strasse);
if (strasse == null) return; if (strasse == null) return;
frmObjekteList objekteList = new frmObjekteList(strasse); frmObjekteList objekteList = new frmObjekteList(strasse);
@@ -45,5 +46,15 @@ namespace SanSystem
bs.ResetBindings(false); bs.ResetBindings(false);
} }
private void lst_strassen_DoubleClick(object sender, EventArgs e)
{
KlassenBIB.Strasse str = (KlassenBIB.Strasse)(sender as ListBox).SelectedItem;
if (str == null) return;
frmObjekteList frmObjekteList = new frmObjekteList(str);
frmObjekteList.MdiParent = this.MdiParent;
frmObjekteList.Show();
}
} }
} }