From 21d8ac2ff081039a4900a38102b9df95333b61b7 Mon Sep 17 00:00:00 2001 From: Digital Data - Marlon Schreiber Date: Fri, 21 Dec 2018 13:48:42 +0100 Subject: [PATCH] Licensing --- .../DD_PM_WINDREAM/DesignTimeBuild/.dtbcache | Bin 218 -> 218 bytes app/DD_PM_WINDREAM/ClassInit.vb | 10 ++----- app/DD_PM_WINDREAM/ModuleRuntimeVariables.vb | 1 + app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb | 2 +- app/DD_PM_WINDREAM/frmLicense.vb | 25 ++++++++++++++--- app/DD_PM_WINDREAM/frmMain.vb | 26 +++++++++++++++--- 6 files changed, 47 insertions(+), 17 deletions(-) diff --git a/app/.vs/DD_PM_WINDREAM/DesignTimeBuild/.dtbcache b/app/.vs/DD_PM_WINDREAM/DesignTimeBuild/.dtbcache index 671ed4a1339e1ed6980c0b51ee8bfb3acd087d30..715c91bb439b5d68c69962a8f4a3c4d0343f04fc 100644 GIT binary patch delta 48 zcmcb`c#Cm@h-@4K1A{Ar6+;X|Fhep!215};Dnlki5|Aun@SUhB&+5+L$q+KpwG{vb C=nAp` delta 51 zcmcb`c#Cm@h-erC1A{Ar6+;Yz7egvT9uTH7cuh2vpBT|3P{2^ckk63Ca7Vr_5QG6f C`wfNw diff --git a/app/DD_PM_WINDREAM/ClassInit.vb b/app/DD_PM_WINDREAM/ClassInit.vb index 0312b8a..0c3edd9 100644 --- a/app/DD_PM_WINDREAM/ClassInit.vb +++ b/app/DD_PM_WINDREAM/ClassInit.vb @@ -65,15 +65,8 @@ Public Class ClassInit Else LICENSE_COUNT = 0 End If - Dim oLicDateString As String = split(1) - Dim cultureInfo As System.Globalization.CultureInfo - cultureInfo = New System.Globalization.CultureInfo("de-DE") - cultureInfo.DateTimeFormat.ShortDatePattern = "dd.MM.yyyy" - - Dim oLicDate As Date = Convert.ToDateTime(oLicDateString, cultureInfo) - Dim oMyDate As Date = Convert.ToDateTime(Now.ToShortDateString, cultureInfo) - If oLicDate <= oMyDate Then + If LICENSE_VALID = False Then MsgBox("Your license has expired!" & vbNewLine & "Last valid date: " & split(1) & vbNewLine & "Please contact Your sysadmin", MsgBoxStyle.Exclamation) LICENSE_EXPIRED = True LICENSE_COUNT = 0 @@ -194,6 +187,7 @@ Public Class ClassInit vWLaufwerk = DT.Rows(0).Item("STRING1") vVERSION_DELIMITER = DT.Rows(0).Item("VERSION_DELIMITER") vFILE_DELIMITER = DT.Rows(0).Item("FILE_DELIMITER") + LICENSE_VALID = DT.Rows(0).Item("LICENSE_VALID") Try WMSESSION_STARTSTOP_STARTUP = DT.Rows(0).Item("WMSESSION_STARTSTOP_STARTUP") Catch ex As Exception diff --git a/app/DD_PM_WINDREAM/ModuleRuntimeVariables.vb b/app/DD_PM_WINDREAM/ModuleRuntimeVariables.vb index 54a1a47..d91655a 100644 --- a/app/DD_PM_WINDREAM/ModuleRuntimeVariables.vb +++ b/app/DD_PM_WINDREAM/ModuleRuntimeVariables.vb @@ -35,6 +35,7 @@ Module ModuleRuntimeVariables Public LICENSE_COUNT As Integer = 0 Public LICENSE_EXPIRED As Boolean = False Public LICENSE_PROFILES As Integer = 0 + Public LICENSE_VALID As Boolean = False Public USERCOUNT_LOGGED_IN As Integer = 0 Public CURRENT_INDEX_ID As Integer Public CURRENT_OBJECTTYPE As String diff --git a/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb b/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb index 2737178..01ad200 100644 --- a/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb +++ b/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/app/DD_PM_WINDREAM/frmLicense.vb b/app/DD_PM_WINDREAM/frmLicense.vb index 68a8d2a..6ea106f 100644 --- a/app/DD_PM_WINDREAM/frmLicense.vb +++ b/app/DD_PM_WINDREAM/frmLicense.vb @@ -22,7 +22,7 @@ Public Class frmLicense Private Sub btnnewLicenses_Click(sender As System.Object, e As System.EventArgs) Handles btnnewLicenses.Click Try If Me.txtNewlizences.Text <> "" And txtProfile.Text <> "" Then - Dim dt As Date = CDate(dtp_Gültigkeit.Text) + Dim dt As Date = CDate(dtp_Gültigkeit.Value) Dim oDateddMMyyyy = dt.ToString("dd.MM.yyyy", CultureInfo.InvariantCulture) Dim result As String = Me._lizenzManager.EncodeLicenseKey(txtNewlizences.Text & "#" & oDateddMMyyyy & "#" & txtProfile.Text, "#DigitalData35452!#") txtlicensekey.Text = result @@ -48,17 +48,34 @@ Public Class frmLicense Else lizenzzahl = "0" End If - dtp_Gültigkeit.Value = split(1) + Try + dtp_Gültigkeit.Value = CDate(split(1)) + Catch ex As Exception + Dim oLicDateString As String = split(1) + Dim cultureInfo As System.Globalization.CultureInfo + cultureInfo = New System.Globalization.CultureInfo("de-DE") + cultureInfo.DateTimeFormat.ShortDatePattern = "dd.MM.yyyy" + + + Dim oLicDate As Date = Convert.ToDateTime(oLicDateString, cultureInfo) + Try + dtp_Gültigkeit.Value = oLicDate + Catch ex1 As Exception + MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Unexpected error in Setting DTP-Value:") + End Try + + End Try + txtProfile.Text = split(2) LICENSE_PROFILES = split(2) Me.lblAktuelleLizenzen.Text = "Aktuelle Anzahl Lizenzen: " & lizenzzahl If Neu = True Then If CInt(lizenzzahl) > 0 Then - MsgBox("Die Lizenz wurde aktualisiert!", MsgBoxStyle.Information, "Erfolgsmeldung:") + MsgBox("License was refreshed!", MsgBoxStyle.Information, "Success:") End If End If Catch ex As Exception - MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Licensemanager:") + MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Unexpected error in LicenseManager-RefreshLicense:") End Try End Sub diff --git a/app/DD_PM_WINDREAM/frmMain.vb b/app/DD_PM_WINDREAM/frmMain.vb index 343fd3f..5d568ba 100644 --- a/app/DD_PM_WINDREAM/frmMain.vb +++ b/app/DD_PM_WINDREAM/frmMain.vb @@ -22,6 +22,7 @@ Public Class frmMain Private GridCursorLocation As Point Private GRID_LOAD_TYPE As String = "OVERVIEW" Private GRID_INV_COL_REMOVED As Boolean = False + Private NO_WORKFLOWITEMS As Boolean = False 'Private _windream As New ClassWindream_allgemein Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing @@ -209,6 +210,9 @@ Public Class frmMain End Function Private Sub SaveGridLayout() + If NO_WORKFLOWITEMS = True Then + Exit Sub + End If Try Dim xml As String = GetXML_LayoutName() GridView_Docs.SaveLayoutToXml(xml, OptionsLayoutBase.FullLayout) @@ -218,6 +222,10 @@ Public Class frmMain End Sub Private Sub RestoreLayout() + If NO_WORKFLOWITEMS = True Then + Exit Sub + End If + Try Dim xml As String = GetXML_LayoutName() GridView_Docs.RestoreLayoutFromXml(xml, OptionsLayoutBase.FullLayout) @@ -532,7 +540,11 @@ Public Class frmMain sql = sql.Replace("@DATE", Now.ToShortDateString) sql = sql.Replace("@PROFILE_ID", CURRENT_CLICKED_PROFILE_ID) CURR_DT_PROFILEGRID = ClassDatabase.Return_Datatable(sql, True) - + If CURR_DT_PROFILEGRID.Rows.Count = 0 Then + NO_WORKFLOWITEMS = True + Else + NO_WORKFLOWITEMS = False + End If Create_Basic_View() Dim Columns_Removed = GridView_CheckInvalidColumns() @@ -657,7 +669,11 @@ Public Class frmMain CURR_DT_PROFILEGRID = ClassDatabase.Return_Datatable(sql, True) If Not IsNothing(CURR_DT_PROFILEGRID) Then - + If CURR_DT_PROFILEGRID.Rows.Count = 0 Then + NO_WORKFLOWITEMS = True + Else + NO_WORKFLOWITEMS = False + End If Create_Basic_View() Try @@ -670,8 +686,6 @@ Public Class frmMain GridView_Docs.GroupedColumns(I).Tag = GridView_Docs.Columns.Item("PROFILE_ID") Next - - GridView_Docs.OptionsBehavior.AutoExpandAllGroups = True GridView_Docs.OptionsView.ShowGroupedColumns = False Catch ex As Exception @@ -1072,8 +1086,12 @@ Public Class frmMain CURR_DT_PROFILEGRID = ClassDatabase.Return_Datatable(sql, True) If Not IsNothing(CURR_DT_PROFILEGRID) Then + NO_WORKFLOWITEMS = False If CURR_DT_PROFILEGRID.Rows.Count = 0 Then lblViewType.Text = "Aktuell keine Workflowdaten vorhanden!" + + NO_WORKFLOWITEMS = True + 'MsgBox("Aktuell keine Workflowdaten vorhanden!", MsgBoxStyle.Information) GridControl_Docs.Visible = False pnlNavigator.Visible = False