Commit 1285e060 by cam

Forgot two files in the previous commit

parent 8c0bceeb
......@@ -1011,6 +1011,7 @@ var
UserID: string;
SQL: string;
begin
logger.Log(1, 'Set Status Hit');
params := TStringList.Create;
// parse the statusOptions
params.Delimiter := '&';
......@@ -1023,31 +1024,39 @@ begin
SQL := 'select * from orders_status where ORDER_ID = ' + OrderID + ' AND ' +
'ORDER_STATUS = ' + quotedStr(Status);
try
logger.Log(1, 'Trying to Set Status');
doQuery(ordersDB.UniQuery1, SQL);
doQuery(ordersDB.UniQuery1, SQL);
if ordersDB.UniQuery1.IsEmpty then
// Add Status
begin
ordersDB.UniQuery1.Insert;
ordersDB.UniQuery1.FieldByName('ORDER_ID').AsString := OrderID;
ordersDB.UniQuery1.FieldByName('ORDER_STATUS').AsString := Status;
ordersDB.UniQuery1.FieldByName('STATUS_DATE').AsDateTime := StrToDateTime(Date);
ordersDB.UniQuery1.FieldByName('STATUS_TIMESTAMP').AsDateTime := Now;
ordersDB.UniQuery1.FieldByName('USER_ID').AsString := UserID;
ordersDB.UniQuery1.FieldByName('ORDER_REVISION').AsInteger := 1;
end
else
// Edit Status
begin
ordersDB.UniQuery1.Edit;
ordersDB.UniQuery1.FieldByName('STATUS_DATE').AsDateTime := StrToDateTime(Date);
ordersDB.UniQuery1.FieldByName('STATUS_TIMESTAMP').AsDateTime := Now;
ordersDB.UniQuery1.FieldByName('ORDER_REVISION').AsInteger := ordersDB.UniQuery1.FieldByName('ORDER_REVISION').AsInteger + 1;
end;
if ordersDB.UniQuery1.IsEmpty then
// Add Status
begin
ordersDB.UniQuery1.Insert;
ordersDB.UniQuery1.FieldByName('ORDER_ID').AsString := OrderID;
ordersDB.UniQuery1.FieldByName('ORDER_STATUS').AsString := Status;
ordersDB.UniQuery1.FieldByName('STATUS_DATE').AsDateTime := StrToDateTime(Date);
ordersDB.UniQuery1.FieldByName('STATUS_TIMESTAMP').AsDateTime := Now;
ordersDB.UniQuery1.FieldByName('USER_ID').AsString := UserID;
ordersDB.UniQuery1.FieldByName('ORDER_REVISION').AsInteger := 1;
end
else
// Edit Status
begin
ordersDB.UniQuery1.Edit;
ordersDB.UniQuery1.FieldByName('STATUS_DATE').AsDateTime := StrToDateTime(Date);
ordersDB.UniQuery1.FieldByName('STATUS_TIMESTAMP').AsDateTime := Now;
ordersDB.UniQuery1.FieldByName('ORDER_REVISION').AsInteger := ordersDB.UniQuery1.FieldByName('ORDER_REVISION').AsInteger + 1;
ordersDB.UniQuery1.Post;
logger.Log(1, 'Status Successfully set');
result := 'success';
except
on E: Exception do
// This block will catch any exception derived from the Exception class
logger.Log(5, 'An error occurred when setting status: ' + E.Message);
end;
ordersDB.UniQuery1.Post;
result := 'success';
end;
function TLookupService.AddUser(userInfo:string): string;
......
[Settings]
MemoLogLevel=4
FileLogLevel=5
LogFileNum=110
LogFileNum=111
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