Commit d479324a by cam

benchmark for CustomerList and sending the info to OrderEntry

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