diff --git a/SanSystem/FrmSelectNewSan.Designer.cs b/SanSystem/FrmSelectNewSan.Designer.cs
index e750eb7..59261b6 100644
--- a/SanSystem/FrmSelectNewSan.Designer.cs
+++ b/SanSystem/FrmSelectNewSan.Designer.cs
@@ -62,6 +62,7 @@
this.btn_kurzliner.TabIndex = 2;
this.btn_kurzliner.Text = "button3";
this.btn_kurzliner.UseVisualStyleBackColor = true;
+ this.btn_kurzliner.Click += new System.EventHandler(this.btn_kurzliner_Click);
//
// btn_hut
//
@@ -71,6 +72,7 @@
this.btn_hut.TabIndex = 3;
this.btn_hut.Text = "button4";
this.btn_hut.UseVisualStyleBackColor = true;
+ this.btn_hut.Click += new System.EventHandler(this.btn_hut_Click);
//
// FrmSelectNewSan
//
diff --git a/SanSystem/FrmSelectNewSan.cs b/SanSystem/FrmSelectNewSan.cs
index 9605979..c8657d6 100644
--- a/SanSystem/FrmSelectNewSan.cs
+++ b/SanSystem/FrmSelectNewSan.cs
@@ -14,6 +14,8 @@ namespace SanSystem
{
public event EventHandler AddInlinerClicked;
public event EventHandler AddSchachtAnbindungClicked;
+ public event EventHandler AddKurzlinerClicked;
+ public event EventHandler AddHutprofilClicked;
protected virtual void OnAddSchachtAnbindungClicked(EventArgs e)
{
@@ -25,16 +27,36 @@ namespace SanSystem
EventHandler handler = AddInlinerClicked;
if (handler != null) handler(this, e);
}
- public FrmSelectNewSan()
+ protected virtual void OnAddKurzlinerClicked(EventArgs e)
+ {
+ EventHandler handler = AddKurzlinerClicked;
+ if (handler != null) handler(this, e);
+ }
+ protected virtual void OnAddHutClicked(EventArgs e)
+ {
+ EventHandler handler = AddHutprofilClicked;
+ if (handler != null) handler(this, e);
+ }
+ ///
+ ///
+ ///
+ ///
+ public FrmSelectNewSan(int mod)
{
InitializeComponent();
+ SanArt sanArt = new SanArt(mod);
+
btn_inliner.Text = Global.Instance.language.Labels["inliner"];
btn_hut.Text = Global.Instance.language.Labels["hut"];
btn_kurzliner.Text = Global.Instance.language.Labels["kurzliner"];
btn_schacht_anb.Text = Global.Instance.language.Labels["schacht_an"];
- btn_hut.Enabled = btn_kurzliner.Enabled = false;
+ btn_inliner.Enabled = sanArt.SanierungActivated(Sanierungsarten.INLINER);
+ btn_kurzliner.Enabled = sanArt.SanierungActivated(Sanierungsarten.KURZLINER);
+ btn_hut.Enabled = sanArt.SanierungActivated(Sanierungsarten.HUTPROFIL);
+ btn_schacht_anb.Enabled = sanArt.SanierungActivated(Sanierungsarten.SCHACHTANBINDUNG);
+ //btn_hut.Enabled = btn_kurzliner.Enabled = false;
}
private void btn_inliner_Click(object sender, EventArgs e)
@@ -48,5 +70,17 @@ namespace SanSystem
OnAddSchachtAnbindungClicked(EventArgs.Empty);
this.Close();
}
+
+ private void btn_kurzliner_Click(object sender, EventArgs e)
+ {
+ OnAddKurzlinerClicked(EventArgs.Empty);
+ this.Close();
+ }
+
+ private void btn_hut_Click(object sender, EventArgs e)
+ {
+ OnAddHutClicked(EventArgs.Empty);
+ this.Close();
+ }
}
}
diff --git a/SanSystem/SanSystem.csproj b/SanSystem/SanSystem.csproj
index c90facd..2f0e7e2 100644
--- a/SanSystem/SanSystem.csproj
+++ b/SanSystem/SanSystem.csproj
@@ -141,6 +141,7 @@
+
UserControl
diff --git a/SanSystem/Sanierungsarten.cs b/SanSystem/Sanierungsarten.cs
new file mode 100644
index 0000000..c5b1141
--- /dev/null
+++ b/SanSystem/Sanierungsarten.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SanSystem
+{
+ enum Sanierungsarten
+ {
+ INLINER = 1,
+ SCHACHTANBINDUNG = 2,
+ KURZLINER = 4,
+ HUTPROFIL = 8,
+ QUICKLOCK = 16
+ }
+
+ class SanArt
+ {
+ private int mod;
+
+ public SanArt(int mod)
+ {
+ this.mod = mod;
+ }
+ public bool SanierungActivated(Sanierungsarten pm)
+ {
+ return (mod & (int)pm) == (int)pm;
+ }
+ }
+}
diff --git a/SanSystem/frmObjektEdit.cs b/SanSystem/frmObjektEdit.cs
index ed2c0b1..876ad75 100644
--- a/SanSystem/frmObjektEdit.cs
+++ b/SanSystem/frmObjektEdit.cs
@@ -109,7 +109,8 @@ namespace SanSystem
private void btn_add_san_Click(object sender, EventArgs e)
{
- FrmSelectNewSan frmSelectNewSan = new FrmSelectNewSan();
+ int mod = (int)Sanierungsarten.INLINER ^ (int)Sanierungsarten.SCHACHTANBINDUNG;
+ FrmSelectNewSan frmSelectNewSan = new FrmSelectNewSan(mod);
frmSelectNewSan.AddInlinerClicked += FrmSelectNewSan_AddInlinerClicked;
frmSelectNewSan.AddSchachtAnbindungClicked += FrmSelectNewSan_AddSchachtAnbindungClicked;