This repository has been archived by the owner on Jun 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml.vb
68 lines (59 loc) · 2.42 KB
/
MainWindow.xaml.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Imports System.Globalization
Imports GalaSoft.MvvmLight
Imports System.Windows.Threading
Class MainWindow
Dim timerTestNetwork As DispatcherTimer
Private Sub timerTestNetwork_Tick()
Try
DirectCast(Me.DataContext, vmMain).RaiseNetworkError()
Catch ex As Exception
global_EmailErrorLog("timer tick error " & ex.Message)
End Try
End Sub
Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
Try
Me.Top = 10
Me.MaxHeight = global_ScreenHeight - 30
Dim vm As New vmMain
Me.DataContext = vm
Me.txtJobSearch.Focus()
If sUserlevel = UserRights.Sales Then
End If
If sUserlevel <= UserRights.Shipping Then
Me.tabShipping.Visibility = Windows.Visibility.Visible
Else
Me.tabShipping.Visibility = Windows.Visibility.Collapsed
End If
If sUserlevel <= UserRights.AdminAsst Then
Me.tabAdmin.Visibility = Windows.Visibility.Visible
Else
Me.tabAdmin.Visibility = Windows.Visibility.Collapsed
End If
If sUserlevel <= UserRights.Admin Then
Me.tabAccounting.Visibility = Windows.Visibility.Visible
Else
Me.tabAccounting.Visibility = Windows.Visibility.Collapsed
End If
If sUserlevel = UserRights.Payroll Then
Me.tabPayroll.Visibility = Windows.Visibility.Visible
Me.btnCommissions.Visibility = Windows.Visibility.Visible
Else
Me.tabPayroll.Visibility = Windows.Visibility.Collapsed
Me.btnCommissions.Visibility = Windows.Visibility.Collapsed
End If
If global_Username.ToUpper.Contains("WAREHOUSE") Then
Me.tabShipping.Visibility = Windows.Visibility.Visible
Me.tabSales.Visibility = Windows.Visibility.Collapsed
End If
Catch ex As Exception
MessageBox.Show("error in main screen loading : " & ex.Message)
End Try
Try
timerTestNetwork = New DispatcherTimer()
AddHandler timerTestNetwork.Tick, AddressOf timerTestNetwork_Tick
timerTestNetwork.Interval = New TimeSpan(0, 0, 11)
timerTestNetwork.Start()
Catch
End Try
End Sub
End Class