Licensing

This commit is contained in:
Digital Data - Marlon Schreiber 2018-12-21 13:48:42 +01:00
parent d2e817b1e0
commit 21d8ac2ff0
6 changed files with 47 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.9.5.4")>
<Assembly: AssemblyVersion("1.9.5.5")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@ -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

View File

@ -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