Commit d479324a by cam

benchmark for CustomerList and sending the info to OrderEntry

parent c515903d
...@@ -51,7 +51,7 @@ type ...@@ -51,7 +51,7 @@ type
procedure ShowForm( AFormClass: TWebFormClass ); procedure ShowForm( AFormClass: TWebFormClass );
procedure EditUser( Mode, Username, Password, Name, Status, Email, procedure EditUser( Mode, Username, Password, Name, Status, Email,
Access, Rights, Perspective, QB: string); Access, Rights, Perspective, QB: string);
procedure ViewOrderEntry(orderInfo, mode: string); procedure ViewOrderEntry(orderInfo, customerInfo, mode: string);
procedure ViewOrders(info: string); procedure ViewOrders(info: string);
procedure ShowUserForm(Info: string); procedure ShowUserForm(Info: string);
end; end;
...@@ -227,12 +227,12 @@ begin ...@@ -227,12 +227,12 @@ begin
end; end;
procedure TFViewMain.ViewOrderEntry(orderInfo, mode: string); procedure TFViewMain.ViewOrderEntry(orderInfo, customerInfo, mode: string);
begin begin
lblAppTitle.Caption := 'Koehler-Gibson Order Entry'; lblAppTitle.Caption := 'Koehler-Gibson Order Entry';
if Assigned(FChildForm) then if Assigned(FChildForm) then
FChildForm.Free; FChildForm.Free;
FChildForm := TFOrderEntry.CreateForm(WebPanel1.ElementID, orderInfo, mode); FChildForm := TFOrderEntry.CreateForm(WebPanel1.ElementID, orderInfo, customerInfo, mode);
end; end;
procedure TFViewMain.ShowUserForm(Info: string); procedure TFViewMain.ShowUserForm(Info: string);
......
...@@ -187,6 +187,7 @@ type ...@@ -187,6 +187,7 @@ type
procedure ShowNotification(Notification: string); procedure ShowNotification(Notification: string);
procedure WebFormShow(Sender: TObject); procedure WebFormShow(Sender: TObject);
[async] procedure getOrder(Order_ID: string); [async] procedure getOrder(Order_ID: string);
[async] procedure getCustomer(customerID: string);
procedure tmrScrollTopTimer(Sender: TObject); procedure tmrScrollTopTimer(Sender: TObject);
procedure WebButton1Click(Sender: TObject); procedure WebButton1Click(Sender: TObject);
procedure addColorRow(num, Color, LPI, Size: string); procedure addColorRow(num, Color, LPI, Size: string);
...@@ -197,10 +198,11 @@ type ...@@ -197,10 +198,11 @@ type
FCurrentReportType: string; FCurrentReportType: string;
FSelectProc: TSelectProc; FSelectProc: TSelectProc;
orderID: string; orderID: string;
customerID: string;
mode: string; mode: string;
//FJSONProc1: TJSONProc1; //FJSONProc1: TJSONProc1;
public public
class function CreateForm(AElementID, orderInfo, mode: string): TWebForm; class function CreateForm(AElementID, orderInfo, customerInfo, mode: string): TWebForm;
end; end;
var var
...@@ -333,7 +335,7 @@ begin ...@@ -333,7 +335,7 @@ begin
[orderJSON.ToString])); [orderJSON.ToString]));
end; end;
class function TFOrderEntry.CreateForm(AElementID, orderInfo, mode: string): TWebForm; class function TFOrderEntry.CreateForm(AElementID, orderInfo, customerInfo, mode: string): TWebForm;
var var
localMode: string; localMode: string;
begin begin
...@@ -344,6 +346,7 @@ begin ...@@ -344,6 +346,7 @@ begin
with TFOrderEntry(AForm) do with TFOrderEntry(AForm) do
begin begin
HideNotification; HideNotification;
TFOrderEntry(AForm).customerID := customerInfo;
TFOrderEntry(AForm).orderID := orderInfo; TFOrderEntry(AForm).orderID := orderInfo;
TFOrderEntry(AForm).mode := localMode; TFOrderEntry(AForm).mode := localMode;
console.log(TFOrderEntry(AForm).mode); console.log(TFOrderEntry(AForm).mode);
...@@ -362,7 +365,6 @@ begin ...@@ -362,7 +365,6 @@ begin
const newRow = document.createElement('div'); const newRow = document.createElement('div');
newRow.className = 'row mb-2'; newRow.className = 'row mb-2';
// Labels and inputs
const labels = ['#', 'Color', 'LPI', 'Size']; const labels = ['#', 'Color', 'LPI', 'Size'];
const values = [num, Color, LPI, Size]; const values = [num, Color, LPI, Size];
labels.forEach((label, index) => { labels.forEach((label, index) => {
...@@ -400,7 +402,6 @@ begin ...@@ -400,7 +402,6 @@ begin
removeButtonCol.appendChild(removeButton); removeButtonCol.appendChild(removeButton);
newRow.appendChild(removeButtonCol); newRow.appendChild(removeButtonCol);
// Add the new row to the container
container.appendChild(newRow); container.appendChild(newRow);
end; end;
end; end;
...@@ -513,9 +514,19 @@ begin ...@@ -513,9 +514,19 @@ begin
end; end;
procedure TFOrderEntry.getCustomer(customerID: string);
var
xdcResponse: TXDataClientResponse;
customer : TJSObject;
begin
end;
procedure TFOrderEntry.WebFormShow(Sender: TObject); procedure TFOrderEntry.WebFormShow(Sender: TObject);
begin begin
getOrder(orderID); getOrder(orderID);
console.log(customerID);
//getCustomer(customerID);
HideNotification(); HideNotification();
end; end;
......
...@@ -174,6 +174,7 @@ object FOrderList: TFOrderList ...@@ -174,6 +174,7 @@ object FOrderList: TFOrderList
ChildOrder = 9 ChildOrder = 9
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick
end end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
......
...@@ -37,6 +37,7 @@ type ...@@ -37,6 +37,7 @@ type
AElement: TJSHTMLElementRecord); AElement: TJSHTMLElementRecord);
procedure cbCorrugatedPlateClick(Sender: TObject); procedure cbCorrugatedPlateClick(Sender: TObject);
procedure cbWebPlateClick(Sender: TObject); procedure cbWebPlateClick(Sender: TObject);
procedure btnConfirmClick(Sender: TObject);
private private
//FJSONProc: TJSONProc; //FJSONProc: TJSONProc;
procedure AddRowToTable(); procedure AddRowToTable();
...@@ -80,6 +81,11 @@ begin ...@@ -80,6 +81,11 @@ begin
getCustomers(); getCustomers();
end; end;
procedure TFOrderList.btnConfirmClick(Sender: TObject);
begin
Close;
end;
procedure TFOrderList.cbCorrugatedPlateClick(Sender: TObject); procedure TFOrderList.cbCorrugatedPlateClick(Sender: TObject);
begin begin
cbWebPlate.Checked := false; cbWebPlate.Checked := false;
......
...@@ -78,7 +78,7 @@ type ...@@ -78,7 +78,7 @@ type
procedure ClearTable(); procedure ClearTable();
procedure GeneratePagination(TotalPages: Integer); procedure GeneratePagination(TotalPages: Integer);
function GenerateSearchOptions(): string; function GenerateSearchOptions(): string;
procedure orderEntry(orderInfo, mode: string); procedure orderEntry(orderInfo, customerInfo, mode: string);
procedure HideNotification(); procedure HideNotification();
procedure ShowNotification(Notification: string); procedure ShowNotification(Notification: string);
procedure ShowOrderListForm(); procedure ShowOrderListForm();
...@@ -190,7 +190,7 @@ begin ...@@ -190,7 +190,7 @@ begin
newform.ShowModal( newform.ShowModal(
procedure(AValue: TModalResult) procedure(AValue: TModalResult)
begin begin
//ShowMessage('View Booking Details Form closed'); orderEntry('', newForm.edtID.Text, 'ADD');
end end
); );
end; end;
...@@ -215,7 +215,7 @@ begin ...@@ -215,7 +215,7 @@ begin
NewRow.Attrs['orderType'] := XDataWebDataSet1orderType.Value; NewRow.Attrs['orderType'] := XDataWebDataSet1orderType.Value;
NewRow.addEventListener('click', procedure NewRow.addEventListener('click', procedure
begin begin
orderEntry(NewRow.Attrs['id'], 'EDIT'); orderEntry(NewRow.Attrs['id'], '', 'EDIT');
end); end);
// Order ID Cell // Order ID Cell
...@@ -651,9 +651,9 @@ begin ...@@ -651,9 +651,9 @@ begin
ShowOrderListForm(); ShowOrderListForm();
end; end;
procedure TFViewOrders.orderEntry(orderInfo, mode: string); procedure TFViewOrders.orderEntry(orderInfo, customerInfo, mode: string);
begin begin
FViewMain.ViewOrderEntry(orderInfo, mode); FViewMain.ViewOrderEntry(orderInfo, customerInfo, mode);
end; end;
procedure TFViewOrders.btnApplyClick(Sender: TObject); procedure TFViewOrders.btnApplyClick(Sender: TObject);
...@@ -680,7 +680,7 @@ end; ...@@ -680,7 +680,7 @@ end;
procedure TFViewOrders.btnConfirmClick(Sender: TObject); procedure TFViewOrders.btnConfirmClick(Sender: TObject);
begin begin
orderEntry('', 'ADD'); //orderEntry('', 'ADD');
end; end;
procedure TFViewOrders.btnFiltersClick(Sender: TObject); procedure TFViewOrders.btnFiltersClick(Sender: TObject);
......
...@@ -202,6 +202,7 @@ type ...@@ -202,6 +202,7 @@ type
[HttpGet] function GetOrders(searchOptions: string): TOrderList; [HttpGet] function GetOrders(searchOptions: string): TOrderList;
[HttpGet] function GetOrder(orderInfo: string): TFullOrder; [HttpGet] function GetOrder(orderInfo: string): TFullOrder;
[HttpGet] function GetCustomers(): TCustomerList; [HttpGet] function GetCustomers(): TCustomerList;
//[HttpGet] function GetCustomer(): TFullCustomer;
function AddUser(userInfo: string): string; function AddUser(userInfo: string): string;
function AddItem(itemInfo: string): string; function AddItem(itemInfo: string): string;
......
...@@ -80,7 +80,7 @@ begin ...@@ -80,7 +80,7 @@ begin
customer.NAME := ordersDB.UniQuery1.FieldByName('NAME').AsString; customer.NAME := ordersDB.UniQuery1.FieldByName('NAME').AsString;
customer.ID := ordersDB.UniQuery1.FieldByName('CUSTOMER_ID').AsInteger; customer.ID := ordersDB.UniQuery1.FieldByName('CUSTOMER_ID').AsInteger;
customer.SHORT_NAME := ordersDB.UniQuery1.FieldByName('SHORT_NAME').AsString; customer.SHORT_NAME := ordersDB.UniQuery1.FieldByName('SHORT_NAME').AsString;
customer.ADDRESs := ordersDB.UniQuery1.FieldByName('BILL_ADDRESS').AsString + customer.ADDRESS := ordersDB.UniQuery1.FieldByName('BILL_ADDRESS').AsString +
', ' + ordersDB.UniQuery1.FieldByName('BILL_CITY').AsString + ', ' + ordersDB.UniQuery1.FieldByName('BILL_CITY').AsString +
' ' + ordersDB.UniQuery1.FieldByName('BILL_ZIP').AsString; ' ' + ordersDB.UniQuery1.FieldByName('BILL_ZIP').AsString;
result.data.Add(customer); result.data.Add(customer);
......
[Options] [Options]
LogFileNum=223 LogFileNum=225
UpdateTimerLength=0 UpdateTimerLength=0
......
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