diff --git a/SanSystem/Program.cs b/SanSystem/Program.cs index a6fe33a..55b1048 100644 --- a/SanSystem/Program.cs +++ b/SanSystem/Program.cs @@ -24,7 +24,7 @@ namespace SanSystem MessageBox.Show("Bitte nur 1 Instanz starten der Software!", "", MessageBoxButtons.OK, MessageBoxIcon.Hand); Environment.Exit(1); } -#if !DEBUG +//#if !DEBUG try { using (Dongle dongle = new Dongle(60)) @@ -48,11 +48,11 @@ namespace SanSystem MessageBox.Show("Sorry es wurde kein Dongle gefunden!\n" + ex.Message); Application.Exit(); } -#else +/*#else Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain()); -#endif +#endif*/ } } diff --git a/SanSystem/ProgrammModule.cs b/SanSystem/ProgrammModule.cs index 72430a3..571c749 100644 --- a/SanSystem/ProgrammModule.cs +++ b/SanSystem/ProgrammModule.cs @@ -14,6 +14,8 @@ namespace SanSystem HUTPROFIL = 8, QUICKLOCK = 16, DICHTHEITSPRÜFUNG = 32, + STAMMDATEN = 64, + BUEROEXPORTER = 128, } class ProgrammModules diff --git a/SanSystem/SanShared/Dongle.cs b/SanSystem/SanShared/Dongle.cs index e9f3bb4..9ddd07d 100644 --- a/SanSystem/SanShared/Dongle.cs +++ b/SanSystem/SanShared/Dongle.cs @@ -24,15 +24,15 @@ namespace SanShared public Dongle(uint ProductCode) { -#if !DEBUG +//if !DEBUG this.FirmCode = 103086; this.ProductCode = ProductCode; -#else +/*#else return; this.FirmCode = 10; this.ProductCode = 1; #endif - +*/ cmApi = new Api(); cmCred = new CmCredential(); @@ -102,22 +102,15 @@ namespace SanShared public void CleanDongle() { -#if DEBUG - return; -#endif cmApi.CmRelease(hcmse); } public bool CheckDongleVorhanden() { -#if LAPTOP - return true; -#else if (hcmse == null) return false; else return true; -#endif } public string GetDongleSerial() @@ -146,9 +139,6 @@ namespace SanShared public bool IsLicensed(byte neededMask) { -#if DEBUG - return true; -#else uint DongleFeature = GetFeatureMap(); //Trace.WriteLine("DongleFeature: " + DongleFeature); @@ -158,7 +148,6 @@ namespace SanShared if ((DongleFeatureB & neededMask) == neededMask) return true; return false; -#endif } public void Dispose() diff --git a/SanSystem/UCInliner.cs b/SanSystem/UCInliner.cs index 22c66ef..687b45e 100644 --- a/SanSystem/UCInliner.cs +++ b/SanSystem/UCInliner.cs @@ -71,7 +71,7 @@ namespace SanSystem { using(Dongle dongle = new Dongle(60)) { - btn_gen_dp.Enabled = dongle.IsLicensed((byte)AktivierteModule.SCHLAUCHLINER) ? true : false; + btn_gen_dp.Enabled = dongle.IsLicensed((byte)AktivierteModule.DICHTHEITSPRÜFUNG) ? true : false; dongle.CleanDongle(); } CheckDirectories(); diff --git a/SanSystem/frmMain.Designer.cs b/SanSystem/frmMain.Designer.cs index 63ebe6b..52a0bf4 100644 --- a/SanSystem/frmMain.Designer.cs +++ b/SanSystem/frmMain.Designer.cs @@ -39,20 +39,20 @@ this.auftraggeberToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.prefixSuffixToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportFürBüroErstellenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.speichernToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.einstellungenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.projektordnerÖffnenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.berichteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.massenberichteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.verbrauchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.imprägnierberichteToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.massenstatistikToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.infoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripStatus_projekt_Label = new System.Windows.Forms.ToolStripStatusLabel(); this.toolstrip_gesamtLiner = new System.Windows.Forms.ToolStripStatusLabel(); this.toolstrip_messages = new System.Windows.Forms.ToolStripStatusLabel(); this.update = new UpdateLib.Updater(); - this.speichernToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.imprägnierberichteToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.massenstatistikToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.einstellungenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.infoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mainmenu.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.SuspendLayout(); @@ -129,11 +129,26 @@ this.exportFürBüroErstellenToolStripMenuItem.Text = "Export für Büro erstellen"; this.exportFürBüroErstellenToolStripMenuItem.Click += new System.EventHandler(this.exportFürBüroErstellenToolStripMenuItem_Click); // + // speichernToolStripMenuItem1 + // + this.speichernToolStripMenuItem1.Name = "speichernToolStripMenuItem1"; + this.speichernToolStripMenuItem1.Size = new System.Drawing.Size(254, 26); + this.speichernToolStripMenuItem1.Text = "Speichern"; + this.speichernToolStripMenuItem1.Click += new System.EventHandler(this.speichernToolStripMenuItem1_Click); + // + // einstellungenToolStripMenuItem + // + this.einstellungenToolStripMenuItem.Name = "einstellungenToolStripMenuItem"; + this.einstellungenToolStripMenuItem.Size = new System.Drawing.Size(254, 26); + this.einstellungenToolStripMenuItem.Text = "Einstellungen"; + this.einstellungenToolStripMenuItem.Click += new System.EventHandler(this.einstellungenToolStripMenuItem_Click); + // // projektordnerÖffnenToolStripMenuItem // this.projektordnerÖffnenToolStripMenuItem.Name = "projektordnerÖffnenToolStripMenuItem"; this.projektordnerÖffnenToolStripMenuItem.Size = new System.Drawing.Size(170, 25); this.projektordnerÖffnenToolStripMenuItem.Text = "Projektordner Öffnen"; + this.projektordnerÖffnenToolStripMenuItem.ToolTipText = "Öffnet die interne Ordner Struktur wo alle Daten vorhanden sind"; this.projektordnerÖffnenToolStripMenuItem.Click += new System.EventHandler(this.ProjektordnerÖffnenToolStripMenuItem_Click); // // berichteToolStripMenuItem @@ -161,6 +176,27 @@ this.verbrauchToolStripMenuItem.Text = "Verbrauch"; this.verbrauchToolStripMenuItem.Click += new System.EventHandler(this.VerbrauchToolStripMenuItem_Click); // + // imprägnierberichteToolStripMenuItem1 + // + this.imprägnierberichteToolStripMenuItem1.Name = "imprägnierberichteToolStripMenuItem1"; + this.imprägnierberichteToolStripMenuItem1.Size = new System.Drawing.Size(213, 26); + this.imprägnierberichteToolStripMenuItem1.Text = "Imprägnierberichte"; + this.imprägnierberichteToolStripMenuItem1.Click += new System.EventHandler(this.imprägnierberichteToolStripMenuItem1_Click); + // + // massenstatistikToolStripMenuItem1 + // + this.massenstatistikToolStripMenuItem1.Name = "massenstatistikToolStripMenuItem1"; + this.massenstatistikToolStripMenuItem1.Size = new System.Drawing.Size(213, 26); + this.massenstatistikToolStripMenuItem1.Text = "Massenstatistik"; + this.massenstatistikToolStripMenuItem1.Click += new System.EventHandler(this.massenstatistikToolStripMenuItem1_Click); + // + // infoToolStripMenuItem + // + this.infoToolStripMenuItem.Name = "infoToolStripMenuItem"; + this.infoToolStripMenuItem.Size = new System.Drawing.Size(49, 25); + this.infoToolStripMenuItem.Text = "Info"; + this.infoToolStripMenuItem.Click += new System.EventHandler(this.infoToolStripMenuItem_Click); + // // statusStrip1 // this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); @@ -197,41 +233,6 @@ // this.update.UpdateUrl = "http://home.cosysda.de/sanverwaltung/UpdateInfo.dat"; // - // speichernToolStripMenuItem1 - // - this.speichernToolStripMenuItem1.Name = "speichernToolStripMenuItem1"; - this.speichernToolStripMenuItem1.Size = new System.Drawing.Size(254, 26); - this.speichernToolStripMenuItem1.Text = "Speichern"; - this.speichernToolStripMenuItem1.Click += new System.EventHandler(this.speichernToolStripMenuItem1_Click); - // - // imprägnierberichteToolStripMenuItem1 - // - this.imprägnierberichteToolStripMenuItem1.Name = "imprägnierberichteToolStripMenuItem1"; - this.imprägnierberichteToolStripMenuItem1.Size = new System.Drawing.Size(213, 26); - this.imprägnierberichteToolStripMenuItem1.Text = "Imprägnierberichte"; - this.imprägnierberichteToolStripMenuItem1.Click += new System.EventHandler(this.imprägnierberichteToolStripMenuItem1_Click); - // - // massenstatistikToolStripMenuItem1 - // - this.massenstatistikToolStripMenuItem1.Name = "massenstatistikToolStripMenuItem1"; - this.massenstatistikToolStripMenuItem1.Size = new System.Drawing.Size(213, 26); - this.massenstatistikToolStripMenuItem1.Text = "Massenstatistik"; - this.massenstatistikToolStripMenuItem1.Click += new System.EventHandler(this.massenstatistikToolStripMenuItem1_Click); - // - // einstellungenToolStripMenuItem - // - this.einstellungenToolStripMenuItem.Name = "einstellungenToolStripMenuItem"; - this.einstellungenToolStripMenuItem.Size = new System.Drawing.Size(254, 26); - this.einstellungenToolStripMenuItem.Text = "Einstellungen"; - this.einstellungenToolStripMenuItem.Click += new System.EventHandler(this.einstellungenToolStripMenuItem_Click); - // - // infoToolStripMenuItem - // - this.infoToolStripMenuItem.Name = "infoToolStripMenuItem"; - this.infoToolStripMenuItem.Size = new System.Drawing.Size(49, 25); - this.infoToolStripMenuItem.Text = "Info"; - this.infoToolStripMenuItem.Click += new System.EventHandler(this.infoToolStripMenuItem_Click); - // // frmMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/SanSystem/frmMain.cs b/SanSystem/frmMain.cs index 513f2df..a0d0c18 100644 --- a/SanSystem/frmMain.cs +++ b/SanSystem/frmMain.cs @@ -77,12 +77,12 @@ namespace SanSystem frmLinerReste.Show(); - frmInfo frmInfo = new frmInfo(); + /*frmInfo frmInfo = new frmInfo(); frmInfo.MdiParent = this; frmInfo.Location = new Point(this.Width - frmInfo.Width - 05, this.Height - frmInfo.Height-80); frmInfo.Show(); - + */ FrmAktuelleBesatzung frmAktuelleBesatzung = new FrmAktuelleBesatzung(); frmAktuelleBesatzung.ShowDialog(); @@ -105,6 +105,14 @@ namespace SanSystem Global.Instance.OnStatusMessageChanged += Instance_OnStatusMessageChanged; + using (Dongle dongle = new Dongle(60)) + { + stammdatenImportierenToolStripMenuItem.Enabled = dongle.IsLicensed((byte)AktivierteModule.STAMMDATEN) ? true : false; + exportFürBüroErstellenToolStripMenuItem.Enabled = dongle.IsLicensed((byte)AktivierteModule.BUEROEXPORTER) ? true : false; + dongle.CleanDongle(); + } + + } @@ -154,6 +162,7 @@ namespace SanSystem private void FrmProjektList_FormClosed(object sender, FormClosedEventArgs e) { + if (Datenbank.Instance.loadedProjekt == null) return; if(Datenbank.Instance.loadedProjekt.Auftraggeber.Name == null) showauftraggeberform(); @@ -179,12 +188,14 @@ namespace SanSystem //frmLinerReste.IsMdiChild = true; frmLinerReste.Show(); - - frmInfo frmInfo = new frmInfo(); + + /*frmInfo frmInfo = new frmInfo(); frmInfo.MdiParent = this; frmInfo.Location = new Point(this.Width - frmInfo.Width - 05, this.Height - frmInfo.Height - 80); frmInfo.Show(); + */ + } @@ -197,7 +208,10 @@ namespace SanSystem private void stammdatenImportierenToolStripMenuItem_Click(object sender, EventArgs e) { - +#if !DEBUG + MessageBox.Show("Funktion steht nicht zur Verfügung"); + return; +#else OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "XML Daten | *.xml"; if(Datenbank.Instance.loadedProjekt == null) @@ -228,7 +242,7 @@ namespace SanSystem strassenList.StartPosition = FormStartPosition.Manual; strassenList.Show(); } - +#endif } private void auftraggeberToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/SanSystem/frmSettings.cs b/SanSystem/frmSettings.cs index 1d40ce8..a8e2090 100644 --- a/SanSystem/frmSettings.cs +++ b/SanSystem/frmSettings.cs @@ -17,6 +17,9 @@ namespace SanSystem public frmSettings() { InitializeComponent(); +#if !DEBUG + MessageBox.Show("Funktion noch nicht vollständig implementiert. Nutzung auf eigene Gefahr"); +#endif softwareConfiguration = new SoftwareConfiguration(); txt_anlageIP.Text = softwareConfiguration.GetAnlageIP(); diff --git a/SanSystem/frmStrassenList.cs b/SanSystem/frmStrassenList.cs index b1cb998..43388dd 100644 --- a/SanSystem/frmStrassenList.cs +++ b/SanSystem/frmStrassenList.cs @@ -152,6 +152,11 @@ namespace SanSystem MessageBox.Show("Es wurde kein Projekt geladen"); return; } + if(Datenbank.Instance.TeufelDB.Imprägnierungen.Count < 1) + { + MessageBox.Show("Bitte zunächst die Imprägnierung hinzufügen"); + return; + } KlassenBIB.Inspektionsobjekt inspektionsobjekt = new KlassenBIB.Inspektionsobjekt(); inspektionsobjekt.Projektnummer = Global.Instance.ProjektNummer; Datenbank.Instance.loadedProjekt.Objekte.Add(inspektionsobjekt); diff --git a/SanSystem_exe.WibuAxProject b/SanSystem_exe.WibuAxProject index 2eb00ad..6b475b0 100644 Binary files a/SanSystem_exe.WibuAxProject and b/SanSystem_exe.WibuAxProject differ