SDL Jetzt erst recht!
This commit is contained in:
793
SDL/frmMain.vb
Normal file
793
SDL/frmMain.vb
Normal file
@@ -0,0 +1,793 @@
|
||||
Imports System.IO
|
||||
Imports System.Data.OleDb
|
||||
Imports Microsoft.Office.Interop
|
||||
Imports VERAGRegistrierkasse
|
||||
Imports Gemeinsames
|
||||
|
||||
Public Class frmMain
|
||||
|
||||
Dim dgvKunden As DataGridView
|
||||
Dim kundenSQL As New kundenSQL
|
||||
|
||||
' INFO:
|
||||
Private InfoDauer As Integer = 3
|
||||
Private WithEvents timShow As New Timer With {.Interval = 10}
|
||||
Private WithEvents timHide As New Timer With {.Interval = 10}
|
||||
' Dim acd As List(Of cAutoCompleteData) = kundenSQL.getKundenShort()
|
||||
|
||||
Dim WithEvents UpdateUpdater As New Timer
|
||||
Dim WithEvents UpdateSession As New Timer
|
||||
|
||||
Dim WithEvents TimerUPDATE As New Timer ' prüft periodisch, ob ein Update verfügbar
|
||||
|
||||
Dim FUNC As New cProgramFunctions
|
||||
|
||||
Public BERECHTIGUNEN As List(Of cBerechtigungen) = cBerechtignungenFunctions.loadBerechtigungen(VERAG_PROG_ALLGEMEIN.cAllgemein.USRID)
|
||||
|
||||
|
||||
Private Sub UpdateSession_Tick(sender As Object, e As EventArgs) Handles UpdateSession.Tick
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.SESSION.UPDATE_TIME()
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub New()
|
||||
Try
|
||||
' initialize added component on form1, which is menu strip;
|
||||
'note: if you have added any second component alongside menu
|
||||
'strip, such as context menu strip just add additional code
|
||||
'line under InitializeComponent(), and it will work;
|
||||
InitializeComponent()
|
||||
MenuStripSDL.Renderer = New MyRenderer()
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub TimerUPDATE_Tick(sender As Object, e As EventArgs) Handles TimerUPDATE.Tick
|
||||
Dim SDL As New cOptionenDAL
|
||||
If CInt(SDL.getAktuelleVersion().Replace(".", "")) > CInt(My.Resources.Version.Replace(".", "")) Then
|
||||
Label9.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub frmMain_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
||||
If e.KeyCode = Keys.Escape Then
|
||||
KdSearchBox1.Text = ""
|
||||
KdSearchBox1.Focus()
|
||||
End If
|
||||
' If e.KeyValue = Keys.ControlKey And e.KeyValue = Keys.Add Then
|
||||
If e.KeyCode = Keys.ControlKey And e.KeyCode = Keys.Add Then
|
||||
' MsgBox("+")
|
||||
Button7.PerformClick()
|
||||
End If '
|
||||
End Sub
|
||||
|
||||
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Me.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size
|
||||
Me.WindowState = FormWindowState.Maximized
|
||||
|
||||
|
||||
UpdateSession.Interval = 60000
|
||||
UpdateSession.Enabled = True
|
||||
|
||||
Panel3.Left = Me.Width / 2 - (Panel3.Width / 2)
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then lblTestsystem.Visible = True
|
||||
Control.CheckForIllegalCrossThreadCalls = False
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_Hauptmenü", Me) = 0 Then
|
||||
mnueMDM.Enabled = True
|
||||
Else
|
||||
mnueMDM.Enabled = False
|
||||
End If
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("ZOLL_Hauptmenü", Me) = 0 Then
|
||||
mnueZoll.Enabled = True
|
||||
Else
|
||||
mnueZoll.Enabled = False
|
||||
End If
|
||||
|
||||
|
||||
lblVersion.Text = "V " & My.Resources.Version
|
||||
lblMs.Text = ""
|
||||
Dim usrCntl As New usrCntlWelcome
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
initLoad()
|
||||
|
||||
' btnUpdate.FlatAppearance.BorderSize = 0
|
||||
pnlInfo.Height = 0
|
||||
'MsgBox(frmLogin.USRBER)
|
||||
If False Then 'frmLogin.USRBER > 0 Then
|
||||
|
||||
mnueKassenbuch.Visible = False
|
||||
mnueAdministration.Visible = False
|
||||
mnueKunden.Enabled = False
|
||||
' btnDaten.Enabled = False
|
||||
mnueMDM.Enabled = False
|
||||
mnueZoll.Enabled = False
|
||||
mnueBuchhaltung.Enabled = False
|
||||
End If
|
||||
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("ADMINFUNCTIONS", Me) Then
|
||||
mnueAdministration.Visible = True
|
||||
End If
|
||||
|
||||
If Not VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("MDM_Leistungen_bearbeiten", Me) Then
|
||||
Button7.Visible = False
|
||||
End If
|
||||
|
||||
|
||||
KdSearchBox1._ValueKdAndName = True
|
||||
KdSearchBox1.dgvpos = "RIGHT"
|
||||
KdSearchBox1.initKdBox(Me)
|
||||
'initKdSearch()
|
||||
|
||||
AddHandler KdSearchBox1.PropertyChanged, Sub()
|
||||
Try
|
||||
If KdSearchBox1.KdNr > 0 Then
|
||||
Dim pf As New cProgramFunctions
|
||||
cProgramFunctions.openKundenblatt(KdSearchBox1.KdNr, Me, True)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & vbNewLine & ex.StackTrace)
|
||||
End Try
|
||||
End Sub
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs)
|
||||
Label1.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub initLoad()
|
||||
Label1.Visible = True
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs)
|
||||
initLoad()
|
||||
End Sub
|
||||
|
||||
Private Sub Button8_Click(sender As Object, e As EventArgs)
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub btnKunden_Click(sender As Object, e As EventArgs)
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlKunden
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
|
||||
' setInfo("err", "Kundendaten sind noch nicht freigegeben!", 3)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub clrPnlMain()
|
||||
|
||||
lblMs.Text = ""
|
||||
While pnlMain.HasChildren
|
||||
pnlMain.Controls.RemoveAt(0)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles pnlLine.Paint
|
||||
With pnlLine
|
||||
|
||||
.BorderStyle = BorderStyle.None
|
||||
Dim p As New Pen(Color.FromArgb(0, 54, 128), 10)
|
||||
e.Graphics.DrawLine(p, .Left, .Bottom - 5, .Width, .Bottom)
|
||||
End With
|
||||
pnlLine.BackColor = Color.FromArgb(0, 54, 128)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub btnStammdaten_2Click(sender As Object, e As EventArgs)
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("BH_Hauptmenü", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlBH
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
Sub playInfoSound()
|
||||
Try 'My.Computer.Audio.Play(My.Resources.chimes, AudioPlayMode.WaitToComplete)
|
||||
Catch ex As Exception : End Try
|
||||
End Sub
|
||||
Sub playErrorSound()
|
||||
Try 'My.Computer.Audio.Play(My.Resources.chimes, AudioPlayMode.WaitToComplete)
|
||||
Catch ex As Exception : End Try
|
||||
End Sub
|
||||
|
||||
Private Sub btnBerichte_2Click(sender As Object, e As EventArgs)
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("Berichte_Hauptmenü", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlSeriendruck
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Berichte sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
'setInfo("info", "Das ist nur eine Information", 3)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Public Sub setInfo(art As String, text As String, dauer As Integer)
|
||||
|
||||
pnlInfo.Height = 0
|
||||
If art.ToLower = "info" Then
|
||||
playInfoSound()
|
||||
InfoDauer = dauer
|
||||
txtInfotext.Text = text
|
||||
txtInfotext.Left = (pnlInfo.Width / 2) - (txtInfotext.Width / 2)
|
||||
timShow.Enabled = True
|
||||
pnlInfo.BackColor = Color.FromArgb(255, 255, 128)
|
||||
End If
|
||||
If art.ToLower = "err" Then
|
||||
playErrorSound()
|
||||
InfoDauer = dauer
|
||||
txtInfotext.Text = text
|
||||
txtInfotext.Left = (pnlInfo.Width / 2) - (txtInfotext.Width / 2)
|
||||
timShow.Enabled = True
|
||||
pnlInfo.BackColor = Color.FromArgb(255, 128, 128)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub tim_Tick(sender As Object, e As EventArgs) Handles timShow.Tick
|
||||
If pnlInfo.Height >= 32 Then
|
||||
timShow.Enabled = False
|
||||
Wait(InfoDauer * 1000)
|
||||
timHide.Enabled = True
|
||||
Else
|
||||
pnlInfo.Height = pnlInfo.Height + 1
|
||||
End If
|
||||
End Sub
|
||||
Private Sub timHide_Tick(sender As Object, e As EventArgs) Handles timHide.Tick
|
||||
If pnlInfo.Height <= 0 Then
|
||||
timHide.Enabled = False
|
||||
Else
|
||||
pnlInfo.Height = pnlInfo.Height - 1
|
||||
End If
|
||||
End Sub
|
||||
Sub Wait(ByVal milliseconds As Integer)
|
||||
For x = 1 To milliseconds
|
||||
System.Threading.Thread.Sleep(1)
|
||||
Application.DoEvents()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub setLoadingTime(s As String)
|
||||
lblMs.Text = s
|
||||
End Sub
|
||||
|
||||
Private Sub btnKarten_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
'ContextMenuStrip
|
||||
|
||||
'setInfo("err", "Berichte sind noch nicht verfügbar!", 3)
|
||||
' End If
|
||||
End Sub
|
||||
|
||||
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles Me.Shown
|
||||
KdSearchBox1.Focus()
|
||||
UpdateUpdater.Interval = 5000
|
||||
UpdateUpdater.Enabled = True
|
||||
TimerUPDATE.Interval = 900000
|
||||
TimerUPDATE.Enabled = True
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub btnSchnittstelle_Click(sender As Object, e As EventArgs)
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME.ToLower = "admin" Then
|
||||
frmSecureLoginKassenbuch.Show()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateUpdater_Tick(sender As Object, e As EventArgs) Handles UpdateUpdater.Tick
|
||||
UpdateUpdater.Enabled = False
|
||||
Try
|
||||
Dim aktVersion = "3.0" ' Aktuelle Updater Version
|
||||
Dim F = "F:\Programme\SDL_install\"
|
||||
Dim doUpdaterUpdate = False
|
||||
If IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "\SDLUPDATER_Version.txt") Then 'Updater muss auch existieren, sonst wird er auch beim Developer Rechner eingefügt...
|
||||
Dim fs As New FileStream(AppDomain.CurrentDomain.BaseDirectory & "\SDLUPDATER_Version.txt", FileMode.Open, FileAccess.Read)
|
||||
Dim strmReader As New StreamReader(fs)
|
||||
Dim Version = strmReader.ReadLine
|
||||
If IsNumeric(Version.Replace(".", "")) Then
|
||||
If Version.Replace(".", "") < aktVersion.Replace(".", "") Then
|
||||
doUpdaterUpdate = True
|
||||
End If
|
||||
End If
|
||||
fs.Close()
|
||||
strmReader.Close()
|
||||
Else
|
||||
doUpdaterUpdate = True
|
||||
End If
|
||||
If Not doUpdaterUpdate Then Exit Sub
|
||||
|
||||
If IO.Directory.Exists(F) And IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "\SDLUPDATER.exe") Then 'Updater muss auch existieren, sonst wird er auch beim Developer Rechner eingefügt...
|
||||
For Each file As String In IO.Directory.GetFiles(F) ' Ermittelt alle Dateien des Ordners
|
||||
IO.File.Copy(file, AppDomain.CurrentDomain.BaseDirectory & cut_file(file), True) ' Kopiert die Dateien Next
|
||||
Next
|
||||
For Each file As String In IO.Directory.GetDirectories(F) ' Ermittelt alle Unterordner des Ordners
|
||||
My.Computer.FileSystem.CopyDirectory(file, AppDomain.CurrentDomain.BaseDirectory & cut_file(file), True)
|
||||
Next
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
'nix....
|
||||
End Try
|
||||
End Sub
|
||||
Private Function cut_file(ByVal file As String) As String ' Funktion zum Entfernen der Backslashs / Ordner While file.Contains("\") file = file.Remove(0, 1) End While Return file End Function
|
||||
While file.Contains("\")
|
||||
file = file.Remove(0, 1)
|
||||
End While
|
||||
Return file
|
||||
End Function
|
||||
|
||||
Private Sub btnAdministration_Click(sender As Object, e As EventArgs)
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("ADMINFUNCTIONS", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlAdministration
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Administration ist noch nicht verfügbar!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub btnUpdate_Click(sender As Object, e As EventArgs)
|
||||
frmLogin.UpdateSDL()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub KartenverwaltungToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles KartenverwaltungToolStripMenuItem.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_Kartenverwaltung", Me) = 0 Then '39
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlKartenDaten
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub VERAGCardParkplatzToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles VERAGCardParkplatzToolStripMenuItem.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_VERAG_Card", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlVERAGCard
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LKWListeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles LKWListeToolStripMenuItem.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_Hauptmenü", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlLkwListe
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AuswertungenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AuswertungenToolStripMenuItem.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_Auswertungen", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlMDMAuswertungen
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private WithEvents T As New Timers.Timer With {.Interval = 500, .Enabled = True, .AutoReset = True}
|
||||
Private FormCount As Integer = 1
|
||||
Private Sub SomeForm_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
|
||||
' If e.KeyData = Keys.Escape Then
|
||||
'Dim TheForm = DirectCast(DirectCast(sender, Control).TopLevelControl, Form)
|
||||
' If Not TheForm Is Nothing Then
|
||||
'TheForm.Close()
|
||||
' End If
|
||||
'End If
|
||||
If e.KeyData = Keys.PrintScreen Then
|
||||
Dim TheForm = DirectCast(DirectCast(sender, Control).TopLevelControl, Form)
|
||||
If Not TheForm Is Nothing Then
|
||||
Dim c As New cProgramFunctions
|
||||
c.screenshot()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub HookControls(ByVal f As Control)
|
||||
For Each Control As Control In f.Controls
|
||||
AddHandler Control.KeyUp, AddressOf SomeForm_KeyUp
|
||||
If Control.Controls.Count <> 0 Then
|
||||
HookControls(Control)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
Private Sub T_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles T.Elapsed
|
||||
If FormCount = 0 Then FormCount = 1
|
||||
Dim FormOpened As Integer = My.Application.OpenForms.Count
|
||||
If FormCount <> FormOpened Then
|
||||
If FormOpened > FormCount Then
|
||||
For x As Integer = 1 To (FormOpened - FormCount)
|
||||
Dim F As Form = My.Application.OpenForms.Item(FormOpened - x)
|
||||
AddHandler F.KeyDown, AddressOf SomeForm_KeyUp
|
||||
HookControls(F)
|
||||
FormCount = My.Application.OpenForms.Count
|
||||
Next
|
||||
Else
|
||||
FormCount = My.Application.OpenForms.Count
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnZoll_Click(sender As Object, e As EventArgs)
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("ZOLL_Hauptmenü", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlZollHauptmenue
|
||||
usrCntl.BERECHTIGUNEN = BERECHTIGUNEN
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem1.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("ZOLL_Kundenzolltarif", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlZollArtikel
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AuswertungenToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles AuswertungenToolStripMenuItem1.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("ZOLL_Auswertungen", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlZOLLAuswertungen
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click_1(sender As Object, e As EventArgs)
|
||||
Dim SC As New cServerClient
|
||||
SC.begin("192.168.0.95", "FSSAtlasStart") '95 =atlas
|
||||
|
||||
AddHandler SC.FunctionFinished, Sub(se As Object, ev As FunctionFinishedArgs)
|
||||
If ev.Result = FunctionFinishedArgs.EventResult.OK Then
|
||||
MsgBox("OK" & vbNewLine & ev.Message)
|
||||
Else
|
||||
MsgBox(ev.Message)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click_2(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
frmInfo.Show()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub btnTest_Click(sender As Object, e As EventArgs) Handles btnTest.Click
|
||||
Form1.Show()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub Button4_Click_1(sender As Object, e As EventArgs) Handles Button4.Click
|
||||
Me.WindowState = FormWindowState.Minimized
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles UpdateToolStripMenuItem.Click
|
||||
frmLogin.UpdateSDL()
|
||||
End Sub
|
||||
|
||||
Private Sub MenuStripSDL_ItemClicked(sender As Object, e As ToolStripItemClickedEventArgs) Handles MenuStripSDL.ItemClicked
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub mnueKunden_Click(sender As Object, e As EventArgs) Handles mnueKunden.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_Hauptmenü", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlKunden
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Kundendaten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub mnueBerichte_Click(sender As Object, e As EventArgs) Handles mnueBerichte.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_Hauptmenü", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlSeriendruck
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Berichte sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub mnueBuchhaltung_Click(sender As Object, e As EventArgs) Handles mnueBuchhaltung.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("BH_Hauptmenü", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlBH
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub mnueKassenbuch_Click(sender As Object, e As EventArgs) Handles mnueKassenbuch.Click
|
||||
' MsgBox(VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("KASSE", "SDL"))
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("KASSE", "SDL") Or
|
||||
VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("KASSE_BH_Login", "SDL") Or
|
||||
VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("KASSE_Saldo_Anzeige", "SDL") Then
|
||||
Dim frmSecureLoginKassenbuch As New SDL.frmSecureLoginKassenbuch()
|
||||
frmSecureLoginKassenbuch.openKB = True
|
||||
frmSecureLoginKassenbuch.ShowDialog(Me)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AdministrationToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles mnueAdministration.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("ADMINFUNCTIONS", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlAdministration
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Administration ist noch nicht verfügbar!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub KartenverwaltungToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles KartenverwaltungToolStripMenuItem1.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_Kartenverwaltung", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlKartenDaten
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub VERAGCardParkplatzToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles VERAGCardParkplatzToolStripMenuItem1.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_VERAG_Card", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlVERAGCard
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LKWListeToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles LKWListeToolStripMenuItem1.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_Hauptmenü", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlLkwListe
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AuswertungenToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles AuswertungenToolStripMenuItem2.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_Auswertungen", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlMDMAuswertungen
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ArtikelTarifierenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ArtikelTarifierenToolStripMenuItem.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("ZOLL_Kundenzolltarif", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlZollArtikel
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AuswertungToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AuswertungToolStripMenuItem.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("ZOLL_Auswertungen", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlZOLLAuswertungen
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' Private Sub mnueMDM_Click(sender As Object, e As EventArgs) Handles mnueMDM.MouseHover, mnueZoll.MouseHover
|
||||
' sender.ShowDropDown()
|
||||
'End Sub
|
||||
|
||||
Private Sub TESTToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TESTToolStripMenuItem.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME = "ADMIN" Then
|
||||
frmQRCode.Show()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub KdSearchBox1_GotFocus(sender As Object, e As EventArgs) Handles KdSearchBox1.GotFocus
|
||||
pnlJumpKunde.BackColor = SystemColors.MenuHighlight
|
||||
Label1.ForeColor = Color.White
|
||||
Label3.ForeColor = Color.White
|
||||
End Sub
|
||||
|
||||
Private Sub KdSearchBox1_LostFocus(sender As Object, e As EventArgs) Handles KdSearchBox1.LostFocus
|
||||
pnlJumpKunde.BackColor = Color.FromArgb(224, 224, 224)
|
||||
Label1.ForeColor = Color.Black
|
||||
Label3.ForeColor = Color.Black
|
||||
End Sub
|
||||
|
||||
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
|
||||
cProgramFunctions.newFrmData(Me.FindForm, New Integer = -1, New Integer = -1, New String(""), New Integer = -1, True)
|
||||
End Sub
|
||||
|
||||
Private Sub FlatButton1_Click(sender As Object, e As EventArgs) Handles FlatButton1.Click
|
||||
If Not My.Computer.FileSystem.DirectoryExists(Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\tmp\") Then
|
||||
My.Computer.FileSystem.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\tmp\")
|
||||
End If
|
||||
|
||||
Dim strFileName As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\tmp\tmp.doc"
|
||||
|
||||
|
||||
Dim pfad = AppDomain.CurrentDomain.BaseDirectory & "Resources\Retour\VIATOLL.doc"
|
||||
|
||||
|
||||
Dim oWord As New Microsoft.Office.Interop.Word.Application
|
||||
Dim odoc As Microsoft.Office.Interop.Word.Document
|
||||
Try
|
||||
oWord.Visible = True 'Word sehen zum Test?
|
||||
odoc = oWord.Documents.Open(pfad)
|
||||
odoc.SaveAs(strFileName)
|
||||
|
||||
'doc.Protect(WdProtectionType.wdNoProtection)
|
||||
odoc.Activate()
|
||||
|
||||
'Dim oDoc As Microsoft.Office.Interop.Word.Document = oWord.Documents.Open(pfad)
|
||||
Dim oTable As Word.Table
|
||||
' Dim oPara1 As Word.Paragraph, oPara2 As Word.Paragraph
|
||||
' Dim oPara3 As Word.Paragraph, oPara4 As Word.Paragraph
|
||||
' Dim oRng As Word.Range
|
||||
' Dim oShape As Word.InlineShape
|
||||
|
||||
'Word starten und Dokumentvorlage öffnen.
|
||||
'oWord = CreateObject("Word.Application")
|
||||
' oWord.Visible = True
|
||||
odoc.FormFields("Anzahl").Range.Text = "2"
|
||||
odoc.FormFields("KdName").Range.Text = "VERAG Spedition AG"
|
||||
odoc.FormFields("KdStrasse").Range.Text = "Suben Nr. 100"
|
||||
odoc.FormFields("KdOrt").Range.Text = "A 4975 Suben"
|
||||
odoc.FormFields("KdNrVERAG").Range.Text = "401053"
|
||||
odoc.FormFields("KdNrMST").Range.Text = "123456"
|
||||
odoc.FormFields("Sachbearbeiter").Range.Text = "Andreas Luxbauer"
|
||||
|
||||
' oDoc = oWord.Documents.Add
|
||||
|
||||
If odoc.Range.Bookmarks.Exists("TabelleKarten2") Then
|
||||
If odoc.Bookmarks("TabelleKarten2").Range.Tables.Count > 0 Then
|
||||
oTable = odoc.Bookmarks("TabelleKarten2").Range.Tables(1)
|
||||
For i As Integer = 2 To 5
|
||||
oTable.Rows(i).Cells(1).Range.Text = "ST008OR"
|
||||
oTable.Rows(i).Cells(2).Range.Text = "7083801193800691"
|
||||
oTable.Rows(i).Cells(3).Range.Text = ""
|
||||
If i < 5 Then oTable.Rows.Add()
|
||||
Next i
|
||||
End If
|
||||
Else
|
||||
MessageBox.Show("Textmarke nicht vorhanden!")
|
||||
End If
|
||||
' WordApp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone
|
||||
odoc.Save()
|
||||
|
||||
Catch ex As Exception
|
||||
MessageBox.Show(ex.ToString)
|
||||
' Log.SaveLogFile(ex.ToString)
|
||||
'Finally
|
||||
' word.Application.Quit()
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub SpeditionsbuchToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SpeditionsbuchToolStripMenuItem.Click
|
||||
Dim frmSpeditionsbuchSuche As New frmSpeditionsbuchSuche
|
||||
frmSpeditionsbuchSuche.Show(Me)
|
||||
End Sub
|
||||
|
||||
Private Sub SDLAbholaufträgeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SDLAbholaufträgeToolStripMenuItem.Click
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG("MDM_Kartenverwaltung", Me) = 0 Then
|
||||
clrPnlMain()
|
||||
Dim usrCntl As New usrCntlSDLAbholung
|
||||
usrCntl.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
pnlMain.Controls.Add(usrCntl)
|
||||
Else
|
||||
setInfo("err", "Daten sind noch nicht freigegeben!", 3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click
|
||||
Dim f As New frmSDLAbholungEintrag
|
||||
If f.ShowDialog(Me) = DialogResult.OK Then
|
||||
SDLAbholaufträgeToolStripMenuItem.PerformClick()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub NeueSMSSendenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NeueSMSSendenToolStripMenuItem.Click
|
||||
Dim f As New SDL.frmSendSMS("", "")
|
||||
f.ShowDialog()
|
||||
End Sub
|
||||
|
||||
Private Sub SMSVerlaufToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SMSVerlaufToolStripMenuItem.Click
|
||||
Dim f As New SDL.frmSMS
|
||||
f.Show(Me)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class MyRenderer
|
||||
Inherits ToolStripProfessionalRenderer
|
||||
|
||||
Protected Overloads Overrides Sub OnRenderMenuItemBackground(ByVal e As ToolStripItemRenderEventArgs)
|
||||
If e.Item.GetCurrentParent.Name = "MenuStripSDL" Then
|
||||
Dim rc As New Rectangle(Point.Empty, e.Item.Size)
|
||||
Dim c As Color = IIf(e.Item.Selected, Color.LightSteelBlue, Color.FromArgb(0, 54, 128))
|
||||
e.Item.ForeColor = IIf(e.Item.Selected, Color.Black, Color.White)
|
||||
'e.Graphics.DrawRectangle(New Pen(Brushes.White), rc)
|
||||
Using brush As New SolidBrush(c)
|
||||
e.Graphics.FillRectangle(brush, rc)
|
||||
End Using
|
||||
Else
|
||||
Dim rc As New Rectangle(Point.Empty, e.Item.Size)
|
||||
Dim c As Color = IIf(e.Item.Selected, Color.LightSteelBlue, Color.White)
|
||||
|
||||
Using brush As New SolidBrush(c)
|
||||
e.Graphics.FillRectangle(brush, rc)
|
||||
End Using
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user