From 4c6b644827d3bae9f1b8d4496035546274aacc50 Mon Sep 17 00:00:00 2001 From: Husky Date: Sat, 30 Jun 2018 13:59:14 +0200 Subject: [PATCH] =?UTF-8?q?Columns=20werden=20nach=20fehlertyp=20gef=C3=A4?= =?UTF-8?q?rbt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DE/DE.cs | 3 ++ SanSystem/frmObjekteList.Designer.cs | 70 +++++++++++++++++++++++++++- SanSystem/frmObjekteList.cs | 25 +++++++++- 3 files changed, 95 insertions(+), 3 deletions(-) diff --git a/DE/DE.cs b/DE/DE.cs index d3a9a53..bd2f40f 100644 --- a/DE/DE.cs +++ b/DE/DE.cs @@ -29,6 +29,9 @@ namespace Language labels.Add("street", "Strassenname"); labels.Add("add_objekt", "Neues Objekt hinzufügen"); labels.Add("btn_close", "Schließen"); + labels.Add("error_messages", "Fehlermeldungsarten"); + labels.Add("error_projwrong", "Projektnummer nicht vergeben"); + labels.Add("error_groundData", "Grunddaten sind nicht richtig vergeben"); } } diff --git a/SanSystem/frmObjekteList.Designer.cs b/SanSystem/frmObjekteList.Designer.cs index 06faf88..acca91e 100644 --- a/SanSystem/frmObjekteList.Designer.cs +++ b/SanSystem/frmObjekteList.Designer.cs @@ -42,8 +42,14 @@ this.txt_pro_nr_3 = new System.Windows.Forms.TextBox(); this.lbl_ort = new System.Windows.Forms.Label(); this.txt_ort = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.lbl_projwrong = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.lbl_grounddata = new System.Windows.Forms.Label(); + this.gb_error_messages = new System.Windows.Forms.GroupBox(); ((System.ComponentModel.ISupportInitialize)(this.dGObjekte)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.strasseBindingSource)).BeginInit(); + this.gb_error_messages.SuspendLayout(); this.SuspendLayout(); // // dGObjekte @@ -57,6 +63,7 @@ this.dGObjekte.RowTemplate.Height = 24; this.dGObjekte.Size = new System.Drawing.Size(957, 238); this.dGObjekte.TabIndex = 0; + this.dGObjekte.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dGObjekte_CellEndEdit); this.dGObjekte.DataBindingComplete += new System.Windows.Forms.DataGridViewBindingCompleteEventHandler(this.dGObjekte_DataBindingComplete); this.dGObjekte.RowHeaderMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dGObjekte_RowHeaderMouseDoubleClick); // @@ -67,7 +74,7 @@ this.btn_add.Name = "btn_add"; this.btn_add.Size = new System.Drawing.Size(102, 101); this.btn_add.TabIndex = 1; - this.btn_add.Text = "button1"; + this.btn_add.Text = "Hinzufügen"; this.btn_add.UseVisualStyleBackColor = true; this.btn_add.Click += new System.EventHandler(this.btn_add_Click); // @@ -161,11 +168,65 @@ this.txt_ort.Size = new System.Drawing.Size(235, 26); this.txt_ort.TabIndex = 11; // + // 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(15, 25); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(51, 20); + this.label1.TabIndex = 12; + this.label1.Text = "label1"; + // + // lbl_projwrong + // + this.lbl_projwrong.AutoSize = true; + this.lbl_projwrong.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_projwrong.Location = new System.Drawing.Point(75, 25); + this.lbl_projwrong.Name = "lbl_projwrong"; + this.lbl_projwrong.Size = new System.Drawing.Size(51, 20); + this.lbl_projwrong.TabIndex = 13; + this.lbl_projwrong.Text = "label2"; + // + // 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(15, 51); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(51, 20); + this.label5.TabIndex = 14; + this.label5.Text = "label5"; + // + // lbl_grounddata + // + this.lbl_grounddata.AutoSize = true; + this.lbl_grounddata.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_grounddata.Location = new System.Drawing.Point(75, 51); + this.lbl_grounddata.Name = "lbl_grounddata"; + this.lbl_grounddata.Size = new System.Drawing.Size(51, 20); + this.lbl_grounddata.TabIndex = 15; + this.lbl_grounddata.Text = "label6"; + // + // gb_error_messages + // + this.gb_error_messages.Controls.Add(this.lbl_projwrong); + this.gb_error_messages.Controls.Add(this.lbl_grounddata); + this.gb_error_messages.Controls.Add(this.label1); + this.gb_error_messages.Controls.Add(this.label5); + this.gb_error_messages.Location = new System.Drawing.Point(12, 384); + this.gb_error_messages.Name = "gb_error_messages"; + this.gb_error_messages.Size = new System.Drawing.Size(518, 103); + this.gb_error_messages.TabIndex = 16; + this.gb_error_messages.TabStop = false; + this.gb_error_messages.Text = "error_messages"; + // // frmObjekteList // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(971, 499); + this.Controls.Add(this.gb_error_messages); this.Controls.Add(this.txt_ort); this.Controls.Add(this.lbl_ort); this.Controls.Add(this.txt_pro_nr_3); @@ -184,6 +245,8 @@ this.Load += new System.EventHandler(this.frmObjekteList_Load); ((System.ComponentModel.ISupportInitialize)(this.dGObjekte)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.strasseBindingSource)).EndInit(); + this.gb_error_messages.ResumeLayout(false); + this.gb_error_messages.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -211,5 +274,10 @@ private System.Windows.Forms.TextBox txt_pro_nr_3; private System.Windows.Forms.Label lbl_ort; private System.Windows.Forms.TextBox txt_ort; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label lbl_projwrong; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label lbl_grounddata; + private System.Windows.Forms.GroupBox gb_error_messages; } } \ No newline at end of file diff --git a/SanSystem/frmObjekteList.cs b/SanSystem/frmObjekteList.cs index 5ce2437..70d1346 100644 --- a/SanSystem/frmObjekteList.cs +++ b/SanSystem/frmObjekteList.cs @@ -33,7 +33,14 @@ namespace SanSystem DataGridViewRow dgvw = dGObjekte.Rows[i]; Inspektionsobjekt tmp = (Inspektionsobjekt)dgvw.DataBoundItem; if (tmp == null) continue; - if(tmp.Projektnummer == null) dGObjekte.Rows[i].DefaultCellStyle.BackColor = Color.Red; + dgvw.DefaultCellStyle.BackColor = Color.White; + if ( + (tmp.BisPunkt== null || tmp.BisPunkt.Equals("")) + || (tmp.VonPunkt == null || tmp.VonPunkt.Equals("")) + || (tmp.Objektbezeichnung == null || tmp.Objektbezeichnung.Equals("")) + || tmp.Kanalrohrweite.Equals(0) + ) dgvw.DefaultCellStyle.BackColor = Color.Olive; + if(tmp.Projektnummer == null) dgvw.DefaultCellStyle.BackColor = Color.Red; } return true; @@ -49,6 +56,13 @@ namespace SanSystem btn_add.Text = Global.Instance.language.Labels["add_objekt"]; + gb_error_messages.Text = Global.Instance.language.Labels["error_messages"]; + lbl_grounddata.Text = Global.Instance.language.Labels["error_groundData"]; + lbl_projwrong.Text = Global.Instance.language.Labels["error_projwrong"]; + + label1.BackColor = Color.Red; + label5.BackColor = Color.Olive; + loadObjekte(streetname); txt_strasse.Text = streetname; @@ -126,9 +140,16 @@ namespace SanSystem private void dGObjekte_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) { - //dGObjekte.Rows[0].DefaultCellStyle.BackColor = Color.Red; CheckEntries(); + dGObjekte.Columns["StrasseName"].Visible = false; + dGObjekte.Columns["OrtName"].Visible = false; + dGObjekte.Columns["Projektnummer"].Visible = false; + dGObjekte.Columns["Sanierung"].Visible = false; + } + private void dGObjekte_CellEndEdit(object sender, DataGridViewCellEventArgs e) + { + CheckEntries(); } } }