-
Notifications
You must be signed in to change notification settings - Fork 4
/
modMain.cs
122 lines (102 loc) · 3.76 KB
/
modMain.cs
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
using System;
using Mobilize.WebMap.Common.Attributes;
using Mobilize.Web.Extensions;
namespace SKS
{
[Observable]
internal static class modMain
{
[Intercepted]
public static bool CurrentUserAdmin { get; set; } = false;
[Intercepted]
public static string UserFullname { get; set; } = "";
[Intercepted]
public static string UserLevel { get; set; } = "";
[Intercepted]
public static string UserId { get; set; } = "";
[Intercepted]
public static string ConnectionString { get; set; } = "";
[Intercepted]
public static int DetectionType { get; set; } = 0;
[Intercepted]
public static double n { get; set; } = 0;
[Intercepted]
public static int i { get; set; } = 0;
[Intercepted]
public static string s { get; set; } = "";
[Intercepted]
public static System.DateTime d { get; set; } = DateTime.FromOADate(0);
[Intercepted]
public static string msg { get; set; } = "";
[Intercepted]
public static string ImgName { get; set; } = "";
[Intercepted]
public static string ImgSrc { get; set; } = "";
//UPGRADE_WARNING: (1047) Application will terminate when Sub Main() finishes. More Information: https://docs.mobilize.net/vbuc/ewis#1047
[STAThread]
public static void Main()
{
Stub._System.Windows.Forms.Application.EnableVisualStyles();
Stub._System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
ConnectionString = "DRIVER=SQLite3 ODBC Driver; Database=Orders.db; LongNames=0; Timeout=1000; NoTXN=0; SyncPragma=NORMAL; StepAPI=0;";
modConnection.OpenConnection();
CurrentUserAdmin = true;
UserFullname = "Allan Cantillo";
UserLevel = "Administrator";
UserId = "acantillo";
frmMain.DefInstance.Show();
}
internal static void LogStatus(string message, Mobilize.Web.Form frm = null)
{
Mobilize.Web.StatusStrip sb = null;
sb = null;
((Mobilize.Web.ToolStripStatusLabel)frmMain.DefInstance.sbStatusBar.Items[0]).Text = message;
if ( frm != null )
{
if ( frm == frmAdjustStockManual.DefInstance )
{
sb = frmAdjustStockManual.DefInstance.sbStatusBar;
}
else if ( frm == frmActionOrderReception.DefInstance )
{
sb = frmActionOrderReception.DefInstance.sbStatusBar;
}
else if ( frm == frmActionOrderRequest.DefInstance )
{
sb = frmActionOrderRequest.DefInstance.sbStatusBar;
}
else if ( frm == frmAddStockManual.DefInstance )
{
sb = frmAddStockManual.DefInstance.sbStatusBar;
}
else if ( frm == frmReceptionApproval.DefInstance )
{
sb = frmReceptionApproval.DefInstance.sbStatusBar;
}
else if ( frm == frmOrderReception.DefInstance )
{
sb = frmOrderReception.DefInstance.sbStatusBar;
}
else if ( frm == frmOrderRequest.DefInstance )
{
sb = frmOrderRequest.DefInstance.sbStatusBar;
}
else if ( frm == frmRequestApproval.DefInstance )
{
sb = frmRequestApproval.DefInstance.sbStatusBar;
}
if ( sb != null )
{
if ( ((Mobilize.Web.ToolStripStatusLabel)sb.Items[0]) != null )
{
((Mobilize.Web.ToolStripStatusLabel)sb.Items[0]).Text = message;
}
}
}
}
internal static void ClearLogStatus(Mobilize.Web.Form frm = null)
{
LogStatus("", frm);
}
}
}