Commit c515903d by cam

Began working on popup menu to add

parent ab01a898
...@@ -48,8 +48,8 @@ object FOrderList: TFOrderList ...@@ -48,8 +48,8 @@ object FOrderList: TFOrderList
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object pnlMessage: TWebPanel object pnlMessage: TWebPanel
Left = 220 Left = 24
Top = 429 Top = 57
Width = 121 Width = 121
Height = 33 Height = 33
ElementClassName = 'card' ElementClassName = 'card'
...@@ -91,8 +91,8 @@ object FOrderList: TFOrderList ...@@ -91,8 +91,8 @@ object FOrderList: TFOrderList
end end
end end
object WebDBTableControl: TWebDBTableControl object WebDBTableControl: TWebDBTableControl
Left = 160 Left = 172
Top = 131 Top = 287
Width = 530 Width = 530
Height = 265 Height = 265
ElementClassName = 'table-responsive' ElementClassName = 'table-responsive'
...@@ -102,7 +102,6 @@ object FOrderList: TFOrderList ...@@ -102,7 +102,6 @@ object FOrderList: TFOrderList
ColHeader = False ColHeader = False
ElementTableClassName = 'table table-striped table-bordered table-hover dataTable' ElementTableClassName = 'table table-striped table-bordered table-hover dataTable'
Options.ResizeColumns = True Options.ResizeColumns = True
OnGetCellChildren = WebDBTableControlGetCellChildren
Columns = < Columns = <
item item
DataField = 'ID' DataField = 'ID'
...@@ -124,6 +123,58 @@ object FOrderList: TFOrderList ...@@ -124,6 +123,58 @@ object FOrderList: TFOrderList
end> end>
DataSource = wdsCustomers DataSource = wdsCustomers
end end
object cbCorrugatedPlate: TWebCheckBox
Left = 172
Top = 210
Width = 113
Height = 22
Caption = 'Corrugated Plate'
Checked = True
ChildOrder = 5
HeightPercent = 100.000000000000000000
State = cbChecked
WidthPercent = 100.000000000000000000
OnClick = cbCorrugatedPlateClick
end
object cbWebPlate: TWebCheckBox
Left = 304
Top = 210
Width = 113
Height = 22
Caption = 'Web Plate'
ChildOrder = 5
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = cbWebPlateClick
end
object edtCompanyName: TWebEdit
Left = 302
Top = 252
Width = 121
Height = 22
ChildOrder = 7
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtID: TWebEdit
Left = 172
Top = 252
Width = 121
Height = 22
ChildOrder = 8
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnConfirm: TWebButton
Left = 564
Top = 251
Width = 96
Height = 25
Caption = 'Confirm'
ChildOrder = 9
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 88 Left = 88
......
...@@ -26,10 +26,17 @@ type ...@@ -26,10 +26,17 @@ type
xdwdsCustomersSHORT_NAME: TStringField; xdwdsCustomersSHORT_NAME: TStringField;
xdwdsCustomersADDRESS: TStringField; xdwdsCustomersADDRESS: TStringField;
WebDBTableControl: TWebDBTableControl; WebDBTableControl: TWebDBTableControl;
cbCorrugatedPlate: TWebCheckBox;
cbWebPlate: TWebCheckBox;
edtCompanyName: TWebEdit;
edtID: TWebEdit;
btnConfirm: TWebButton;
procedure WebFormShow(Sender: TObject); procedure WebFormShow(Sender: TObject);
procedure WebDBTableControlGetCellChildren(Sender: TObject; ACol, procedure WebDBTableControlGetCellChildren(Sender: TObject; ACol,
ARow: Integer; AField: TField; AValue: string; ARow: Integer; AField: TField; AValue: string;
AElement: TJSHTMLElementRecord); AElement: TJSHTMLElementRecord);
procedure cbCorrugatedPlateClick(Sender: TObject);
procedure cbWebPlateClick(Sender: TObject);
private private
//FJSONProc: TJSONProc; //FJSONProc: TJSONProc;
procedure AddRowToTable(); procedure AddRowToTable();
...@@ -73,6 +80,16 @@ begin ...@@ -73,6 +80,16 @@ begin
getCustomers(); getCustomers();
end; end;
procedure TFOrderList.cbCorrugatedPlateClick(Sender: TObject);
begin
cbWebPlate.Checked := false;
end;
procedure TFOrderList.cbWebPlateClick(Sender: TObject);
begin
cbCorrugatedPlate.Checked := false;
end;
procedure TFOrderList.ClearTable(); procedure TFOrderList.ClearTable();
// clears the table // clears the table
var var
...@@ -96,43 +113,9 @@ begin ...@@ -96,43 +113,9 @@ begin
customerList := TJSObject(xdcResponse.Result); customerList := TJSObject(xdcResponse.Result);
data := TJSArray(customerList['data']); data := TJSArray(customerList['data']);
count := integer(customerList['count']); count := integer(customerList['count']);
// ClearTable();
//customerGrid.col
xdwdsCustomers.Close; xdwdsCustomers.Close;
xdwdsCustomers.SetJsonData(customerList['data']); xdwdsCustomers.SetJsonData(customerList['data']);
xdwdsCustomers.Open; xdwdsCustomers.Open;
console.log(xdwdsCustomersID);
{for i := 0 to data.Length - 1 do
begin
customer := TJSObject(data[i]);
//AddRowToTable();
xdwdsCustomers.Next;
end;}
{TotalPages := (callListLength + PageSize - 1) div PageSize;
if callListLength = 0 then
begin
lblEntries.Caption := 'No entries found';
lblEntries2.Caption := 'No entries found';
end
else if (PageNumber * PageSize) < callListLength then
begin
lblEntries.Caption := 'Showing entries ' + IntToStr((PageNumber - 1) * PageSize + 1) +
' - ' + IntToStr(PageNumber * PageSize) +
' of ' + IntToStr(callListLength);
lblEntries2.Caption := 'Showing entries ' + IntToStr((PageNumber - 1) * PageSize + 1) +
' - ' + IntToStr(PageNumber * PageSize) +
' of ' + IntToStr(callListLength);
end
else if (PageNumber * PageSize) >= callListLength then
begin
lblEntries.Caption := 'Showing entries ' + IntToStr((PageNumber - 1) * PageSize + 1) +
' - ' + IntToStr(callListLength) +
' of ' + IntToStr(callListLength);
lblEntries2.Caption := 'Showing entries ' + IntToStr((PageNumber - 1) * PageSize + 1) +
' - ' + IntToStr(callListLength) +
' of ' + IntToStr(callListLength);
end;
//GeneratePagination(TotalPages);}
end; end;
procedure TFOrderList.AddRowToTable(); procedure TFOrderList.AddRowToTable();
......
...@@ -88,6 +88,8 @@ type ...@@ -88,6 +88,8 @@ type
Public Public
NAME: string; NAME: string;
ID: integer; ID: integer;
SHORT_NAME: string;
ADDRESS: string;
end; end;
TCustomerList = class TCustomerList = class
......
...@@ -62,10 +62,10 @@ end; ...@@ -62,10 +62,10 @@ end;
function TLookupService.GetCustomers: TCustomerList; function TLookupService.GetCustomers: TCustomerList;
var var
SQL: string; SQL, ADDRESS: string;
customer: TCustomerItem; customer: TCustomerItem;
begin begin
SQL := 'select NAME, CUSTOMER_ID from customers'; SQL := 'select NAME, CUSTOMER_ID, SHORT_NAME, BILL_ADDRESS, BILL_CITY, BILL_STATE, BILL_ZIP from customers';
doQuery(ordersDB.UniQuery1, SQL); doQuery(ordersDB.UniQuery1, SQL);
result := TCustomerList.Create; result := TCustomerList.Create;
...@@ -79,6 +79,10 @@ begin ...@@ -79,6 +79,10 @@ begin
TXDataOperationContext.Current.Handler.ManagedObjects.Add( customer ); TXDataOperationContext.Current.Handler.ManagedObjects.Add( customer );
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.ADDRESs := ordersDB.UniQuery1.FieldByName('BILL_ADDRESS').AsString +
', ' + ordersDB.UniQuery1.FieldByName('BILL_CITY').AsString +
' ' + ordersDB.UniQuery1.FieldByName('BILL_ZIP').AsString;
result.data.Add(customer); result.data.Add(customer);
result.count := result.count + 1; result.count := result.count + 1;
ordersDB.UniQuery1.Next; ordersDB.UniQuery1.Next;
......
[Options] [Options]
LogFileNum=221 LogFileNum=223
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