Commit e11cfb9f by Mac Stephens

Fixed small issue created by merge. Working now.

parent a72bb77e
......@@ -1216,8 +1216,6 @@ begin
ordersDB.UniQuery1.Post;
ordersDB.UniQuery1.Close;
//Retrieve Order ID
if mode = 'ADD' then
begin
......@@ -1226,7 +1224,7 @@ begin
ORDER_ID := ordersDB.UniQuery1.FieldByName('OrderID').AsInteger;
end;
// Second query
if mode = 'ADD' then
SQL := 'select * from corrugated_plate_orders where ORDER_ID = 0 and ORDER_ID <> 0'
else
......@@ -1234,7 +1232,9 @@ begin
ORDER_ID := JSONData.GetValue<integer>('ORDER_ID');
SQL := 'select * from corrugated_plate_orders where ORDER_ID = ' + IntToStr(ORDER_ID);
end;
doQuery(ordersDB.UniQuery1, SQL);
try
if mode = 'ADD' then
ordersDB.UniQuery1.Insert
......@@ -1243,10 +1243,9 @@ begin
for Pair in JSONData do
begin
Field := ordersDB.UniQuery1.FindField(Pair.JsonString.Value); // Checks if the field exists in the dataset
Field := ordersDB.UniQuery1.FindField(Pair.JsonString.Value);
if Assigned(Field) then
begin
// handles any dates or datetimes
if (Field is TDateTimeField) and (Pair.JsonValue.Value <> '') then
TDateTimeField(Field).AsDateTime := StrToDate(Pair.JsonValue.Value)
else if Pair.JsonValue.Value <> '' then
......@@ -1255,11 +1254,8 @@ begin
end;
ordersDB.UniQuery1.FieldByName('ORDER_ID').AsInteger := ORDER_ID;
// Post the record to the database
ordersDB.UniQuery1.Post;
if JSONData.GetValue<string>('staff_fields_proof_date') <> '' then
AddStatusSchedule('PROOF', JSONData, ORDER_ID);
if JSONData.GetValue<string>('staff_fields_ship_date') <> '' then
......@@ -1273,6 +1269,11 @@ begin
// Updated so an object isn't being created in the exception for memory control
Result.AddPair('status', 'success');
finally
ordersDB.UniQuery1.Close;
end;
except
on E: Exception do
begin
......@@ -1282,6 +1283,7 @@ begin
end;
function TLookupService.AddStatusSchedule(StatusType: string; order: TJSONObject; ORDER_ID: integer): string;
// Adds/edits orders_status_schedule table.
// StatusType: name of the status getting added to the schedule.
......
[Settings]
MemoLogLevel=4
FileLogLevel=5
LogFileNum=146
LogFileNum=147
webClientVersion=1.0.0
[Database]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment