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
ab14864b
Commit
ab14864b
authored
May 13, 2025
by
Cam Hayes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished the changes discussed with Dave and Elias
parent
aba393fe
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
247 additions
and
78 deletions
+247
-78
AddCustomer.dfm
kgOrdersClient/AddCustomer.dfm
+137
-19
AddCustomer.html
kgOrdersClient/AddCustomer.html
+0
-0
AddCustomer.pas
kgOrdersClient/AddCustomer.pas
+0
-0
View.AddOrder.dfm
kgOrdersClient/View.AddOrder.dfm
+5
-5
View.AddOrder.pas
kgOrdersClient/View.AddOrder.pas
+3
-3
View.Customers.dfm
kgOrdersClient/View.Customers.dfm
+3
-3
View.Customers.html
kgOrdersClient/View.Customers.html
+1
-1
View.Customers.pas
kgOrdersClient/View.Customers.pas
+2
-2
View.OrderEntryCorrugated.html
kgOrdersClient/View.OrderEntryCorrugated.html
+6
-6
View.OrderEntryCorrugated.pas
kgOrdersClient/View.OrderEntryCorrugated.pas
+0
-0
View.OrderEntryCuttingDie.html
kgOrdersClient/View.OrderEntryCuttingDie.html
+6
-6
View.OrderEntryWeb.html
kgOrdersClient/View.OrderEntryWeb.html
+6
-6
View.Orders.dfm
kgOrdersClient/View.Orders.dfm
+2
-2
View.Search.dfm
kgOrdersClient/View.Search.dfm
+7
-7
View.Search.pas
kgOrdersClient/View.Search.pas
+3
-3
Lookup.Service.pas
kgOrdersServer/Source/Lookup.Service.pas
+1
-0
Lookup.ServiceImpl.pas
kgOrdersServer/Source/Lookup.ServiceImpl.pas
+64
-14
kgOrdersServer.ini
kgOrdersServer/kgOrdersServer.ini
+1
-1
No files found.
kgOrdersClient/AddCustomer.dfm
View file @
ab14864b
...
...
@@ -186,6 +186,7 @@ object FViewAddCustomer: TFViewAddCustomer
ElementID = 'btndelete'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnDeleteClick
end
object btnClose: TWebButton
Left = 19
...
...
@@ -319,18 +320,6 @@ object FViewAddCustomer: TFViewAddCustomer
end>
DataSource = wdsShipTo
end
object btnAddAddress: TWebButton
Left = 190
Top = 420
Width = 96
Height = 25
Caption = 'Add Address'
ChildOrder = 21
ElementID = 'btnaddaddress'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnAddAddressClick
end
object edtShippingAddress: TWebEdit
Left = 190
Top = 460
...
...
@@ -338,8 +327,10 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22
ChildOrder = 22
ElementID = 'edtshippingaddress'
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = edtShippingAddressChange
end
object edtShippingState: TWebEdit
Left = 190
...
...
@@ -348,8 +339,10 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22
ChildOrder = 22
ElementID = 'edtshippingstate'
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = edtShippingAddressChange
end
object edtShippingContact: TWebEdit
Left = 190
...
...
@@ -358,8 +351,10 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22
ChildOrder = 22
ElementID = 'edtshippingcontact'
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = edtShippingAddressChange
end
object edtShippingZip: TWebEdit
Left = 190
...
...
@@ -368,8 +363,10 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22
ChildOrder = 22
ElementID = 'edtshippingzip'
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = edtShippingAddressChange
end
object edtShippingCity: TWebEdit
Left = 190
...
...
@@ -378,20 +375,135 @@ object FViewAddCustomer: TFViewAddCustomer
Height = 22
ChildOrder = 22
ElementID = 'edtshippingcity'
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = edtShippingAddressChange
end
object memoShipBlock: TWebMemo
Left = 508
Top = 460
Width = 185
Height = 89
ElementID = 'memoshipblock'
Enabled = False
HeightPercent = 100.000000000000000000
SelLength = 0
SelStart = 0
WidthPercent = 100.000000000000000000
OnChange = edtShippingAddressChange
end
object memoAddressBlock: TWebMemo
Left = 162
Top = 86
Width = 185
Height = 89
ElementID = 'memoaddressblock'
Enabled = False
HeightPercent = 100.000000000000000000
SelLength = 0
SelStart = 0
WidthPercent = 100.000000000000000000
OnChange = memoAddressBlockChange
end
object btnAdd: TWebButton
Left = 19
Top = 535
Width = 96
Height = 25
Caption = 'Add'
ChildOrder = 84
ElementID = 'btnadd'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnAddClick
end
object btnShipSave: TWebButton
Left = 339
Top = 441
Width = 96
Height = 25
Caption = 'Save'
ChildOrder = 79
ElementID = 'btnshipconfirm'
ElementPosition = epRelative
HeightPercent = 100.000000000000000000
Role = 'null'
WidthPercent = 100.000000000000000000
OnClick = btnShipSaveClick
end
object btnShipCancel: TWebButton
Left = 339
Top = 480
Width = 96
Height = 25
Caption = 'Cancel'
ChildOrder = 79
ElementID = 'btnshipcancel'
ElementPosition = epRelative
HeightPercent = 100.000000000000000000
Role = 'null'
WidthPercent = 100.000000000000000000
OnClick = btnCancelClick
end
object btn
Clear
: TWebButton
Left =
296
Top = 4
2
0
object btn
ShipDelete
: TWebButton
Left =
339
Top = 4
1
0
Width = 96
Height = 25
Caption = 'Clear'
ChildOrder = 27
ElementID = 'btnclear'
Caption = 'Delete'
ChildOrder = 79
ElementID = 'btnshipdelete'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnShipDeleteClick
end
object btnShipEdit: TWebButton
Left = 339
Top = 511
Width = 96
Height = 25
Caption = 'Edit'
ChildOrder = 83
ElementID = 'btnshipedit'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnShipEditClick
end
object btnShipAdd: TWebButton
Left = 339
Top = 549
Width = 96
Height = 25
Caption = 'Add'
ChildOrder = 84
ElementID = 'btnshipadd'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnShipAddClick
end
object btn_confirm_delete: TWebButton
Left = 725
Top = 433
Width = 96
Height = 25
Caption = 'Delete'
ChildOrder = 82
ElementID = 'btn_confirm_delete'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btn_confirm_deleteClick
end
object edtFirstLine: TWebEdit
Left = 190
Top = 430
Width = 121
Height = 22
ChildOrder = 35
ElementID = 'edtfirstline'
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnClearClick
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
...
...
@@ -482,4 +594,10 @@ object FViewAddCustomer: TFViewAddCustomer
FieldName = 'contact'
end
end
object tmrReturn: TWebTimer
Enabled = False
OnTimer = tmrReturnTimer
Left = 542
Top = 42
end
end
kgOrdersClient/AddCustomer.html
View file @
ab14864b
This diff is collapsed.
Click to expand it.
kgOrdersClient/AddCustomer.pas
View file @
ab14864b
This diff is collapsed.
Click to expand it.
kgOrdersClient/View.AddOrder.dfm
View file @
ab14864b
...
...
@@ -5,9 +5,9 @@ object FAddOrder: TFAddOrder
object WebLabel1: TWebLabel
Left = 4
Top = 81
Width =
3
5
Width =
9
5
Height = 15
Caption = 'Search'
Caption = 'Search
Customers
'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
...
...
@@ -16,7 +16,7 @@ object FAddOrder: TFAddOrder
Top = 81
Width = 113
Height = 15
Caption = 'Selected C
ompany
ID'
Caption = 'Selected C
ustomer
ID'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
...
...
@@ -74,7 +74,7 @@ object FAddOrder: TFAddOrder
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width =
7
0.000000000000000000
Width =
9
0.000000000000000000
end
item
BorderWidth = 1
...
...
@@ -119,7 +119,7 @@ object FAddOrder: TFAddOrder
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width = 3
8
2.000000000000000000
Width = 3
6
2.000000000000000000
end
item
BorderWidth = 1
...
...
kgOrdersClient/View.AddOrder.pas
View file @
ab14864b
...
...
@@ -154,9 +154,9 @@ begin
// Set up column headers
TMSFNCGrid1
.
ColumnCount
:=
4
;
TMSFNCGrid1
.
RowCount
:=
1
;
TMSFNCGrid1
.
Cells
[
0
,
0
]
:=
'
DBID
'
;
TMSFNCGrid1
.
Cells
[
1
,
0
]
:=
'ID'
;
TMSFNCGrid1
.
Cells
[
2
,
0
]
:=
'Name'
;
TMSFNCGrid1
.
Cells
[
0
,
0
]
:=
'
Customer Num
'
;
TMSFNCGrid1
.
Cells
[
1
,
0
]
:=
'
Customer
ID'
;
TMSFNCGrid1
.
Cells
[
2
,
0
]
:=
'
Customer
Name'
;
TMSFNCGrid1
.
Cells
[
3
,
0
]
:=
'Address'
;
// Populate the grid with data from the dataset
...
...
kgOrdersClient/View.Customers.dfm
View file @
ab14864b
...
...
@@ -114,15 +114,15 @@ object FViewCustomers: TFViewCustomers
Columns = <
item
DataField = 'CUSTOMER_ID'
Title = 'Customer
ID
'
Title = 'Customer
Num
'
end
item
DataField = 'SHORT_NAME'
Title = '
Account Name
'
Title = '
Customer ID
'
end
item
DataField = 'NAME'
Title = 'Name'
Title = '
Customer
Name'
end
item
DataField = 'START_DATE'
...
...
kgOrdersClient/View.Customers.html
View file @
ab14864b
...
...
@@ -22,7 +22,7 @@
<button
id=
"btnaddcustomer"
class=
"btn btn-secondary"
>
Add Customer
</button>
</div>
<div
class=
"col-auto"
>
<label
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
C
ompany Account Name
:
</label>
<label
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
C
ustomer ID
:
</label>
<input
id=
"edtfilter"
type=
"text"
class=
"form-control"
style=
"width: 200px;"
/>
</div>
</div>
...
...
kgOrdersClient/View.Customers.pas
View file @
ab14864b
...
...
@@ -15,7 +15,6 @@ uses
type
TFViewCustomers
=
class
(
TWebForm
)
lblEntries
:
TWebLabel
;
btnAddCustomer
:
TWebButton
;
wcbPageSize
:
TWebComboBox
;
pnlMessage
:
TWebPanel
;
...
...
@@ -30,6 +29,7 @@ type
xdwdsCustomersCUSTOMER_ID
:
TIntegerField
;
wdbtcCustomers
:
TWebDBTableControl
;
edtFilter
:
TWebEdit
;
lblEntries
:
TWebLabel
;
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
btnAddCustomerClick
(
Sender
:
TObject
);
procedure
wdbtcCustomersDblClickCell
(
Sender
:
TObject
;
ACol
,
ARow
:
Integer
);
...
...
@@ -115,7 +115,7 @@ begin
else
if
(
PageNumber
*
PageSize
)
<
customerListLength
then
begin
lblEntries
.
Caption
:=
'Showing entries '
+
IntToStr
((
PageNumber
-
1
)
*
PageSize
+
1
)
+
' - '
+
IntToStr
(
PageNumber
*
PageSize
)
+
' - '
+
IntToStr
(
customerListLength
)
+
' of '
+
IntToStr
(
customerListLength
);
end
else
if
(
PageNumber
*
PageSize
)
>=
customerListLength
then
...
...
kgOrdersClient/View.OrderEntryCorrugated.html
View file @
ab14864b
...
...
@@ -38,25 +38,25 @@
<div
class=
"col-12 col-md-8"
>
</div>
<h4
class=
"custom-h4 mt-3"
>
C
ompany
</h4>
<h4
class=
"custom-h4 mt-3"
>
C
ustomer
</h4>
<hr
class=
"custom-hr"
>
<div
class=
"row"
>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
class=
"form-label mt-2"
>
Company
Name:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Customer
Name:
</label>
<input
id=
"edtcompanyname"
type=
"text"
class=
"form-control"
style=
"width: 300px;"
required
/>
<div
class=
"invalid-feedback"
style=
"font-size: 15px;"
>
Please Provide a C
ompany
Name.
Please Provide a C
ustomer
Name.
</div>
</div>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
class=
"form-label mt-2"
>
Account Company Name
:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Customer ID
:
</label>
<input
id=
"edtaccountcompanyname"
type=
"text"
class=
"form-control"
style=
"width: 150px"
required
/>
<div
class=
"invalid-feedback"
style=
"font-size: 15px;"
>
Please Provide a C
ompany Account
Name.
Please Provide a C
ustomer ID
Name.
</div>
</div>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
class=
"form-label mt-2"
>
In Quickbooks?:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
In Quickbooks?:
</label>
<input
id=
"edtinquickbooks"
type=
"text"
class=
"form-control"
style=
"width: 150px"
/>
</div>
</div>
...
...
kgOrdersClient/View.OrderEntryCorrugated.pas
View file @
ab14864b
kgOrdersClient/View.OrderEntryCuttingDie.html
View file @
ab14864b
...
...
@@ -34,25 +34,25 @@
</div>
</nav>
<div
class=
"row mx-5"
>
<h4
class=
"custom-h4 mt-3"
>
C
ompany
</h4>
<h4
class=
"custom-h4 mt-3"
>
C
ustomer
</h4>
<hr
class=
"custom-hr"
>
<div
class=
"row"
>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
class=
"form-label mt-2"
>
Company
Name:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Customer
Name:
</label>
<input
id=
"edtcompanyname"
type=
"text"
class=
"form-control"
style=
"width: 300px;"
required
/>
<div
class=
"invalid-feedback"
style=
"font-size: 15px;"
>
Please Provide a C
ompany
Name.
Please Provide a C
ustomer
Name.
</div>
</div>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
class=
"form-label mt-2"
>
Account Company Name
:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Customer ID
:
</label>
<input
id=
"edtaccountcompanyname"
type=
"text"
class=
"form-control"
style=
"width: 150px"
required
/>
<div
class=
"invalid-feedback"
style=
"font-size: 15px;"
>
Please Provide a C
ompany Account Name
.
Please Provide a C
ustomer ID
.
</div>
</div>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
class=
"form-label mt-2"
>
In Quickbooks?:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
>In Quickbooks?:
</label>
<input
id=
"edtinquickbooks"
type=
"text"
class=
"form-control"
style=
"width: 150px"
/>
</div>
</div>
...
...
kgOrdersClient/View.OrderEntryWeb.html
View file @
ab14864b
...
...
@@ -34,25 +34,25 @@
</div>
</nav>
<div
class=
"row mx-5"
>
<h4
class=
"custom-h4 mt-3"
>
C
ompany
</h4>
<h4
class=
"custom-h4 mt-3"
>
C
ustomer
</h4>
<hr
class=
"custom-hr"
>
<div
class=
"row"
>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
class=
"form-label mt-2"
>
Company
Name:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Customer
Name:
</label>
<input
id=
"edtcompanyname"
type=
"text"
class=
"form-control"
style=
"width: 300px;"
required
/>
<div
class=
"invalid-feedback"
style=
"font-size: 15px;"
>
Please Provide a C
ompany
Name.
Please Provide a C
ustomer
Name.
</div>
</div>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
class=
"form-label mt-2"
>
Account Company Name
:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Customer ID
:
</label>
<input
id=
"edtaccountcompanyname"
type=
"text"
class=
"form-control"
style=
"width: 150px"
required
/>
<div
class=
"invalid-feedback"
style=
"font-size: 15px;"
>
Please Provide a C
ompany Account Name
.
Please Provide a C
ustomer ID
.
</div>
</div>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
class=
"form-label mt-2"
>
In Quickbooks?:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
In Quickbooks?:
</label>
<input
id=
"edtinquickbooks"
type=
"text"
class=
"form-control"
style=
"width: 150px"
/>
</div>
</div>
...
...
kgOrdersClient/View.Orders.dfm
View file @
ab14864b
...
...
@@ -129,11 +129,11 @@ object FViewOrders: TFViewOrders
end
item
DataField = 'ID'
Title = 'ID'
Title = '
Customer
ID'
end
item
DataField = 'companyName'
Title = 'C
ompany
Name'
Title = 'C
ustomer
Name'
end
item
DataField = 'jobName'
...
...
kgOrdersClient/View.Search.dfm
View file @
ab14864b
...
...
@@ -149,7 +149,7 @@ object FSearch: TFSearch
Top = 56
Width = 107
Height = 14
Caption = 'Search C
ompanie
s:'
Caption = 'Search C
ustomer
s:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
...
...
@@ -162,9 +162,9 @@ object FSearch: TFSearch
object lblCompanyID: TWebLabel
Left = 174
Top = 56
Width =
68
Width =
72
Height = 14
Caption = 'C
ompany
ID:'
Caption = 'C
ustomer
ID:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
...
...
@@ -207,9 +207,9 @@ object FSearch: TFSearch
object WebLabel5: TWebLabel
Left = 338
Top = 56
Width =
89
Width =
93
Height = 14
Caption = 'C
ompany
Name:'
Caption = 'C
ustomer
Name:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
...
...
@@ -457,7 +457,7 @@ object FSearch: TFSearch
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width =
4
0.000000000000000000
Width =
8
0.000000000000000000
end
item
BorderWidth = 1
...
...
@@ -502,7 +502,7 @@ object FSearch: TFSearch
Font.Name = 'Segoe UI'
Font.Style = []
ID = ''
Width =
32
0.000000000000000000
Width =
28
0.000000000000000000
end
item
BorderWidth = 1
...
...
kgOrdersClient/View.Search.pas
View file @
ab14864b
...
...
@@ -274,9 +274,9 @@ begin
// Set up column headers
TMSFNCGrid1
.
ColumnCount
:=
4
;
TMSFNCGrid1
.
RowCount
:=
1
;
TMSFNCGrid1
.
Cells
[
0
,
0
]
:=
'
DBID
'
;
TMSFNCGrid1
.
Cells
[
1
,
0
]
:=
'ID'
;
TMSFNCGrid1
.
Cells
[
2
,
0
]
:=
'Name'
;
TMSFNCGrid1
.
Cells
[
0
,
0
]
:=
'
Customer Num
'
;
TMSFNCGrid1
.
Cells
[
1
,
0
]
:=
'
Customer
ID'
;
TMSFNCGrid1
.
Cells
[
2
,
0
]
:=
'
Customer
Name'
;
TMSFNCGrid1
.
Cells
[
3
,
0
]
:=
'Address'
;
// Populate the grid with data from the dataset
...
...
kgOrdersServer/Source/Lookup.Service.pas
View file @
ab14864b
...
...
@@ -397,6 +397,7 @@ type
function
AddUser
(
userInfo
:
string
):
string
;
function
AddItem
(
itemInfo
:
string
):
string
;
function
AddShippingAddress
(
Addressinfo
:
string
):
TJSONObject
;
function
DelShippingAddress
(
AddressID
,
CustomerID
:
string
):
TJSONObject
;
function
DelUser
(
username
:
string
):
string
;
function
DelOrder
(
orderID
,
orderType
,
UserID
:
string
):
TJSONObject
;
function
EditUser
(
const
editOptions
:
string
):
string
;
...
...
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
ab14864b
...
...
@@ -55,6 +55,7 @@ type
function
AddCuttingDieOrder
(
orderInfo
:
string
):
TJSONObject
;
function
AddShippingAddress
(
AddressInfo
:
string
):
TJSONObject
;
function
delOrder
(
OrderID
,
OrderType
,
UserID
:
string
):
TJSONObject
;
function
DelShippingAddress
(
AddressID
,
CustomerID
:
string
):
TJSONObject
;
function
GenerateSubQuery
(
currStatus
:
string
):
string
;
...
...
@@ -90,6 +91,38 @@ begin
inherited
;
end
;
function
TLookupService
.
DelShippingAddress
(
AddressID
,
CustomerID
:
string
):
TJSONObject
;
var
SQL
:
string
;
ADDRESS_LIST
:
TJSONArray
;
ADDRESS
:
TJSONObject
;
begin
SQL
:=
'DELETE FROM customers_ship WHERE customer_ship_id = '
+
AddressID
;
OrdersDB
.
UniQuery1
.
SQL
.
Text
:=
SQL
;
OrdersDB
.
UniQuery1
.
ExecSQL
;
result
:=
TJSONObject
.
Create
;
result
.
AddPair
(
'status'
,
'Success:Address Successfully Deleted'
);
SQL
:=
'select * FROM customers c LEFT JOIN customers_ship s ON c.CUSTOMER_ID = s.customer_id WHERE c.CUSTOMER_ID = '
+
CustomerID
;
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
ADDRESS_LIST
:=
TJSONArray
.
Create
;
while
not
ordersDB
.
UniQuery1
.
Eof
do
begin
ADDRESS
:=
TJSONObject
.
Create
;
ADDRESS
.
AddPair
(
'ADDRESS'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'ship_block'
).
AsString
);
ADDRESS
.
AddPair
(
'shipping_address'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'address'
).
AsString
);
ADDRESS
.
AddPair
(
'city'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'city'
).
AsString
);
ADDRESS
.
AddPair
(
'state'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'state'
).
AsString
);
ADDRESS
.
AddPair
(
'zip'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'zip'
).
AsString
);
ADDRESS
.
AddPair
(
'contact'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'contact'
).
AsString
);
ADDRESS
.
AddPair
(
'ship_id'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'customer_ship_id'
).
AsString
);
ADDRESS_LIST
.
Add
(
ADDRESS
);
ordersDB
.
UniQuery1
.
Next
;
end
;
Result
.
AddPair
(
'ADDRESS'
,
ADDRESS_LIST
);
TXDataOperationContext
.
Current
.
Handler
.
ManagedObjects
.
Add
(
Result
);
end
;
function
TLookupService
.
GetCustomers
:
TCustomerList
;
// Retrieves a list of customers and sends it to the client in object form.
// The object contains the ID, Name, Short Name, and the shipping address.
...
...
@@ -142,10 +175,7 @@ begin
result
.
NAME
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'NAME'
).
AsString
;
result
.
CUSTOMER_ID
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'CUSTOMER_ID'
).
AsInteger
;
result
.
SHORT_NAME
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'SHORT_NAME'
).
AsString
;
result
.
staff_fields_invoice_to
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'BILL_ADDRESS'
).
AsString
+
', '
+
ordersDB
.
UniQuery1
.
FieldByName
(
'BILL_CITY'
).
AsString
+
', '
+
ordersDB
.
UniQuery1
.
FieldByName
(
'BILL_STATE'
).
AsString
+
' '
+
ordersDB
.
UniQuery1
.
FieldByName
(
'BILL_ZIP'
).
AsString
;
result
.
staff_fields_invoice_to
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'BILL_ADDRESS_BLOCK'
).
AsString
;
result
.
START_DATE
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'START_DATE'
).
AsString
;
result
.
BILL_ADDRESS
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'BILL_ADDRESS'
).
AsString
;
result
.
BILL_CITY
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'BILL_CITY'
).
AsString
;
...
...
@@ -228,11 +258,18 @@ var
temp
:
string
;
msg
:
string
;
ship_block
:
string
;
ADDRESS
:
TJSONObject
;
ADDRESS_LIST
:
TJSONArray
;
CustomerID
:
string
;
JSONArray
:
TJSONArray
;
Item
:
TAddressItem
;
begin
result
:=
TJSONObject
.
Create
;
JSONData
:=
TJSONObject
.
ParseJSONValue
(
AddressInfo
)
as
TJSONObject
;
if
JSONData
=
nil
then
raise
Exception
.
Create
(
'Invalid JSON format'
);
// If parsing fails, raise an exception
mode
:=
JSONData
.
GetValue
<
string
>(
'mode'
);
CustomerID
:=
JSONData
.
GetValue
<
string
>(
'customer_id'
);
if
mode
=
'EDIT'
then
ShipID
:=
JSONData
.
GetValue
<
integer
>(
'customer_ship_id'
);
...
...
@@ -267,26 +304,39 @@ begin
Field
.
AsString
:=
Pair
.
JsonValue
.
Value
;
end
;
end
;
//OrdersDB.UniQuery1.FieldByName('address').AsString := JSONData.GetValue<string>('shipping_address');
//TODO Ask about shipping block & link to quickbooks
// OrdersDB.UniQuery1.FieldByName('ship_block') := ship_block;
// Post the record to the database
ordersDB
.
UniQuery1
.
Post
;
if
mode
=
'ADD'
then
msg
:=
'Success:Shipping Address Successfully Added'
begin
msg
:=
'Success:Shipping Address Successfully Added'
;
end
else
msg
:=
'Success:Shipping Address Successfully Edited'
;
Result
:=
TJSONObject
.
Create
.
AddPair
(
'status'
,
msg
);
SQL
:=
'select * FROM customers c LEFT JOIN customers_ship s ON c.CUSTOMER_ID = s.customer_id WHERE c.CUSTOMER_ID = '
+
CustomerID
;
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
ADDRESS_LIST
:=
TJSONArray
.
Create
;
while
not
ordersDB
.
UniQuery1
.
Eof
do
begin
ADDRESS
:=
TJSONObject
.
Create
;
ADDRESS
.
AddPair
(
'ADDRESS'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'ship_block'
).
AsString
);
ADDRESS
.
AddPair
(
'shipping_address'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'address'
).
AsString
);
ADDRESS
.
AddPair
(
'city'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'city'
).
AsString
);
ADDRESS
.
AddPair
(
'state'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'state'
).
AsString
);
ADDRESS
.
AddPair
(
'zip'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'zip'
).
AsString
);
ADDRESS
.
AddPair
(
'contact'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'contact'
).
AsString
);
ADDRESS
.
AddPair
(
'ship_id'
,
ordersDB
.
UniQuery1
.
FieldByName
(
'customer_ship_id'
).
AsString
);
ADDRESS_LIST
.
Add
(
ADDRESS
);
ordersDB
.
UniQuery1
.
Next
;
end
;
Result
.
AddPair
(
'status'
,
msg
);
Result
.
AddPair
(
'ADDRESS'
,
ADDRESS_LIST
);
TXDataOperationContext
.
Current
.
Handler
.
ManagedObjects
.
Add
(
Result
);
except
on
E
:
Exception
do
begin
Result
:=
TJSONObject
.
Create
.
AddPair
(
'error'
,
E
.
Message
);
Result
.
AddPair
(
'error'
,
E
.
Message
);
end
end
;
end
;
...
...
kgOrdersServer/kgOrdersServer.ini
View file @
ab14864b
...
...
@@ -2,7 +2,7 @@
MemoLogLevel
=
3
FileLogLevel
=
5
webClientVersion
=
0.9.2
LogFileNum
=
5
18
LogFileNum
=
5
37
[Database]
Server
=
192.168.159.131
...
...
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