diff --git a/app/DD-Record-Organiser/ClassControlValues.vb b/app/DD-Record-Organiser/ClassControlValues.vb index e6c43d3..099f789 100644 --- a/app/DD-Record-Organiser/ClassControlValues.vb +++ b/app/DD-Record-Organiser/ClassControlValues.vb @@ -259,6 +259,9 @@ Public Class ClassControlValues Dim SQL As String = String.Format("SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE FORM_ID = {0} AND NAME = '{1}'", CURRENT_FORM_ID, C.Name) Dim SQL2 As String = ClassDatabase.Execute_Scalar(SQL) + If SQL2 = "" Then + Exit Sub + End If Dim DT_Combobox As DataTable = ClassDatabase.Return_Datatable(SQL2) If DT_Combobox Is Nothing = False Then If DT_Combobox.Rows.Count > 0 Then diff --git a/app/DD-Record-Organiser/ClassControlValuesConverter.vb b/app/DD-Record-Organiser/ClassControlValuesConverter.vb index 65466cb..438800f 100644 --- a/app/DD-Record-Organiser/ClassControlValuesConverter.vb +++ b/app/DD-Record-Organiser/ClassControlValuesConverter.vb @@ -1,5 +1,4 @@ Public Class ClassControlValuesConverter - Public Shared Function ToBooleanOrDefault(value As Object, Optional defaultValue As Boolean = False) Try If IsDBNull(value) OrElse value = "" Then @@ -36,5 +35,4 @@ Return defaultValue End Try End Function - End Class diff --git a/app/DD-Record-Organiser/ClassLicence.vb b/app/DD-Record-Organiser/ClassLicence.vb new file mode 100644 index 0000000..5e3d552 --- /dev/null +++ b/app/DD-Record-Organiser/ClassLicence.vb @@ -0,0 +1,48 @@ +Imports DLLLicenseManager +Public Class ClassLicence + Public Shared License_Date As Date + Private Shared _lizenzManager As ClassLicenseManager + Public Shared Sub Refresh_Licence() + Try + _lizenzManager = New ClassLicenseManager("#DigitalData35452!#", "") + Dim sql As String = "SELECT LICENSE FROM TBDD_MODULES WHERE UPPER(NAME) = UPPER('Record-Organizer')" + + Dim lic As String = ClassDatabase.Execute_Scalar(sql, True) + Dim licString = _lizenzManager.DecodeLicenseKey(lic) + Dim split() = licString.ToString.Split("#") + + If lic <> "" Then + LICENSE_COUNT = split(0) + Else + LICENSE_COUNT = 0 + End If + License_Date = CDate(split(1)) + If CDate(split(1)) < CDate(Now.ToShortDateString) Then + MsgBox("Ihre Lizenz ist abgelaufen!" & vbNewLine & "Letztes Gültigkeitsdatum: " & split(1) & vbNewLine & "Bitte setzen Sie sich mit Digital Data in Verbindung", MsgBoxStyle.Exclamation) + LICENSE_EXPIRED = True + LICENSE_COUNT = 0 + End If + + 'Die Anzahl der Userlizenzen + LICENSE_COUNT = split(1) + + Try + LICENSE_DOSSIER_COUNT = split(2) + Catch ex As Exception + LICENSE_DOSSIER_COUNT = 0 + End Try + Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Licensemanager:") + End Try + End Sub + + Public Shared Function license_is_Valid() + If LICENSE_EXPIRED Then + MsgBox("Ihre Lizenz ist abgelaufen!" & vbNewLine & "Letztes Gültigkeitsdatum: " & License_Date & vbNewLine & "Bitte setzen Sie sich mit Digital Data in Verbindung", MsgBoxStyle.Exclamation) + Return False + Else : Return True + + End If + End Function + +End Class diff --git a/app/DD-Record-Organiser/DD-Record-Organiser.vbproj b/app/DD-Record-Organiser/DD-Record-Organiser.vbproj index b710d89..ca41150 100644 --- a/app/DD-Record-Organiser/DD-Record-Organiser.vbproj +++ b/app/DD-Record-Organiser/DD-Record-Organiser.vbproj @@ -237,6 +237,7 @@ + frmAbout.vb diff --git a/app/DD-Record-Organiser/Resources/key_go1.png b/app/DD-Record-Organiser/Resources/key_go1.png new file mode 100644 index 0000000..30b0dc3 Binary files /dev/null and b/app/DD-Record-Organiser/Resources/key_go1.png differ diff --git a/app/DD-Record-Organiser/frmForm_Constructor_Main.Designer.vb b/app/DD-Record-Organiser/frmForm_Constructor_Main.Designer.vb index 228141f..d357f00 100644 --- a/app/DD-Record-Organiser/frmForm_Constructor_Main.Designer.vb +++ b/app/DD-Record-Organiser/frmForm_Constructor_Main.Designer.vb @@ -22,13 +22,12 @@ Partial Class frmForm_Constructor_Main 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. _ Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() Dim GridLevelNode1 As DevExpress.XtraGrid.GridLevelNode = New DevExpress.XtraGrid.GridLevelNode() Dim GridLevelNode2 As DevExpress.XtraGrid.GridLevelNode = New DevExpress.XtraGrid.GridLevelNode() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmForm_Constructor_Main)) Me.grvwGrid = New DevExpress.XtraGrid.Views.Grid.GridView() Me.GridControlMain = New DevExpress.XtraGrid.GridControl() - Me.ContextMenuGrid = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.ContextMenuGrid = New System.Windows.Forms.ContextMenuStrip() Me.FunktionenDataGridToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() Me.AnsichtUmschaltenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -52,7 +51,7 @@ Partial Class frmForm_Constructor_Main Me.SplitContainerMain = New DevExpress.XtraEditors.SplitContainerControl() Me.SplitContainerTop = New DevExpress.XtraEditors.SplitContainerControl() Me.TreeViewMain = New System.Windows.Forms.TreeView() - Me.CMSEntity = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.CMSEntity = New System.Windows.Forms.ContextMenuStrip() Me.ResetEbenenAuswahlToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.DateiimportEntitätToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.FormDesignerToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -96,19 +95,19 @@ Partial Class frmForm_Constructor_Main Me.VerknüpfungenAnzeigenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.tsButtonShowTaskOverview = New System.Windows.Forms.ToolStripButton() Me.tsButtonShowWorkflowTasks = New System.Windows.Forms.ToolStripButton() - Me.BindingSource_Entity = New System.Windows.Forms.BindingSource(Me.components) + Me.BindingSource_Entity = New System.Windows.Forms.BindingSource() Me.DD_ECMAdmin = New DD_Record_Organiser.DD_ECMAdmin() - Me.ImageCollection1 = New DevExpress.Utils.ImageCollection(Me.components) - Me.ttToolTip = New System.Windows.Forms.ToolTip(Me.components) - Me.ContextMenuDetails = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.ImageCollection1 = New DevExpress.Utils.ImageCollection() + Me.ttToolTip = New System.Windows.Forms.ToolTip() + Me.ContextMenuDetails = New System.Windows.Forms.ContextMenuStrip() Me.DD_DMSDataSet = New DD_Record_Organiser.DD_DMSDataSet() - Me.VWPMO_WF_USER_ACTIVEBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.VWPMO_WF_USER_ACTIVEBindingSource = New System.Windows.Forms.BindingSource() Me.VWPMO_WF_USER_ACTIVETableAdapter = New DD_Record_Organiser.DD_DMSDataSetTableAdapters.VWPMO_WF_USER_ACTIVETableAdapter() Me.TableAdapterManager = New DD_Record_Organiser.DD_DMSDataSetTableAdapters.TableAdapterManager() Me.TBPMO_FILES_USERTableAdapter = New DD_Record_Organiser.DD_DMSDataSetTableAdapters.TBPMO_FILES_USERTableAdapter() - Me.VWPMO_WF_ACTIVEBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.VWPMO_WF_ACTIVEBindingSource = New System.Windows.Forms.BindingSource() Me.VWPMO_WF_ACTIVETableAdapter = New DD_Record_Organiser.DD_DMSDataSetTableAdapters.VWPMO_WF_ACTIVETableAdapter() - Me.TBPMO_FILES_USERBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.TBPMO_FILES_USERBindingSource = New System.Windows.Forms.BindingSource() CType(Me.grvwGrid, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridControlMain, System.ComponentModel.ISupportInitialize).BeginInit() Me.ContextMenuGrid.SuspendLayout() @@ -457,6 +456,7 @@ Partial Class frmForm_Constructor_Main ' 'pnlDetails ' + Me.pnlDetails.AllowDrop = True Me.pnlDetails.Dock = System.Windows.Forms.DockStyle.Fill Me.pnlDetails.Location = New System.Drawing.Point(0, 0) Me.pnlDetails.Name = "pnlDetails" @@ -469,7 +469,7 @@ Partial Class frmForm_Constructor_Main Me.TabWindream.Controls.Add(Me.ToolStripDokumente) Me.TabWindream.Image = Global.DD_Record_Organiser.My.Resources.Resources.Files_7954 Me.TabWindream.Name = "TabWindream" - Me.TabWindream.Size = New System.Drawing.Size(1063, 316) + Me.TabWindream.Size = New System.Drawing.Size(1060, 312) Me.TabWindream.Text = "windream-Dateien" ' 'AxObjectListControl @@ -480,7 +480,7 @@ Partial Class frmForm_Constructor_Main Me.AxObjectListControl.Location = New System.Drawing.Point(0, 25) Me.AxObjectListControl.Name = "AxObjectListControl" Me.AxObjectListControl.OcxState = CType(resources.GetObject("AxObjectListControl.OcxState"), System.Windows.Forms.AxHost.State) - Me.AxObjectListControl.Size = New System.Drawing.Size(1063, 291) + Me.AxObjectListControl.Size = New System.Drawing.Size(1060, 287) Me.AxObjectListControl.TabIndex = 6 Me.AxObjectListControl.TabStop = False ' @@ -489,7 +489,7 @@ Partial Class frmForm_Constructor_Main Me.ToolStripDokumente.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tslblWindreamView, Me.ToolStripDropDownButton2}) Me.ToolStripDokumente.Location = New System.Drawing.Point(0, 0) Me.ToolStripDokumente.Name = "ToolStripDokumente" - Me.ToolStripDokumente.Size = New System.Drawing.Size(1063, 25) + Me.ToolStripDokumente.Size = New System.Drawing.Size(1060, 25) Me.ToolStripDokumente.TabIndex = 2 Me.ToolStripDokumente.Text = "ToolStrip2" ' @@ -523,7 +523,7 @@ Partial Class frmForm_Constructor_Main Me.TabFollowUp.Controls.Add(Me.ListViewFollowUp) Me.TabFollowUp.Image = Global.DD_Record_Organiser.My.Resources.Resources.Task_16xMD Me.TabFollowUp.Name = "TabFollowUp" - Me.TabFollowUp.Size = New System.Drawing.Size(1063, 316) + Me.TabFollowUp.Size = New System.Drawing.Size(1060, 312) Me.TabFollowUp.Text = "Wiedervorlage" ' 'grpbxFU_Profile diff --git a/app/DD-Record-Organiser/frmForm_Constructor_Main.vb b/app/DD-Record-Organiser/frmForm_Constructor_Main.vb index 8ecc772..9615570 100644 --- a/app/DD-Record-Organiser/frmForm_Constructor_Main.vb +++ b/app/DD-Record-Organiser/frmForm_Constructor_Main.vb @@ -796,7 +796,12 @@ Public Class frmForm_Constructor_Main EBENE2_RECID = recid For Each row As DataRow In DT_SELECTION.Rows If row.Item("Record-ID") = SELECTED_RECORD_ID Then - EBENE2_GRID_RESULT = row.Item(EBENE2_COLUMNNAME) + If EBENE2_COLUMNNAME = "" Then + EBENE2_GRID_RESULT = "No Column configured" + Else + EBENE2_GRID_RESULT = row.Item(EBENE2_COLUMNNAME) + End If + End If Next End Select @@ -985,6 +990,7 @@ Public Class frmForm_Constructor_Main If EBENE1_RECID > 0 Then PARENT_RECORDID = EBENE1_RECID CURRENT_PARENTID = EBENE1_RECID + Console.WriteLine("PARENT_RECORDID: " & PARENT_RECORDID) If GRID_TYPE = GridType.Grid Then CURRENT_ENTITYSQL = "SELECT T.* FROM VWTEMP_PMO_FORM" & CURRENT_FORM_ID.ToString & " T, TBPMO_RECORD_CONNECT t1 where T.[Record-ID] = T1.RECORD2_ID AND T1.RECORD1_ID = " & CURRENT_PARENTID Else @@ -1027,7 +1033,7 @@ Public Class frmForm_Constructor_Main 'Parent-ID setzen PARENT_RECORDID = EBENE2_RECID CURRENT_PARENTID = EBENE2_RECID - + Console.WriteLine("PARENT_RECORDID: " & PARENT_RECORDID) Try If GRID_TYPE = GridType.Grid Then CURRENT_ENTITYSQL = "SELECT T.* FROM VWTEMP_PMO_FORM" & CURRENT_FORM_ID.ToString & " T, TBPMO_RECORD_CONNECT t1 where T.[Record-ID] = T1.RECORD2_ID AND T1.RECORD1_ID = " & CURRENT_PARENTID diff --git a/app/DD-Record-Organiser/frmLicense.designer.vb b/app/DD-Record-Organiser/frmLicense.designer.vb new file mode 100644 index 0000000..84422f7 --- /dev/null +++ b/app/DD-Record-Organiser/frmLicense.designer.vb @@ -0,0 +1,224 @@ + _ +Partial Class frmLicense + Inherits System.Windows.Forms.Form + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Wird vom Windows Form-Designer benötigt. + Private components As System.ComponentModel.IContainer + + 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. + 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. + 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. + _ + Private Sub InitializeComponent() + Me.btnPW_check = New System.Windows.Forms.Button() + Me.txtPW = New System.Windows.Forms.TextBox() + Me.lblPW = New System.Windows.Forms.Label() + Me.grbBoxlicense = New System.Windows.Forms.GroupBox() + Me.Label5 = New System.Windows.Forms.Label() + Me.dtpGueltig_GI = New System.Windows.Forms.DateTimePicker() + Me.txtDossierCount = New System.Windows.Forms.TextBox() + Me.Label2 = New System.Windows.Forms.Label() + Me.txtlicensekey = New System.Windows.Forms.TextBox() + Me.lblReadKey = New System.Windows.Forms.Label() + Me.txtNewlicences = New System.Windows.Forms.TextBox() + Me.lblnewlicenses = New System.Windows.Forms.Label() + Me.lblAktuelleLizenzen = New System.Windows.Forms.Label() + Me.btnnewLicenses = New System.Windows.Forms.Button() + Me.grbBoxlicense.SuspendLayout + Me.SuspendLayout + ' + 'btnPW_check + ' + Me.btnPW_check.Location = New System.Drawing.Point(318, 2) + Me.btnPW_check.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.btnPW_check.Name = "btnPW_check" + Me.btnPW_check.Size = New System.Drawing.Size(193, 32) + Me.btnPW_check.TabIndex = 29 + Me.btnPW_check.Text = "Open License Manager" + Me.btnPW_check.UseVisualStyleBackColor = true + ' + 'txtPW + ' + Me.txtPW.Location = New System.Drawing.Point(120, 7) + Me.txtPW.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.txtPW.Name = "txtPW" + Me.txtPW.Size = New System.Drawing.Size(192, 23) + Me.txtPW.TabIndex = 28 + Me.txtPW.UseSystemPasswordChar = true + ' + 'lblPW + ' + Me.lblPW.AutoSize = true + Me.lblPW.Location = New System.Drawing.Point(8, 10) + Me.lblPW.Name = "lblPW" + Me.lblPW.Size = New System.Drawing.Size(108, 16) + Me.lblPW.TabIndex = 27 + Me.lblPW.Text = "Master Passwort:" + ' + 'grbBoxlicense + ' + Me.grbBoxlicense.Controls.Add(Me.Label5) + Me.grbBoxlicense.Controls.Add(Me.dtpGueltig_GI) + Me.grbBoxlicense.Controls.Add(Me.txtDossierCount) + Me.grbBoxlicense.Controls.Add(Me.Label2) + Me.grbBoxlicense.Controls.Add(Me.txtlicensekey) + Me.grbBoxlicense.Controls.Add(Me.lblReadKey) + Me.grbBoxlicense.Controls.Add(Me.btnnewLicenses) + Me.grbBoxlicense.Controls.Add(Me.txtNewlicences) + Me.grbBoxlicense.Controls.Add(Me.lblnewlicenses) + Me.grbBoxlicense.Controls.Add(Me.lblAktuelleLizenzen) + Me.grbBoxlicense.Location = New System.Drawing.Point(11, 42) + Me.grbBoxlicense.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.grbBoxlicense.Name = "grbBoxlicense" + Me.grbBoxlicense.Padding = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.grbBoxlicense.Size = New System.Drawing.Size(520, 308) + Me.grbBoxlicense.TabIndex = 26 + Me.grbBoxlicense.TabStop = false + Me.grbBoxlicense.Text = "Lizenzanzahl ändern (nur Administrator):" + Me.grbBoxlicense.Visible = false + ' + 'Label5 + ' + Me.Label5.AutoSize = true + Me.Label5.Location = New System.Drawing.Point(325, 65) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(65, 16) + Me.Label5.TabIndex = 16 + Me.Label5.Text = "Gültigkeit:" + Me.Label5.TextAlign = System.Drawing.ContentAlignment.TopRight + ' + 'dtpGueltig_GI + ' + Me.dtpGueltig_GI.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + Me.dtpGueltig_GI.Location = New System.Drawing.Point(396, 62) + Me.dtpGueltig_GI.Name = "dtpGueltig_GI" + Me.dtpGueltig_GI.Size = New System.Drawing.Size(104, 23) + Me.dtpGueltig_GI.TabIndex = 15 + Me.dtpGueltig_GI.Value = New Date(2099, 12, 31, 0, 0, 0, 0) + ' + 'txtDossierCount + ' + Me.txtDossierCount.Location = New System.Drawing.Point(222, 91) + Me.txtDossierCount.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.txtDossierCount.Name = "txtDossierCount" + Me.txtDossierCount.Size = New System.Drawing.Size(31, 23) + Me.txtDossierCount.TabIndex = 11 + Me.txtDossierCount.Text = "5" + ' + 'Label2 + ' + Me.Label2.AutoSize = true + Me.Label2.Location = New System.Drawing.Point(7, 94) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(127, 16) + Me.Label2.TabIndex = 10 + Me.Label2.Text = "Anzahl Aktensichten:" + ' + 'txtlicensekey + ' + Me.txtlicensekey.Location = New System.Drawing.Point(10, 221) + Me.txtlicensekey.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.txtlicensekey.Multiline = true + Me.txtlicensekey.Name = "txtlicensekey" + Me.txtlicensekey.Size = New System.Drawing.Size(490, 67) + Me.txtlicensekey.TabIndex = 7 + ' + 'lblReadKey + ' + Me.lblReadKey.AutoSize = true + Me.lblReadKey.Location = New System.Drawing.Point(7, 201) + Me.lblReadKey.Name = "lblReadKey" + Me.lblReadKey.Size = New System.Drawing.Size(105, 16) + Me.lblReadKey.TabIndex = 6 + Me.lblReadKey.Text = "Neuer Lizenzkey:" + ' + 'txtNewlicences + ' + Me.txtNewlicences.Location = New System.Drawing.Point(222, 62) + Me.txtNewlicences.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.txtNewlicences.Name = "txtNewlicences" + Me.txtNewlicences.Size = New System.Drawing.Size(31, 23) + Me.txtNewlicences.TabIndex = 4 + Me.txtNewlicences.Text = "1" + ' + 'lblnewlicenses + ' + Me.lblnewlicenses.AutoSize = true + Me.lblnewlicenses.Location = New System.Drawing.Point(7, 65) + Me.lblnewlicenses.Name = "lblnewlicenses" + Me.lblnewlicenses.Size = New System.Drawing.Size(209, 16) + Me.lblnewlicenses.TabIndex = 3 + Me.lblnewlicenses.Text = "Anzahl Record-Organizer Lizenzen:" + ' + 'lblAktuelleLizenzen + ' + Me.lblAktuelleLizenzen.AutoSize = true + Me.lblAktuelleLizenzen.Font = New System.Drawing.Font("Verdana", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,Byte)) + Me.lblAktuelleLizenzen.Location = New System.Drawing.Point(7, 31) + Me.lblAktuelleLizenzen.Name = "lblAktuelleLizenzen" + Me.lblAktuelleLizenzen.Size = New System.Drawing.Size(65, 16) + Me.lblAktuelleLizenzen.TabIndex = 2 + Me.lblAktuelleLizenzen.Text = "Label13" + ' + 'btnnewLicenses + ' + Me.btnnewLicenses.Image = Global.DD_Record_Organiser.My.Resources.Resources.key_go1 + Me.btnnewLicenses.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.btnnewLicenses.Location = New System.Drawing.Point(359, 175) + Me.btnnewLicenses.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.btnnewLicenses.Name = "btnnewLicenses" + Me.btnnewLicenses.Size = New System.Drawing.Size(141, 38) + Me.btnnewLicenses.TabIndex = 5 + Me.btnnewLicenses.Text = "Erzeuge Key" + Me.btnnewLicenses.TextAlign = System.Drawing.ContentAlignment.MiddleRight + Me.btnnewLicenses.UseVisualStyleBackColor = true + ' + 'frmLicense + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(7!, 16!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(542, 363) + Me.Controls.Add(Me.btnPW_check) + Me.Controls.Add(Me.txtPW) + Me.Controls.Add(Me.lblPW) + Me.Controls.Add(Me.grbBoxlicense) + Me.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,Byte)) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.KeyPreview = True + Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.Name = "frmLicense" + Me.Text = "Lizenzmanager" + Me.grbBoxlicense.ResumeLayout(false) + Me.grbBoxlicense.PerformLayout + Me.ResumeLayout(false) + Me.PerformLayout + +End Sub + Friend WithEvents btnPW_check As System.Windows.Forms.Button + Friend WithEvents txtPW As System.Windows.Forms.TextBox + Friend WithEvents lblPW As System.Windows.Forms.Label + Friend WithEvents grbBoxlicense As System.Windows.Forms.GroupBox + Friend WithEvents txtlicensekey As System.Windows.Forms.TextBox + Friend WithEvents lblReadKey As System.Windows.Forms.Label + Friend WithEvents btnnewLicenses As System.Windows.Forms.Button + Friend WithEvents txtNewlicences As System.Windows.Forms.TextBox + Friend WithEvents lblnewlicenses As System.Windows.Forms.Label + Friend WithEvents lblAktuelleLizenzen As System.Windows.Forms.Label + + Friend WithEvents txtDossierCount As System.Windows.Forms.TextBox + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents dtpGueltig_GI As System.Windows.Forms.DateTimePicker +End Class diff --git a/app/DD-Record-Organiser/frmLicense.resx b/app/DD-Record-Organiser/frmLicense.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/app/DD-Record-Organiser/frmLicense.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/app/DD-Record-Organiser/frmLicense.vb b/app/DD-Record-Organiser/frmLicense.vb new file mode 100644 index 0000000..1c2d51b --- /dev/null +++ b/app/DD-Record-Organiser/frmLicense.vb @@ -0,0 +1,102 @@ +Imports DLLLicenseManager +Public Class frmLicense + Public _lizenzManager As ClassLicenseManager + Private Sub btnPW_check_Click(sender As System.Object, e As System.EventArgs) Handles btnPW_check.Click + OpenLicenseManager() + End Sub + Sub OpenLicenseManager() + If Me.txtPW.Text <> "" Then + If Me.txtPW.Text = "35452dd!" Then + Me.grbBoxlicense.Visible = True + Refresh_Licence(False) + Me.lblPW.Visible = False + Me.txtPW.Visible = False + Me.btnPW_check.Visible = False + Else + Me.grbBoxlicense.Visible = False + MsgBox("Das eingegebene Passwort stimmt nicht überein!", MsgBoxStyle.Critical, "Falsche Eingabe:") + Me.txtPW.Text = "" + Me.txtPW.Focus() + End If + End If + End Sub + + Private Sub btnnewLicenses_Click(sender As System.Object, e As System.EventArgs) Handles btnnewLicenses.Click + Try + If Me.txtNewlicences.Text <> "" And txtDossierCount.Text <> "" Then + 'Encode the license + Dim result As String = Me._lizenzManager.EncodeLicenseKey(txtNewlicences.Text & "#" & dtpGueltig_GI.Text & "#" & txtDossierCount.Text, "#DigitalData35452!#") + + Dim sql As String = "UPDATE TBDD_MODULES SET LICENSE = '" & result & "' WHERE UPPER(NAME) = UPPER('Record-Organizer')" + If ClassDatabase.Execute_non_Query(sql, True) = True Then + txtlicensekey.Text = result + Refresh_Licence(True) + End If + + 'MsgBox("Die Lizenzen wurden erfolgreich aktualisiert!", MsgBoxStyle.Exclamation, "Erfolgsmeldung:") + End If + Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei New Licenses:") + End Try + End Sub + Sub Refresh_Licence(Neu As Boolean) + Dim lizenzzahl As Integer + Try + Me._lizenzManager = New ClassLicenseManager("#DigitalData35452!#", "") + Dim sql As String = "SELECT LICENSE FROM TBDD_MODULES WHERE UPPER(NAME) = UPPER('Record-Organizer')" + + Dim lic As String = ClassDatabase.Execute_Scalar(sql, True) + Dim licString = Me._lizenzManager.DecodeLicenseKey(lic) + + Dim split() = licString.ToString.Split("#") + + If lic <> "" Then + lizenzzahl = split(0) + LICENSE_COUNT = lizenzzahl + Else + lizenzzahl = "0" + End If + txtNewlicences.Text = lizenzzahl + dtpGueltig_GI.Value = split(1) + If CDate(split(1)) < CDate(Now.ToShortDateString) Then + License_Expired = True + Else + License_Expired = False + End If + + txtDossierCount.Text = split(2) + LICENSE_COUNT = CInt(txtNewlicences.Text) + + LICENSE_DOSSIER_COUNT = split(2) + txtDossierCount.Text = 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:") + End If + End If + Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Licensemanager:") + End Try + End Sub + + Private Sub frmLicense_Load(sender As Object, e As System.EventArgs) Handles Me.Load + Try + grbBoxlicense.Visible = False + Me.lblPW.Visible = True + Me.txtPW.Visible = True + Me.btnPW_check.Visible = True + Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Formular Load:") + End Try + End Sub + + Private Sub frmLicense_KeyUp(sender As Object, e As KeyEventArgs) Handles MyBase.KeyUp + If e.KeyCode = Keys.Return Then + If Me.txtPW.Focus = True Then + OpenLicenseManager() + End If + End If + End Sub +End Class \ No newline at end of file