Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
KGOrders
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cam Hayes
KGOrders
Commits
38b88255
Commit
38b88255
authored
Dec 13, 2024
by
Elias Sarraf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup project + merge cam & cam2 branches
parent
1589dd42
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
129 additions
and
74 deletions
+129
-74
.gitignore
.gitignore
+2
-2
webKGOrders.dpr
kgOrdersClient/webKGOrders.dpr
+1
-1
Api.Server.Module.dfm
kgOrdersServer/Source/Api.Server.Module.dfm
+3
-3
Api.Server.Module.pas
kgOrdersServer/Source/Api.Server.Module.pas
+1
-1
Auth.Database.pas
kgOrdersServer/Source/Auth.Database.pas
+32
-7
Auth.Server.Module.dfm
kgOrdersServer/Source/Auth.Server.Module.dfm
+1
-1
Auth.Server.Module.pas
kgOrdersServer/Source/Auth.Server.Module.pas
+1
-1
Data.dfm
kgOrdersServer/Source/Data.dfm
+2
-3
Data.pas
kgOrdersServer/Source/Data.pas
+2
-2
KGOrders.Database.dfm
kgOrdersServer/Source/KGOrders.Database.dfm
+12
-12
KGOrders.Database.pas
kgOrdersServer/Source/KGOrders.Database.pas
+53
-17
Lookup.Service.pas
kgOrdersServer/Source/Lookup.Service.pas
+0
-1
Lookup.ServiceImpl.pas
kgOrdersServer/Source/Lookup.ServiceImpl.pas
+3
-4
Main.pas
kgOrdersServer/Source/Main.pas
+2
-1
kgOrdersServer.dpr
kgOrdersServer/kgOrdersServer.dpr
+10
-12
kgOrdersServer.dproj
kgOrdersServer/kgOrdersServer.dproj
+2
-2
kgOrdersServer.ini
kgOrdersServer/kgOrdersServer.ini
+2
-4
No files found.
.gitignore
View file @
38b88255
...
@@ -14,10 +14,10 @@ kgOrdersServer/Win32/
...
@@ -14,10 +14,10 @@ kgOrdersServer/Win32/
kgOrdersServer/Source/__history/
kgOrdersServer/Source/__history/
kgOrdersServer/Source/__recovery/
kgOrdersServer/Source/__recovery/
*.local
*.exe
*.exe
*.local
*.identcache
*.identcache
*.res
*.res
*.skincfg
*.tvsconfig
*.tvsconfig
*.skincfg
kgOrdersClient/webKGOrders.dpr
View file @
38b88255
...
@@ -67,5 +67,5 @@ begin
...
@@ -67,5 +67,5 @@ begin
Application.MainFormOnTaskbar := True;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TDMConnection, DMConnection);
Application.CreateForm(TDMConnection, DMConnection);
DMConnection.InitApp(@StartApplication, @UnauthorizedAccessProc);
DMConnection.InitApp(@StartApplication, @UnauthorizedAccessProc);
Application.Run;
//
Application.Run;
end.
end.
kgOrdersServer/Source/Api.Server.Module.dfm
View file @
38b88255
...
@@ -7,7 +7,7 @@ object ApiServerModule: TApiServerModule
...
@@ -7,7 +7,7 @@ object ApiServerModule: TApiServerModule
Top = 30
Top = 30
end
end
object XDataServer: TXDataServer
object XDataServer: TXDataServer
BaseUrl = 'http://localhost:2004/emsys/
envoy
/api/'
BaseUrl = 'http://localhost:2004/emsys/
kgOrders
/api/'
Dispatcher = SparkleHttpSysDispatcher
Dispatcher = SparkleHttpSysDispatcher
ModelName = 'Api'
ModelName = 'Api'
EntitySetPermissions = <>
EntitySetPermissions = <>
...
@@ -16,8 +16,8 @@ object ApiServerModule: TApiServerModule
...
@@ -16,8 +16,8 @@ object ApiServerModule: TApiServerModule
SwaggerUIOptions.Enabled = True
SwaggerUIOptions.Enabled = True
SwaggerUIOptions.ShowFilter = True
SwaggerUIOptions.ShowFilter = True
SwaggerUIOptions.TryItOutEnabled = True
SwaggerUIOptions.TryItOutEnabled = True
Left = 8
5
Left = 8
9
Top = 11
0
Top = 11
2
object XDataServerLogging: TSparkleGenericMiddleware
object XDataServerLogging: TSparkleGenericMiddleware
OnMiddlewareCreate = XDataServerLoggingMiddlewareCreate
OnMiddlewareCreate = XDataServerLoggingMiddlewareCreate
end
end
...
...
kgOrdersServer/Source/Api.Server.Module.pas
View file @
38b88255
...
@@ -82,7 +82,7 @@ begin
...
@@ -82,7 +82,7 @@ begin
XDataServer
.
ModelName
:=
AModelName
;
XDataServer
.
ModelName
:=
AModelName
;
SparkleHttpSysDispatcher
.
Start
;
SparkleHttpSysDispatcher
.
Start
;
Logger
.
Log
(
1
,
Format
(
'Api server module listening at "%s"'
,
[
Url
]));
Logger
.
Log
(
1
,
Format
(
'Api server module listening at "%s"'
,
[
XDataServer
.
Base
Url
]));
end
;
end
;
procedure
TApiServerModule
.
XDataServerLoggingMiddlewareCreate
(
Sender
:
TObject
;
procedure
TApiServerModule
.
XDataServerLoggingMiddlewareCreate
(
Sender
:
TObject
;
...
...
kgOrdersServer/Source/Auth.Database.pas
View file @
38b88255
...
@@ -42,33 +42,58 @@ var
...
@@ -42,33 +42,58 @@ var
iniFile
:
TIniFile
;
iniFile
:
TIniFile
;
iniStr
:
string
;
iniStr
:
string
;
begin
begin
Logger
.
Log
(
5
,
'TAuthDatabase.DataModuleCreate'
);
iniFile
:=
TIniFile
.
Create
(
ExtractFilePath
(
Application
.
ExeName
)
+
'kgOrdersServer.ini'
);
iniFile
:=
TIniFile
.
Create
(
ExtractFilePath
(
Application
.
ExeName
)
+
'kgOrdersServer.ini'
);
try
try
Logger
.
Log
(
5
,
'--iniFile entries:'
);
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Server'
,
''
);
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Server'
,
''
);
if
not
iniStr
.
IsEmpty
then
if
iniStr
.
IsEmpty
then
Logger
.
Log
(
5
,
'----Database->Server: Entry not found'
)
else
begin
Logger
.
Log
(
5
,
'----Database->Server: iniStr'
);
ucKG
.
Server
:=
iniStr
;
ucKG
.
Server
:=
iniStr
;
end
;
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Database'
,
''
);
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Database'
,
''
);
if
not
iniStr
.
IsEmpty
then
if
iniStr
.
IsEmpty
then
Logger
.
Log
(
5
,
'----Database->Database: Entry not found'
)
else
begin
Logger
.
Log
(
5
,
'----Database->Database: iniStr'
);
ucKG
.
Database
:=
iniStr
;
ucKG
.
Database
:=
iniStr
;
end
;
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Username'
,
''
);
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Username'
,
''
);
if
not
iniStr
.
IsEmpty
then
if
iniStr
.
IsEmpty
then
Logger
.
Log
(
5
,
'----Database->Username: Entry not found'
)
else
begin
Logger
.
Log
(
5
,
'----Database->Username: '
+
iniStr
);
ucKG
.
Username
:=
iniStr
;
ucKG
.
Username
:=
iniStr
;
end
;
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Password'
,
''
);
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Password'
,
''
);
if
not
iniStr
.
IsEmpty
then
if
iniStr
.
IsEmpty
then
Logger
.
Log
(
5
,
'----Database->Password: Entry not found'
)
else
begin
Logger
.
Log
(
5
,
'----Database->Password: xxxxxxxx'
);
ucKG
.
Password
:=
iniStr
;
ucKG
.
Password
:=
iniStr
;
end
;
try
try
ucKG
.
Connect
;
ucKG
.
Connect
;
except
except
on
E
:
Exception
do
on
E
:
Exception
do
begin
begin
Logger
.
Log
(
5
,
'Failed to connect to auth
database: '
+
E
.
Message
);
Logger
.
Log
(
3
,
'--TAuthDatabase.DataModuleCreate -Error connecting to
database: '
+
E
.
Message
);
end
;
end
;
end
;
end
;
Logger
.
Log
(
1
,
''
);
Logger
.
Log
(
1
,
''
);
finally
finally
I
niFile
.
Free
;
i
niFile
.
Free
;
end
;
end
;
end
;
end
;
...
...
kgOrdersServer/Source/Auth.Server.Module.dfm
View file @
38b88255
...
@@ -6,7 +6,7 @@ object AuthServerModule: TAuthServerModule
...
@@ -6,7 +6,7 @@ object AuthServerModule: TAuthServerModule
Top = 16
Top = 16
end
end
object XDataServer: TXDataServer
object XDataServer: TXDataServer
BaseUrl = 'http://localhost:2004/emsys/
envoy
/auth/'
BaseUrl = 'http://localhost:2004/emsys/
kgOrders
/auth/'
Dispatcher = SparkleHttpSysDispatcher
Dispatcher = SparkleHttpSysDispatcher
ModelName = 'Auth'
ModelName = 'Auth'
EntitySetPermissions = <>
EntitySetPermissions = <>
...
...
kgOrdersServer/Source/Auth.Server.Module.pas
View file @
38b88255
...
@@ -67,7 +67,7 @@ begin
...
@@ -67,7 +67,7 @@ begin
XDataServer
.
ModelName
:=
AModelName
;
XDataServer
.
ModelName
:=
AModelName
;
SparkleHttpSysDispatcher
.
Start
;
SparkleHttpSysDispatcher
.
Start
;
Logger
.
Log
(
1
,
Format
(
'Auth server module listening at "%s"'
,
[
Url
]));
Logger
.
Log
(
1
,
Format
(
'Auth server module listening at "%s"'
,
[
XDataServer
.
Base
Url
]));
end
;
end
;
procedure
TAuthServerModule
.
XDataServerLoggingMiddlewareCreate
(
Sender
:
TObject
;
procedure
TAuthServerModule
.
XDataServerLoggingMiddlewareCreate
(
Sender
:
TObject
;
...
...
kgOrdersServer/Source/Data.dfm
View file @
38b88255
...
@@ -172,7 +172,7 @@ object FData: TFData
...
@@ -172,7 +172,7 @@ object FData: TFData
SortSettings.HeaderColorTo = clWhite
SortSettings.HeaderColorTo = clWhite
SortSettings.HeaderMirrorColor = clWhite
SortSettings.HeaderMirrorColor = clWhite
SortSettings.HeaderMirrorColorTo = clWhite
SortSettings.HeaderMirrorColorTo = clWhite
Version = '2.8.3.
1
'
Version = '2.8.3.
2
'
AutoCreateColumns = True
AutoCreateColumns = True
AutoRemoveColumns = True
AutoRemoveColumns = True
Columns = <
Columns = <
...
@@ -753,7 +753,7 @@ object FData: TFData
...
@@ -753,7 +753,7 @@ object FData: TFData
SortSettings.HeaderColorTo = clWhite
SortSettings.HeaderColorTo = clWhite
SortSettings.HeaderMirrorColor = clWhite
SortSettings.HeaderMirrorColor = clWhite
SortSettings.HeaderMirrorColorTo = clWhite
SortSettings.HeaderMirrorColorTo = clWhite
Version = '2.8.3.
1
'
Version = '2.8.3.
2
'
AutoCreateColumns = True
AutoCreateColumns = True
AutoRemoveColumns = True
AutoRemoveColumns = True
Columns = <
Columns = <
...
@@ -1505,7 +1505,6 @@ object FData: TFData
...
@@ -1505,7 +1505,6 @@ object FData: TFData
Top = 472
Top = 472
end
end
object uqUsers: TUniQuery
object uqUsers: TUniQuery
Connection = FDatabaseModule.ucKG
SQL.Strings = (
SQL.Strings = (
'select * from users')
'select * from users')
Left = 669
Left = 669
...
...
kgOrdersServer/Source/Data.pas
View file @
38b88255
...
@@ -51,11 +51,11 @@ implementation
...
@@ -51,11 +51,11 @@ implementation
{$R *.dfm}
{$R *.dfm}
uses
Database
,
uLibrary
;
uses
KGOrders
.
Database
,
uLibrary
;
procedure
TFData
.
FormCreate
(
Sender
:
TObject
);
procedure
TFData
.
FormCreate
(
Sender
:
TObject
);
begin
begin
FDatabaseModule
:=
TFDatabaseModul
e
.
Create
(
Self
);
KGOrdersDatabase
:=
TKGOrdersDatabas
e
.
Create
(
Self
);
end
;
end
;
procedure
TFData
.
btnFindClick
(
Sender
:
TObject
);
procedure
TFData
.
btnFindClick
(
Sender
:
TObject
);
...
...
kgOrdersServer/Source/Database.dfm
→
kgOrdersServer/Source/
KGOrders.
Database.dfm
View file @
38b88255
object
FDatabaseModule: TFDatabaseModul
e
object
KGOrdersDatabase: TKGOrdersDatabas
e
OnCreate = DataModuleCreate
OnCreate = DataModuleCreate
Height =
480
Height =
358
Width =
640
Width =
519
object ucKG: TUniConnection
object ucKG: TUniConnection
ProviderName = 'MySQL'
ProviderName = 'MySQL'
Database = 'kg_order_entry'
Database = 'kg_order_entry'
Username = 'root'
Username = 'root'
LoginPrompt = False
LoginPrompt = False
Left = 75
Left = 75
Top =
139
Top =
65
EncryptedPassword = '9AFF92FF8CFF86FF8CFFCFFFCEFF'
EncryptedPassword = '9AFF92FF8CFF86FF8CFFCFFFCEFF'
end
end
object UniQuery1: TUniQuery
object UniQuery1: TUniQuery
Connection = ucKG
Connection = ucKG
SQL.Strings = (
SQL.Strings = (
'')
'')
Left =
36
3
Left =
7
3
Top = 1
3
8
Top = 1
4
8
end
end
object MySQLUniProvider1: TMySQLUniProvider
object MySQLUniProvider1: TMySQLUniProvider
Left =
220
Left =
162
Top =
134
Top =
66
end
end
object UniQuery2: TUniQuery
object UniQuery2: TUniQuery
Connection = ucKG
Connection = ucKG
SQL.Strings = (
SQL.Strings = (
'')
'')
Left =
433
Left =
179
Top = 14
4
Top = 14
8
end
end
object uqOrders: TUniQuery
object uqOrders: TUniQuery
Connection = ucKG
Connection = ucKG
SQL.Strings = (
SQL.Strings = (
'select * from corrugated_plate_orders')
'select * from corrugated_plate_orders')
Left =
527
Left =
263
Top = 1
20
Top = 1
56
object uqOrdersORDER_ID: TIntegerField
object uqOrdersORDER_ID: TIntegerField
FieldName = 'ORDER_ID'
FieldName = 'ORDER_ID'
end
end
...
...
kgOrdersServer/Source/Database.pas
→
kgOrdersServer/Source/
KGOrders.
Database.pas
View file @
38b88255
// Where the database is kept. Only used by Lookup.ServiceImpl to retrieve info
// Where the database is kept. Only used by Lookup.ServiceImpl to retrieve info
// from the data base and send it to the client.
// from the data base and send it to the client.
// Author: ???
// Author: ???
unit
Database
;
unit
KGOrders
.
Database
;
interface
interface
...
@@ -11,7 +11,7 @@ uses
...
@@ -11,7 +11,7 @@ uses
Common
.
Logging
,
Vcl
.
Forms
,
MySQLUniProvider
;
Common
.
Logging
,
Vcl
.
Forms
,
MySQLUniProvider
;
type
type
T
FDatabaseModul
e
=
class
(
TDataModule
)
T
KGOrdersDatabas
e
=
class
(
TDataModule
)
ucKG
:
TUniConnection
;
ucKG
:
TUniConnection
;
UniQuery1
:
TUniQuery
;
UniQuery1
:
TUniQuery
;
MySQLUniProvider1
:
TMySQLUniProvider
;
MySQLUniProvider1
:
TMySQLUniProvider
;
...
@@ -113,7 +113,7 @@ type
...
@@ -113,7 +113,7 @@ type
end
;
end
;
var
var
FDatabaseModule
:
TFDatabaseModul
e
;
KGOrdersDatabase
:
TKGOrdersDatabas
e
;
implementation
implementation
...
@@ -121,35 +121,71 @@ implementation
...
@@ -121,35 +121,71 @@ implementation
{$R *.dfm}
{$R *.dfm}
procedure
TFDatabaseModule
.
DataModuleCreate
(
Sender
:
TObject
);
procedure
TKGOrdersDatabase
.
DataModuleCreate
(
Sender
:
TObject
);
// Sets the database connection to the ini file IP
// TODO: clean up unnecessary reads from the ini file
var
var
I
niFile
:
TIniFile
;
i
niFile
:
TIniFile
;
iniStr
:
string
;
iniStr
:
string
;
begin
begin
IniFile
:=
TIniFile
.
Create
(
ChangeFileExt
(
Application
.
ExeName
,
'.ini'
)
);
Logger
.
Log
(
5
,
'TKGOrdersDatabase.DataModuleCreate'
);
iniFile
:=
TIniFile
.
Create
(
ExtractFilePath
(
Application
.
ExeName
)
+
'kgOrdersServer.ini'
);
try
try
iniStr
:=
IniFile
.
ReadString
(
'Database'
,
'Server'
,
''
);
Logger
.
Log
(
5
,
'--iniFile entries:'
);
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Server'
,
''
);
if
iniStr
.
IsEmpty
then
if
iniStr
.
IsEmpty
then
Logger
.
Log
(
1
,
'iniFile: '
+
ChangeFileExt
(
Application
.
ExeName
,
'.ini'
)
+
Logger
.
Log
(
5
,
'----Database->Server: Entry not found'
)
' Database->Server: Entry not found'
)
else
else
begin
begin
Logger
.
Log
(
1
,
'iniFile: '
+
ChangeFileExt
(
Application
.
ExeName
,
'.ini'
)
+
Logger
.
Log
(
5
,
'----Database->Server: iniStr'
);
' Database->Server: '
+
iniStr
);
ucKG
.
Server
:=
iniStr
;
ucKG
.
Server
:=
iniStr
;
end
;
end
;
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Database'
,
''
);
if
iniStr
.
IsEmpty
then
Logger
.
Log
(
5
,
'----Database->Database: Entry not found'
)
else
begin
Logger
.
Log
(
5
,
'----Database->Database: iniStr'
);
ucKG
.
Database
:=
iniStr
;
end
;
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Username'
,
''
);
if
iniStr
.
IsEmpty
then
Logger
.
Log
(
5
,
'----Database->Username: Entry not found'
)
else
begin
Logger
.
Log
(
5
,
'----Database->Username: '
+
iniStr
);
ucKG
.
Username
:=
iniStr
;
end
;
iniStr
:=
iniFile
.
ReadString
(
'Database'
,
'Password'
,
''
);
if
iniStr
.
IsEmpty
then
Logger
.
Log
(
5
,
'----Database->Password: Entry not found'
)
else
begin
Logger
.
Log
(
5
,
'----Database->Password: xxxxxxxx'
);
ucKG
.
Password
:=
iniStr
;
end
;
try
ucKG
.
Connect
;
except
on
E
:
Exception
do
begin
Logger
.
Log
(
3
,
'--TKGOrdersDatabase.DataModuleCreate -Error connecting to database: '
+
E
.
Message
);
end
;
end
;
Logger
.
Log
(
1
,
''
);
finally
finally
I
niFile
.
Free
;
i
niFile
.
Free
;
end
;
end
;
end
;
end
;
class
procedure
T
FDatabaseModul
e
.
ExecSQL
(
const
SQL
:
string
);
class
procedure
T
KGOrdersDatabas
e
.
ExecSQL
(
const
SQL
:
string
);
var
var
DB
:
T
FDatabaseModul
e
;
DB
:
T
KGOrdersDatabas
e
;
begin
begin
DB
:=
T
FDatabaseModul
e
.
Create
(
nil
);
DB
:=
T
KGOrdersDatabas
e
.
Create
(
nil
);
try
try
DB
.
UniQuery1
.
SQL
.
Text
:=
SQL
;
DB
.
UniQuery1
.
SQL
.
Text
:=
SQL
;
DB
.
UniQuery1
.
ExecSQL
;
DB
.
UniQuery1
.
ExecSQL
;
...
...
kgOrdersServer/Source/Lookup.Service.pas
View file @
38b88255
...
@@ -141,7 +141,6 @@ type
...
@@ -141,7 +141,6 @@ type
supplied_by_customer_existing_
:
string
;
supplied_by_customer_existing_
:
string
;
supplied_by_customer_ref_art_p
:
string
;
supplied_by_customer_ref_art_p
:
string
;
supplied_by_customer_ref_art_a
:
string
;
supplied_by_customer_ref_art_a
:
string
;
supplied_by_customer_order_date
:
string
;
// Layout
// Layout
layout_rsc_l
:
string
;
layout_rsc_l
:
string
;
...
...
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
38b88255
...
@@ -11,7 +11,7 @@ interface
...
@@ -11,7 +11,7 @@ interface
uses
uses
XData
.
Server
.
Module
,
XData
.
Server
.
Module
,
XData
.
Service
.
Common
,
XData
.
Service
.
Common
,
Database
,
Data
.
DB
,
KGOrders
.
Database
,
Data
.
DB
,
Lookup
.
Service
,
System
.
Hash
,
System
.
Classes
,
System
.
JSON
;
Lookup
.
Service
,
System
.
Hash
,
System
.
Classes
,
System
.
JSON
;
...
@@ -19,7 +19,7 @@ type
...
@@ -19,7 +19,7 @@ type
[
ServiceImplementation
]
[
ServiceImplementation
]
TLookupService
=
class
(
TInterfacedObject
,
ILookupService
)
TLookupService
=
class
(
TInterfacedObject
,
ILookupService
)
strict
private
strict
private
ordersDB
:
T
FDatabaseModul
e
;
ordersDB
:
T
KGOrdersDatabas
e
;
private
private
function
GetItems
(
searchOptions
:
string
):
TItemList
;
function
GetItems
(
searchOptions
:
string
):
TItemList
;
function
GetUsers
(
searchOptions
:
string
):
TUserList
;
function
GetUsers
(
searchOptions
:
string
):
TUserList
;
...
@@ -51,7 +51,7 @@ uses
...
@@ -51,7 +51,7 @@ uses
procedure
TLookupService
.
AfterConstruction
;
procedure
TLookupService
.
AfterConstruction
;
begin
begin
inherited
;
inherited
;
ordersDB
:=
T
FDatabaseModul
e
.
Create
(
nil
);
ordersDB
:=
T
KGOrdersDatabas
e
.
Create
(
nil
);
end
;
end
;
...
@@ -383,7 +383,6 @@ begin
...
@@ -383,7 +383,6 @@ begin
result
.
staff_fields_mount_due
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_mount_due'
).
AsString
;
result
.
staff_fields_mount_due
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_mount_due'
).
AsString
;
result
.
staff_fields_art_location
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_art_location'
).
AsString
;
result
.
staff_fields_art_location
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_art_location'
).
AsString
;
result
.
staff_fields_invoice_to
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_invoice_to'
).
AsString
;
result
.
staff_fields_invoice_to
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_invoice_to'
).
AsString
;
result
.
staff_fields_order_date
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_order_date'
).
AsString
;
// Supplied by Customer
// Supplied by Customer
if
ordersDB
.
UniQuery1
.
FieldByName
(
'supplied_by_customer_b_w_copy'
).
AsString
=
'T'
then
if
ordersDB
.
UniQuery1
.
FieldByName
(
'supplied_by_customer_b_w_copy'
).
AsString
=
'T'
then
...
...
kgOrdersServer/Source/Main.pas
View file @
38b88255
...
@@ -41,7 +41,8 @@ uses
...
@@ -41,7 +41,8 @@ uses
Common
.
Logging
,
Common
.
Logging
,
Common
.
Config
,
Common
.
Config
,
Sparkle
.
Utils
,
Sparkle
.
Utils
,
Database
,
Data
;
KGOrders
.
Database
,
Data
;
{$R *.dfm}
{$R *.dfm}
...
...
kgOrdersServer/kgOrdersServer.dpr
View file @
38b88255
...
@@ -9,7 +9,7 @@ uses
...
@@ -9,7 +9,7 @@ uses
Api.Server.Module in 'Source\Api.Server.Module.pas' {ApiServerModule: TDataModule},
Api.Server.Module in 'Source\Api.Server.Module.pas' {ApiServerModule: TDataModule},
Main in 'Source\Main.pas' {FMain},
Main in 'Source\Main.pas' {FMain},
Common.Logging in 'Source\Common.Logging.pas',
Common.Logging in 'Source\Common.Logging.pas',
Database in 'Source\Database.pas' {FDatabaseModul
e: TDataModule},
KGOrders.Database in 'Source\KGOrders.Database.pas' {KGOrdersDatabas
e: TDataModule},
Common.Middleware.Logging in 'Source\Common.Middleware.Logging.pas',
Common.Middleware.Logging in 'Source\Common.Middleware.Logging.pas',
Common.Config in 'Source\Common.Config.pas',
Common.Config in 'Source\Common.Config.pas',
Auth.Server.Module in 'Source\Auth.Server.Module.pas' {AuthServerModule: TDataModule},
Auth.Server.Module in 'Source\Auth.Server.Module.pas' {AuthServerModule: TDataModule},
...
@@ -92,12 +92,12 @@ var
...
@@ -92,12 +92,12 @@ var
begin
begin
FLogLevel := ALogLevel;
FLogLevel := ALogLevel;
FCriticalSection := TCriticalSection.Create;
FCriticalSection := TCriticalSection.Create;
IniFile := TIniFile.Create( ChangeFileExt( Application.ExeName, '.ini' )
);
iniFile := TIniFile.Create( ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini'
);
try
try
fileNum :=
IniFile.ReadInteger( 'Option
s', 'LogFileNum', 0 );
fileNum :=
iniFile.ReadInteger( 'Setting
s', 'LogFileNum', 0 );
// FFilename := AFilename + Format('%.*d',[4, fileNum]);
// FFilename := AFilename + Format('%.*d',[4, fileNum]);
FFilename := AFilename + Format('%.4d',[fileNum]);
FFilename := AFilename + Format('%.4d',[fileNum]);
iniFile.WriteInteger( '
Option
s', 'LogFileNum', fileNum + 1 );
iniFile.WriteInteger( '
Setting
s', 'LogFileNum', fileNum + 1 );
finally
finally
iniFile.Free;
iniFile.Free;
end;
end;
...
@@ -132,14 +132,12 @@ begin
...
@@ -132,14 +132,12 @@ begin
try
try
AssignFile( FLogFile, LogFile );
AssignFile( FLogFile, LogFile );
if FileExists(LogFile) then
Append( FLogFile )
else
ReWrite( FLogFile );
if logLevel <= FLogLevel then
if logLevel <= FLogLevel then
begin
if FileExists(LogFile) then
Append( FLogFile )
else
ReWrite( FLogFile );
WriteLn( FLogFile, FormattedMessage );
WriteLn( FLogFile, FormattedMessage );
end;
finally
finally
CloseFile(FLogFile);
CloseFile(FLogFile);
end;
end;
...
@@ -167,7 +165,7 @@ begin
...
@@ -167,7 +165,7 @@ begin
finally
finally
iniFile.Free;
iniFile.Free;
end;
end;
Logger.AddAppender(TMemoLogAppender.Create(
5
, FMain.memoinfo ));
Logger.AddAppender(TMemoLogAppender.Create(
memoLogLevel
, FMain.memoinfo ));
Logger.AddAppender(TFileLogAppender.Create(
5
, 'kgOrdersServer' ));
Logger.AddAppender(TFileLogAppender.Create(
fileLogLevel
, 'kgOrdersServer' ));
Application.Run;
Application.Run;
end.
end.
kgOrdersServer/kgOrdersServer.dproj
View file @
38b88255
...
@@ -133,8 +133,8 @@
...
@@ -133,8 +133,8 @@
<Form>FMain</Form>
<Form>FMain</Form>
</DCCReference>
</DCCReference>
<DCCReference Include="Source\Common.Logging.pas"/>
<DCCReference Include="Source\Common.Logging.pas"/>
<DCCReference Include="Source\Database.pas">
<DCCReference Include="Source\
KGOrders.
Database.pas">
<Form>
FDatabaseModul
e</Form>
<Form>
KGOrdersDatabas
e</Form>
<FormType>dfm</FormType>
<FormType>dfm</FormType>
<DesignClass>TDataModule</DesignClass>
<DesignClass>TDataModule</DesignClass>
</DCCReference>
</DCCReference>
...
...
kgOrdersServer/kgOrdersServer.ini
View file @
38b88255
[Settings]
[Settings]
MemoLogLevel
=
3
MemoLogLevel
=
5
FileLogLevel
=
5
FileLogLevel
=
5
LogFileNum
=
2
0
LogFileNum
=
2
1
webClientVersion
=
1.0.0
webClientVersion
=
1.0.0
[Database]
[Database]
...
@@ -9,5 +9,3 @@ webClientVersion=1.0.0
...
@@ -9,5 +9,3 @@ webClientVersion=1.0.0
Server
=
192.168.198.131
Server
=
192.168.198.131
--Server
=
192.168.75.133
--Server
=
192.168.75.133
Password
=
emsys!012
Password
=
emsys!012
[Options]
LogFileNum
=
6
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment