Strassenliste geändert

This commit is contained in:
Husky
2018-06-07 19:37:58 +02:00
parent 5dec70e3e4
commit cd0b99fa51
4 changed files with 39 additions and 8 deletions

BIN
Klassenbib.WibuAxProject Normal file

Binary file not shown.

View File

@@ -14,14 +14,18 @@ namespace SanSystem
{ {
public partial class frmObjekteList : Form public partial class frmObjekteList : Form
{ {
ObservableCollection<Strasse> street = new ObservableCollection<Strasse>(); AdresseCollection street = new AdresseCollection();
BindingSource bs = new BindingSource();
Strasse strasse = null; Strasse strasse = null;
public frmObjekteList(Strasse strasse) public frmObjekteList(Strasse strasse)
{ {
InitializeComponent(); InitializeComponent();
bs.DataSource = street;
this.strasse = strasse; this.strasse = strasse;
dGObjekte.DataSource = street; //strasse.Objekte; dGObjekte.DataSource = bs; //strasse.Objekte;
} }
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)

View File

@@ -29,25 +29,38 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.lst_strassen = new System.Windows.Forms.ListBox(); this.lst_strassen = new System.Windows.Forms.ListBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout(); this.SuspendLayout();
// //
// lst_strassen // lst_strassen
// //
this.lst_strassen.FormattingEnabled = true; this.lst_strassen.FormattingEnabled = true;
this.lst_strassen.ItemHeight = 16; this.lst_strassen.Location = new System.Drawing.Point(7, 15);
this.lst_strassen.Location = new System.Drawing.Point(9, 19); this.lst_strassen.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.lst_strassen.Name = "lst_strassen"; this.lst_strassen.Name = "lst_strassen";
this.lst_strassen.Size = new System.Drawing.Size(252, 340); 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);
// //
// button1
//
this.button1.Location = new System.Drawing.Point(57, 305);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(89, 42);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// frmStrassenList // frmStrassenList
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); 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(282, 392); this.ClientSize = new System.Drawing.Size(212, 367);
this.ControlBox = false; this.ControlBox = false;
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.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);
@@ -58,5 +71,6 @@
#endregion #endregion
private System.Windows.Forms.ListBox lst_strassen; private System.Windows.Forms.ListBox lst_strassen;
private System.Windows.Forms.Button button1;
} }
} }

View File

@@ -14,6 +14,8 @@ namespace SanSystem
{ {
public partial class frmStrassenList : Form public partial class frmStrassenList : Form
{ {
BindingSource bs = new BindingSource();
public frmStrassenList() public frmStrassenList()
{ {
InitializeComponent(); InitializeComponent();
@@ -21,8 +23,12 @@ namespace SanSystem
private void frmStrassenList_Load(object sender, EventArgs e) private void frmStrassenList_Load(object sender, EventArgs e)
{ {
lst_strassen.DataSource = Datenbank.Instance.loadedProjekt.Adressen; bs.DataSource = Datenbank.Instance.loadedProjekt.Adressen;
lst_strassen.DataSource = bs;
} }
private void lst_strassen_SelectedIndexChanged(object sender, EventArgs e) private void lst_strassen_SelectedIndexChanged(object sender, EventArgs e)
{ {
@@ -32,5 +38,12 @@ namespace SanSystem
objekteList.MdiParent = this.MdiParent; objekteList.MdiParent = this.MdiParent;
objekteList.Show(); objekteList.Show();
} }
private void button1_Click(object sender, EventArgs e)
{
Datenbank.Instance.loadedProjekt.Adressen.Add(new KlassenBIB.Strasse() { Strassename = "Damian" });
bs.ResetBindings(false);
}
} }
} }