Angefangen umzuschreiben auf andere DB struktur

This commit is contained in:
Husky
2018-06-24 22:14:25 +02:00
parent e0d7cf03d1
commit 2aa414665d
16 changed files with 221 additions and 169 deletions

View File

@@ -30,12 +30,13 @@ namespace SanSystem
Projekt projekt = Datenbank.Instance.loadedProjekt;
AdresseCollection adressen = projekt.Adressen;
//dresseCollection adressen = projekt.Adressen;
/*
adressen[0].Objekte.Add(new Inspektionsobjekt()
{
Objektbezeichnung = "SW01"
});
*/
Datenbank.Instance.SaveProjekt();
}

View File

@@ -36,7 +36,6 @@
this.txt_strasse = new System.Windows.Forms.TextBox();
this.label19 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.txt_material = new System.Windows.Forms.TextBox();
this.txt_dn = new System.Windows.Forms.TextBox();
this.txt_punkt_bis = new System.Windows.Forms.TextBox();
this.txt_punkt_von = new System.Windows.Forms.TextBox();
@@ -65,10 +64,10 @@
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker();
this.txt_walze_distance = new System.Windows.Forms.TextBox();
this.txt_temp_harz = new System.Windows.Forms.TextBox();
this.txt_vakuum = new System.Windows.Forms.TextBox();
this.dt_kalibrierdatum = new System.Windows.Forms.DateTimePicker();
this.txt_charge_harz = new System.Windows.Forms.TextBox();
this.txt_charge_liner = new System.Windows.Forms.TextBox();
this.txt_harz = new System.Windows.Forms.TextBox();
@@ -85,6 +84,9 @@
this.txt_temp_aussen = new System.Windows.Forms.TextBox();
this.txt_temp_kanal = new System.Windows.Forms.TextBox();
this.btn_get_temp = new System.Windows.Forms.Button();
this.label24 = new System.Windows.Forms.Label();
this.cbb_wetter = new System.Windows.Forms.ComboBox();
this.cb_material = new System.Windows.Forms.ComboBox();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
@@ -108,6 +110,9 @@
//
// tabPage1
//
this.tabPage1.Controls.Add(this.cb_material);
this.tabPage1.Controls.Add(this.cbb_wetter);
this.tabPage1.Controls.Add(this.label24);
this.tabPage1.Controls.Add(this.groupBox2);
this.tabPage1.Controls.Add(this.dateTimePicker1);
this.tabPage1.Controls.Add(this.label20);
@@ -115,7 +120,6 @@
this.tabPage1.Controls.Add(this.txt_strasse);
this.tabPage1.Controls.Add(this.label19);
this.tabPage1.Controls.Add(this.label18);
this.tabPage1.Controls.Add(this.txt_material);
this.tabPage1.Controls.Add(this.txt_dn);
this.tabPage1.Controls.Add(this.txt_punkt_bis);
this.tabPage1.Controls.Add(this.txt_punkt_von);
@@ -195,15 +199,6 @@
this.label18.TabIndex = 12;
this.label18.Text = "Strasse";
//
// txt_material
//
this.txt_material.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_material.Location = new System.Drawing.Point(192, 223);
this.txt_material.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txt_material.Name = "txt_material";
this.txt_material.Size = new System.Drawing.Size(330, 26);
this.txt_material.TabIndex = 10;
//
// txt_dn
//
this.txt_dn.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@@ -420,10 +415,10 @@
//
// groupBox1
//
this.groupBox1.Controls.Add(this.dateTimePicker2);
this.groupBox1.Controls.Add(this.textBox3);
this.groupBox1.Controls.Add(this.textBox2);
this.groupBox1.Controls.Add(this.textBox1);
this.groupBox1.Controls.Add(this.dt_kalibrierdatum);
this.groupBox1.Controls.Add(this.txt_vakuum);
this.groupBox1.Controls.Add(this.txt_temp_harz);
this.groupBox1.Controls.Add(this.txt_walze_distance);
this.groupBox1.Controls.Add(this.label17);
this.groupBox1.Controls.Add(this.label14);
this.groupBox1.Controls.Add(this.label16);
@@ -433,7 +428,7 @@
this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.groupBox1.Size = new System.Drawing.Size(753, 328);
this.groupBox1.Size = new System.Drawing.Size(688, 278);
this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Kalibrierung";
@@ -537,41 +532,41 @@
this.label9.TabIndex = 0;
this.label9.Text = "Harz";
//
// textBox1
// txt_walze_distance
//
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox1.Location = new System.Drawing.Point(212, 118);
this.textBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(148, 26);
this.textBox1.TabIndex = 9;
this.txt_walze_distance.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_walze_distance.Location = new System.Drawing.Point(212, 118);
this.txt_walze_distance.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txt_walze_distance.Name = "txt_walze_distance";
this.txt_walze_distance.Size = new System.Drawing.Size(148, 26);
this.txt_walze_distance.TabIndex = 9;
//
// textBox2
// txt_temp_harz
//
this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox2.Location = new System.Drawing.Point(212, 231);
this.textBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(148, 26);
this.textBox2.TabIndex = 10;
this.txt_temp_harz.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_temp_harz.Location = new System.Drawing.Point(212, 232);
this.txt_temp_harz.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txt_temp_harz.Name = "txt_temp_harz";
this.txt_temp_harz.Size = new System.Drawing.Size(148, 26);
this.txt_temp_harz.TabIndex = 10;
//
// textBox3
// txt_vakuum
//
this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox3.Location = new System.Drawing.Point(518, 118);
this.textBox3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(148, 26);
this.textBox3.TabIndex = 11;
this.txt_vakuum.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_vakuum.Location = new System.Drawing.Point(518, 118);
this.txt_vakuum.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txt_vakuum.Name = "txt_vakuum";
this.txt_vakuum.Size = new System.Drawing.Size(148, 26);
this.txt_vakuum.TabIndex = 11;
//
// dateTimePicker2
// dt_kalibrierdatum
//
this.dateTimePicker2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dateTimePicker2.Location = new System.Drawing.Point(212, 48);
this.dateTimePicker2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.dateTimePicker2.Name = "dateTimePicker2";
this.dateTimePicker2.Size = new System.Drawing.Size(439, 26);
this.dateTimePicker2.TabIndex = 12;
this.dt_kalibrierdatum.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dt_kalibrierdatum.Location = new System.Drawing.Point(212, 48);
this.dt_kalibrierdatum.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.dt_kalibrierdatum.Name = "dt_kalibrierdatum";
this.dt_kalibrierdatum.Size = new System.Drawing.Size(283, 26);
this.dt_kalibrierdatum.TabIndex = 12;
//
// txt_charge_harz
//
@@ -624,9 +619,9 @@
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(121, 24);
this.checkBox1.Size = new System.Drawing.Size(172, 24);
this.checkBox1.TabIndex = 20;
this.checkBox1.Text = "Geschlossen";
this.checkBox1.Text = "Geschlossene Ende";
this.checkBox1.UseVisualStyleBackColor = true;
//
// groupBox2
@@ -649,9 +644,9 @@
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(68, 20);
this.label21.Size = new System.Drawing.Size(107, 20);
this.label21.TabIndex = 21;
this.label21.Text = "Schacht";
this.label21.Text = "Schachtlänge";
//
// txt_laenge_schacht
//
@@ -724,11 +719,74 @@
this.btn_get_temp.Text = "Von Anlage holen";
this.btn_get_temp.UseVisualStyleBackColor = true;
//
// label24
//
this.label24.AutoSize = true;
this.label24.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label24.Location = new System.Drawing.Point(561, 157);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(57, 20);
this.label24.TabIndex = 22;
this.label24.Text = "Wetter";
//
// cbb_wetter
//
this.cbb_wetter.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cbb_wetter.FormattingEnabled = true;
this.cbb_wetter.Location = new System.Drawing.Point(758, 154);
this.cbb_wetter.Name = "cbb_wetter";
this.cbb_wetter.Size = new System.Drawing.Size(282, 28);
this.cbb_wetter.TabIndex = 23;
//
// cb_material
//
this.cb_material.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cb_material.FormattingEnabled = true;
this.cb_material.Items.AddRange(new object[] {
"Asbestzement",
"Beton",
"Betonsegment",
"Duktiles Gusseisen",
"Edelstahl",
"Faserzement",
"Glasfaserverstärkter Kunststoff",
"Grauguss",
"Mauerwerk",
"Nichtidenfizierter Kunststoff",
"Nichtidentifizierter Werkstoff",
"Nichtidentifiziertes Eisen und Stahl",
"Ortbeton",
"Pflaster",
"Polyesterharz",
"Polyesterharzbeton",
"Polyethylen",
"Polyethylen hoher Dichte",
"Polymerbeton",
"Polymermodifizierter Zementbeton",
"Polypropylen",
"Polyvinylchlorid ",
"Polyvinylchlorid hart",
"Porosit",
"Rasen",
"Spannbeton",
"Spritzbeton",
"Stahl",
"Stahlbeton",
"Stahlfaserbeton",
"Steinzeug",
"unbefestigt, anstehender Boden",
"unterschiedliche Werkstoffe",
"Ziegelwerk"});
this.cb_material.Location = new System.Drawing.Point(192, 225);
this.cb_material.Name = "cb_material";
this.cb_material.Size = new System.Drawing.Size(323, 28);
this.cb_material.TabIndex = 24;
//
// frmObjektEdit
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1131, 701);
this.ClientSize = new System.Drawing.Size(1131, 643);
this.Controls.Add(this.tabControl1);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
@@ -763,7 +821,6 @@
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txt_material;
private System.Windows.Forms.TextBox txt_dn;
private System.Windows.Forms.TextBox txt_punkt_bis;
private System.Windows.Forms.TextBox txt_punkt_von;
@@ -796,10 +853,10 @@
private System.Windows.Forms.TextBox txt_harz;
private System.Windows.Forms.TextBox txt_charge_liner;
private System.Windows.Forms.TextBox txt_charge_harz;
private System.Windows.Forms.DateTimePicker dateTimePicker2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.DateTimePicker dt_kalibrierdatum;
private System.Windows.Forms.TextBox txt_vakuum;
private System.Windows.Forms.TextBox txt_temp_harz;
private System.Windows.Forms.TextBox txt_walze_distance;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.MaskedTextBox txt_haltungslaenge;
private System.Windows.Forms.MaskedTextBox txt_laenge_schacht;
@@ -811,5 +868,8 @@
private System.Windows.Forms.TextBox txt_temp_aussen;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.ComboBox cbb_wetter;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.ComboBox cb_material;
}
}

View File

@@ -14,17 +14,19 @@ namespace SanSystem
public partial class frmObjektEdit : Form
{
Inspektionsobjekt inspektionsobjekt = null;
InlinerSanierung inliner = null;
public frmObjektEdit(Inspektionsobjekt inspektion)
{
InitializeComponent();
this.inspektionsobjekt = inspektion;
this.inliner = (InlinerSanierung)inspektion.Sanierung;
}
private void frmObjektEdit_Load(object sender, EventArgs e)
{
txt_punkt_von.DataBindings.Add(new Binding("Text", inspektionsobjekt, "VonPunkt"));
txt_punkt_bis.DataBindings.Add(new Binding("Text", inspektionsobjekt, "BisPunkt"));
txt_material.DataBindings.Add(new Binding("Text", inspektionsobjekt, "Rohrmaterial"));
cb_material.DataBindings.Add(new Binding("Text", inspektionsobjekt, "RohrMaterial"));
txt_haltungslaenge.DataBindings.Add(new Binding("Text", inspektionsobjekt, "Haltungslaenge"));
txt_dn.DataBindings.Add(new Binding("Text", inspektionsobjekt, "Kanalrohrweite"));
txt_temp_aussen.DataBindings.Add(new Binding("Text", inspektionsobjekt.Sanierung, "TempAusen"));
@@ -33,6 +35,18 @@ namespace SanSystem
cb_genehmigung.DataBindings.Add(new Binding("Checked", inspektionsobjekt.Sanierung, "genehmigungVorhanden"));
cb_stvo.DataBindings.Add(new Binding("Checked", inspektionsobjekt.Sanierung, "sTVOAbsicherung"));
cb_wasserhaltung.DataBindings.Add(new Binding("Checked", inspektionsobjekt.Sanierung, "wasserhaltungEingerichtet"));
//
txt_walze_distance.DataBindings.Add(new Binding("Text", inspektionsobjekt.Sanierung, "KalibierWalzenAbstand"));
txt_vakuum.DataBindings.Add(new Binding("Text", inspektionsobjekt.Sanierung, "KalibrierUnterdruck"));
txt_temp_harz.DataBindings.Add(new Binding("Text", inspektionsobjekt.Sanierung, "HarzKalibrierTemperatur"));
txt_charge_harz.DataBindings.Add(new Binding("Text", inspektionsobjekt.Sanierung, "HarzChargenummer"));
txt_charge_liner.DataBindings.Add(new Binding("Text", inspektionsobjekt.Sanierung, "LinerChargenummer"));
dt_kalibrierdatum.DataBindings.Add(new Binding("Value", inliner, "DatumKalibrierung"));
//dt_kalibrierdatum.Value = inspektionsobjekt.Sanierung.
}
}
}

View File

@@ -122,7 +122,7 @@
//
// strasseBindingSource
//
this.strasseBindingSource.DataSource = typeof(KlassenBIB.Strasse);
//this.strasseBindingSource.DataSource = typeof(KlassenBIB.Strasse);
//
// button1
//

View File

@@ -14,25 +14,24 @@ namespace SanSystem
{
public partial class frmObjekteList : Form
{
AdresseCollection street = new AdresseCollection();
BindingSource bs = new BindingSource();
Strasse strasse = null;
public frmObjekteList(Strasse strasse)
public frmObjekteList(string streetname)
{
InitializeComponent();
bs.DataSource = street;
this.strasse = strasse;
//dGObjekte.BindingContext = strasse.Objekte;
//dGObjekte.DataSource = strasse.Objekte;// bs; //strasse.Objekte;
//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)
@@ -42,19 +41,19 @@ namespace SanSystem
Strassename = "XSSD"
});
*/
/*
strasse.Objekte.Add(new Inspektionsobjekt()
{
Objektbezeichnung = "134"
});
dGObjekte.DataSource = null;
dGObjekte.DataSource = strasse.Objekte;
*/
}
private void frmObjekteList_Load(object sender, EventArgs e)
{
dGObjekte.DataSource = strasse.Objekte;
//dGObjekte.DataSource = strasse.Objekte;
}
private void dGObjekte_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)

View File

@@ -24,10 +24,10 @@ namespace SanSystem
private void frmStrassenList_Load(object sender, EventArgs e)
{
bs.DataSource = Datenbank.Instance.loadedProjekt.Adressen;
List<string> strassen = Database.Datenbank.Instance.loadedProjekt.Objekte.Select(x => x.StrasseName).Distinct().ToList();
bs.DataSource = strassen;
lst_strassen.DataSource = bs;
this.Height = this.MdiParent.Height - 120;
}
@@ -36,11 +36,7 @@ namespace SanSystem
private void lst_strassen_SelectedIndexChanged(object sender, EventArgs e)
{
return;
KlassenBIB.Strasse strasse = ((sender as ListBox).SelectedItem as KlassenBIB.Strasse);
if (strasse == null) return;
frmObjekteList objekteList = new frmObjekteList(strasse);
objekteList.MdiParent = this.MdiParent;
objekteList.Show();
}
private void button1_Click(object sender, EventArgs e)
@@ -52,12 +48,13 @@ namespace SanSystem
private void lst_strassen_DoubleClick(object sender, EventArgs e)
{
KlassenBIB.Strasse str = (KlassenBIB.Strasse)(sender as ListBox).SelectedItem;
string selectedStreetName = (sender as ListBox).SelectedItem.ToString();
if (selectedStreetName == null) return;
if (str == null) return;
frmObjekteList frmObjekteList = new frmObjekteList(str);
frmObjekteList frmObjekteList = new frmObjekteList(selectedStreetName);
frmObjekteList.MdiParent = this.MdiParent;
frmObjekteList.Show();
}
}
}