Commit e3cf4538 by Mac Stephens

Updated orders list form to use twebdbtablecontrol, started filtering logic, added selection logic

parent 8d360d08
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.3.0",
"configurations": [
{
"preLaunchTask": "Build",
"type": "chrome",
"request": "launch",
"name": "Run",
"url": "http://localhost:${command:rad4.tms.web.port.debug}/${command:rad4.tms.getcurrentproject.html.file}",
"webRoot": "${workspaceFolder}",
"timeout": 20000
},
{
"preLaunchTask": "Build",
"type": "chrome",
"request": "launch",
"name": "Run Without Debugging",
"url": "http://localhost:${command:rad4.tms.web.port.release}/${command:rad4.tms.getcurrentproject.html.file}",
"webRoot": "${workspaceFolder}",
"timeout": 20000
}
]
}
\ No newline at end of file
{
"version": "2.0.0",
"runner": "terminal",
"tasks": [
{
"label": "Build",
"dependsOrder": "sequence",
"dependsOn": [
"Echo",
"Active"
]
},
{
"label": "Echo",
"type": "shell",
"command": "echo 'Building...'",
"problemMatcher": []
},
{
"label": "Sleepdelay",
"type": "shell",
"command": "sleep ${config:TMS.options.electron.debug.delay}",
"windows": {
"command": "ping 127.0.0.1 -n ${config:TMS.options.electron.debug.delay} > '${workspaceFolder}\\.vscode\\null.txt'"
},
"group": "none",
"presentation": {
"reveal": "silent",
"panel": "new"
}
},
{
"label": "Active",
"type": "build",
"operation": "compile",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$tmswebcoreerror",
"$tmswebcorewarning"
]
},
{
"label": "Debug",
"type": "build",
"operation": "compile",
"buildconfiguration": "Debug",
"group": "build",
"problemMatcher": [
"$tmswebcoreerror",
"$tmswebcorewarning"
]
},
{
"label": "Release",
"type": "build",
"operation": "compile",
"buildconfiguration": "Release",
"group": "build",
"problemMatcher": [
"$tmswebcoreerror",
"$tmswebcorewarning"
]
}
]
}
\ No newline at end of file
...@@ -7,7 +7,6 @@ object FOrderList: TFOrderList ...@@ -7,7 +7,6 @@ object FOrderList: TFOrderList
Font.Name = 'Arial' Font.Name = 'Arial'
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
OnShow = WebFormShow
object lblEntries: TWebLabel object lblEntries: TWebLabel
Left = 0 Left = 0
Top = 336 Top = 336
...@@ -48,8 +47,8 @@ object FOrderList: TFOrderList ...@@ -48,8 +47,8 @@ object FOrderList: TFOrderList
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object pnlMessage: TWebPanel object pnlMessage: TWebPanel
Left = 24 Left = 370
Top = 57 Top = 558
Width = 121 Width = 121
Height = 33 Height = 33
ElementClassName = 'card' ElementClassName = 'card'
...@@ -90,18 +89,19 @@ object FOrderList: TFOrderList ...@@ -90,18 +89,19 @@ object FOrderList: TFOrderList
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
end end
object WebDBTableControl: TWebDBTableControl object tblOrders: TWebDBTableControl
Left = 172 Left = 0
Top = 287 Top = 142
Width = 530 Width = 1016
Height = 265 Height = 289
ElementClassName = 'table-responsive' ElementClassName = 'table'
ElementId = 'customer_list' ElementId = 'tbl_orders'
BorderColor = clSilver BorderColor = clSilver
ChildOrder = 5 ChildOrder = 5
ColHeader = False ColHeader = False
ElementTableClassName = 'table table-striped table-bordered table-hover dataTable' ElementTableClassName = 'table table-striped table-hover table-bordered'
Options.ResizeColumns = True Options.ResizeColumns = True
OnClickCell = tblOrdersClickCell
Columns = < Columns = <
item item
DataField = 'ID' DataField = 'ID'
...@@ -124,56 +124,63 @@ object FOrderList: TFOrderList ...@@ -124,56 +124,63 @@ object FOrderList: TFOrderList
DataSource = wdsCustomers DataSource = wdsCustomers
end end
object cbCorrugatedPlate: TWebCheckBox object cbCorrugatedPlate: TWebCheckBox
Left = 172 Left = 190
Top = 210 Top = 26
Width = 113 Width = 113
Height = 22 Height = 22
Caption = 'Corrugated Plate' Caption = 'Corrugated Plate'
Checked = True Checked = True
ChildOrder = 5 ChildOrder = 5
ElementID = 'cb_corrugatedplate'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
State = cbChecked State = cbChecked
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = cbCorrugatedPlateClick
end end
object cbWebPlate: TWebCheckBox object cbWebPlate: TWebCheckBox
Left = 304 Left = 324
Top = 210 Top = 26
Width = 113 Width = 113
Height = 22 Height = 22
Caption = 'Web Plate' Caption = 'Web Plate'
ChildOrder = 5 ChildOrder = 5
ElementID = 'cb_webplate'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = cbWebPlateClick
end end
object edtCompanyName: TWebEdit object btnConfirm: TWebButton
Left = 302 Left = 674
Top = 252 Top = 51
Width = 121 Width = 96
Height = 22 Height = 25
ChildOrder = 7 Caption = 'Confirm'
ChildOrder = 9
ElementID = 'btn_confirm'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object edtID: TWebEdit object edtCompanyName: TWebEdit
Left = 172 Left = 170
Top = 252 Top = 66
Width = 121 Width = 121
Height = 22 Height = 22
ChildOrder = 8 ChildOrder = 8
ElementID = 'edt_companyname'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
Text = 'edtCompanyName'
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = edtCompanyNameChange
end end
object btnConfirm: TWebButton object edtID: TWebEdit
Left = 564 Left = 334
Top = 251 Top = 66
Width = 96 Width = 121
Height = 25 Height = 22
Caption = 'Confirm'
ChildOrder = 9 ChildOrder = 9
ElementID = 'edt_id'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
Text = 'edtID'
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = edtIDChange
end end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
...@@ -181,7 +188,6 @@ object FOrderList: TFOrderList ...@@ -181,7 +188,6 @@ object FOrderList: TFOrderList
Top = 434 Top = 434
end end
object xdwdsCustomers: TXDataWebDataSet object xdwdsCustomers: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 84 Left = 84
Top = 490 Top = 490
object xdwdsCustomersID: TIntegerField object xdwdsCustomersID: TIntegerField
......
<div class="row"> <div class="container pb-5 mt-5 orders-modal rounded-sm shadow border border-secondary bg-white">
<div class="col-12"> <div class="row sticky-top bg-white">
<div class="container mt-4"> <div class="col-auto">
<div class="row justify-content-center"> <h4 class="custom-h4 mt-4">Order List</h4>
<div class="col-12 col-md-8"> <p>Review the list of orders below.</p>
<div class="row"> <hr class="custom-hr">
<div class="col-sm"> </div>
<div id="pnl_message" class="alert alert-danger"> </div>
<button id="view.login.message.button" type="button" class="btn-close" aria-label="Close"></button>
<span id="view.login.message.label"></span>
</div>
</div>
</div>
<div class="row">
<label id="lblentries"></label>
</div>
<label id="lblentries2"></label> <!-- Input Controls -->
<nav aria-label="Page navigation"> <div class="row mb-3">
<ul class="pagination justify-content-center" id="pagination"> <div class="col-md-4">
<!-- Pagination items will be added dynamically via Delphi code --> <label for="edt_companyname" class="form-label">Company Name</label>
</ul> <input type="text" class="form-control" id="edt_companyname" placeholder="Enter company name">
</nav> </div>
</div> <div class="col-md-4">
</div> <label for="edt_id" class="form-label">Order ID</label>
</div> <input type="text" class="form-control" id="edt_id" placeholder="Enter order ID">
</div>
<div class="col-md-2 d-flex align-items-center">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="cb_corrugatedplate">
<label class="form-check-label" for="cb_corrugatedplate">
Corrugated Plate
</label>
</div>
</div> </div>
<div class="col-md-2 d-flex align-items-center">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="cb_webplate">
<label class="form-check-label" for="cb_webplate">
Web Plate
</label>
</div>
</div>
</div>
<!-- Orders Table -->
<div id="tbl_orders_container" class="overflow-auto" style="max-height: 400px;">
<table id="tbl_orders" class="table table-striped table-hover table-bordered">
<!-- TWebDBTableControl will render dynamically here -->
</table>
</div>
<!-- Pagination and Additional Labels -->
<div class="row mt-3">
<label id="lblentries" class="col-auto"></label>
<label id="lblentries2" class="col-auto"></label>
</div>
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center" id="pagination">
<!-- Pagination items will be added dynamically via Delphi code -->
</ul>
</nav>
<!-- Confirm Button -->
<div class="row mt-3">
<div class="col-auto">
<button type="button" id="btn_confirm" class="btn btn-primary">Confirm</button>
</div>
</div>
</div>
...@@ -25,23 +25,18 @@ type ...@@ -25,23 +25,18 @@ type
xdwdsCustomersNAME: TStringField; xdwdsCustomersNAME: TStringField;
xdwdsCustomersSHORT_NAME: TStringField; xdwdsCustomersSHORT_NAME: TStringField;
xdwdsCustomersADDRESS: TStringField; xdwdsCustomersADDRESS: TStringField;
WebDBTableControl: TWebDBTableControl; tblOrders: TWebDBTableControl;
cbCorrugatedPlate: TWebCheckBox; cbCorrugatedPlate: TWebCheckBox;
cbWebPlate: TWebCheckBox; cbWebPlate: TWebCheckBox;
btnConfirm: TWebButton;
edtCompanyName: TWebEdit; edtCompanyName: TWebEdit;
edtID: TWebEdit; edtID: TWebEdit;
btnConfirm: TWebButton; procedure edtIDChange(Sender: TObject);
procedure WebFormShow(Sender: TObject); procedure edtCompanyNameChange(Sender: TObject);
procedure WebDBTableControlGetCellChildren(Sender: TObject; ACol, procedure tblOrdersClickCell(Sender: TObject; ACol, ARow: Integer);
ARow: Integer; AField: TField; AValue: string;
AElement: TJSHTMLElementRecord);
procedure cbCorrugatedPlateClick(Sender: TObject);
procedure cbWebPlateClick(Sender: TObject);
private private
//FJSONProc: TJSONProc; [async] procedure GetCustomers;
procedure AddRowToTable(); procedure FilterDataset;
procedure ClearTable();
[async] procedure getCustomers();
public public
class function CreateForm(AElementID: string): TWebForm; class function CreateForm(AElementID: string): TWebForm;
end; end;
...@@ -53,6 +48,8 @@ implementation ...@@ -53,6 +48,8 @@ implementation
{$R *.dfm} {$R *.dfm}
{ TFOrderList }
class function TFOrderList.CreateForm(AElementID: string): TWebForm; class function TFOrderList.CreateForm(AElementID: string): TWebForm;
begin begin
Application.CreateForm(TFOrderList, AElementID, Result, Application.CreateForm(TFOrderList, AElementID, Result,
...@@ -60,118 +57,133 @@ begin ...@@ -60,118 +57,133 @@ begin
begin begin
with TFOrderList(AForm) do with TFOrderList(AForm) do
begin begin
// Initialize or configure form properties as needed
console.log('TFOrderList created and bound to ElementID:', AElementID);
GetCustomers;
end; end;
end end
); );
end; end;
procedure TFOrderList.WebDBTableControlGetCellChildren(Sender: TObject; ACol,
ARow: Integer; AField: TField; AValue: string;
AElement: TJSHTMLElementRecord);
begin
//WebDBTableControl.WidthStyle := TSizeStyle.ssAuto;
console.log(AValue);
WebDBTableControl.ColWidths[ACol] := AValue.Length * 12;
end;
procedure TFOrderList.WebFormShow(Sender: TObject);
begin
getCustomers();
end;
procedure TFOrderList.cbCorrugatedPlateClick(Sender: TObject); procedure TFOrderList.edtCompanyNameChange(Sender: TObject);
begin begin
cbWebPlate.Checked := false; // FilterDataset;
console.log('Filtering data logic WIP');
end; end;
procedure TFOrderList.cbWebPlateClick(Sender: TObject); procedure TFOrderList.edtIDChange(Sender: TObject);
begin begin
cbCorrugatedPlate.Checked := false; // FilterDataset;
console.log('Filtering data logic WIP');
end; end;
procedure TFOrderList.ClearTable(); procedure TFOrderList.GetCustomers;
// clears the table
var
tbody: TJSHTMLElement;
begin
tbody := TJSHTMLElement(document.getElementById('tblCustomerGrid').getElementsByTagName('tbody')[0]);
tbody.innerHTML := '';
end;
procedure TFOrderList.getCustomers();
var var
xdcResponse: TXDataClientResponse; xdcResponse: TXDataClientResponse;
customerList: TJSObject; ResponseObject: TJSObject;
data: TJSArray; DataArray: TJSArray;
i, count: integer;
temp: TJSONObject;
customer: TJSObject;
begin begin
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetCustomers', try
[])); asm
customerList := TJSObject(xdcResponse.Result); startSpinner();
data := TJSArray(customerList['data']); end;
count := integer(customerList['count']); // Fetch data from the server
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetCustomers', []));
// Log the raw JSON response to verify its structure
console.log('Raw JSON Response:' + TJSJSON.stringify(xdcResponse.Result));
// Extract the "data" array from the JSON response
ResponseObject := TJSObject(xdcResponse.Result);
DataArray := TJSArray(ResponseObject['data']);
// Load the extracted array into the dataset
xdwdsCustomers.Close; xdwdsCustomers.Close;
xdwdsCustomers.SetJsonData(customerList['data']); xdwdsCustomers.SetJsonData(DataArray);
xdwdsCustomers.Open; xdwdsCustomers.Open;
// Log record count and dataset status
console.log('Dataset Record Count: ' + IntToStr(xdwdsCustomers.RecordCount));
if xdwdsCustomers.RecordCount = 0 then
console.log('Dataset is empty.')
else
console.log('Dataset loaded successfully with records.');
finally
asm
setTimeout(endSpinner, 2000);
end;
end;
end; end;
procedure TFOrderList.AddRowToTable();
procedure TFOrderList.tblOrdersClickCell(Sender: TObject; ACol, ARow: Integer);
begin
asm
startSpinner();
end;
try
// Ensure the dataset is active and the row index is valid
if xdwdsCustomers.Active and (ARow >= 0) and (ARow < xdwdsCustomers.RecordCount) then
begin
xdwdsCustomers.RecNo := ARow + 1; // Set the dataset to the selected row
// Populate the edit boxes with the dataset field values
edtCompanyName.Text := xdwdsCustomers.FieldByName('NAME').AsString;
edtID.Text := xdwdsCustomers.FieldByName('ID').AsString;
console.log('Row clicked: ARow=' + IntToStr(ARow) + ', Company=' + edtCompanyName.Text + ', ID=' + edtID.Text);
end;
finally
asm
setTimeout(endSpinner, 2000);
end;
end;
end;
procedure TFOrderList.FilterDataset;
var var
NewRow, Cell, P, Button, Audio: TJSHTMLElement; FilterTextCompany, FilterTextID: string;
ClickHandler: TJSFunction; FilterCondition: string;
//strColorList: string;
id: integer;
begin begin
NewRow := TJSHTMLElement(document.createElement('tr')); try
//NewRow.Attrs['orderType'] := XDataWebDataSet1orderType.Value; // Get the current filter inputs
NewRow.addEventListener('click', procedure FilterTextCompany := Trim(edtCompanyName.Text);
begin FilterTextID := Trim(edtID.Text);
//orderEntry(NewRow.Attrs['id'], 'EDIT');
end); // Build the filter condition
FilterCondition := '';
// Company ID Cell if FilterTextCompany <> '' then
NewRow.Attrs['id'] := xdwdsCustomersID.AsString; FilterCondition := Format('NAME LIKE ''%%%s%%''', [FilterTextCompany]);
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Order ID'); if FilterTextID <> '' then
if xdwdsCustomersID.AsString = '' then begin
Cell.innerText := 'None' if FilterCondition <> '' then
else FilterCondition := FilterCondition + ' AND ';
Cell.innerText := xdwdsCustomersID.AsString; FilterCondition := FilterCondition + Format('ID LIKE ''%%%s%%''', [FilterTextID]);
NewRow.appendChild(Cell); end;
// Company Name Cell // Apply the filter condition
Cell := TJSHTMLElement(document.createElement('td')); xdwdsCustomers.Filtered := False; // Disable existing filter
Cell.setAttribute('data-label', 'Company Name'); xdwdsCustomers.Filter := FilterCondition; // Set new filter
if xdwdsCustomersNAME.Value = '' then xdwdsCustomers.Filtered := True; // Enable filtering
Cell.innerText := 'None'
else console.log('Filter applied:', FilterCondition);
Cell.innerText := xdwdsCustomersNAME.Value;
NewRow.appendChild(Cell); except
on E: Exception do
// Short Name Cell begin
Cell := TJSHTMLElement(document.createElement('td')); // Handle any errors gracefully
Cell.setAttribute('data-label', 'Job Name'); console.error('Error applying filter:', E.Message);
if xdwdsCustomersSHORT_NAME.Value = '' then ShowMessage('An error occurred while applying the filter. Please check your input.');
Cell.innerText := 'None' end;
else end;
Cell.innerText := xdwdsCustomersSHORT_NAME.Value;
NewRow.appendChild(Cell);
// Address Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Order Date');
if xdwdsCustomersADDRESS.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := xdwdsCustomersADDRESS.Value;
NewRow.appendChild(Cell);
// Appends new rows to the table body
TJSHTMLElement(document.getElementById('tblCustomerGrid').getElementsByTagName('tbody')[0]).appendChild(NewRow);
end; end;
end. end.
...@@ -274,6 +274,20 @@ object FViewOrders: TFViewOrders ...@@ -274,6 +274,20 @@ object FViewOrders: TFViewOrders
ListField = 'NAME' ListField = 'NAME'
ListSource = wdsCustomers ListSource = wdsCustomers
end end
object pnlOrders: TWebPanel
Left = 38
Top = 132
Width = 461
Height = 181
ElementClassName = 'card'
ElementID = 'pnl_orders'
Caption = 'pnlOrders'
ChildOrder = 15
ElementBodyClassName = 'card-body'
ElementFont = efCSS
TabOrder = 13
Visible = False
end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 8 Left = 8
......
...@@ -120,3 +120,18 @@ ...@@ -120,3 +120,18 @@
</div> </div>
</div> </div>
</div> </div>
<!-- pnl_orders Div -->
<div id="pnl_orders"
style="display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1050;
padding: 20px;
border-radius: 10px;
width: 75%;
background-color: white;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);">
</div>
...@@ -63,6 +63,7 @@ type ...@@ -63,6 +63,7 @@ type
xdwdsSave: TXDataWebDataSet; xdwdsSave: TXDataWebDataSet;
wdsSave: TWebDataSource; wdsSave: TWebDataSource;
xdwdsSaveCURR_ID: TIntegerField; xdwdsSaveCURR_ID: TIntegerField;
pnlOrders: TWebPanel;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
procedure btnApplyClick(Sender: TObject); procedure btnApplyClick(Sender: TObject);
procedure btnSearchClick(Sender: TObject); procedure btnSearchClick(Sender: TObject);
...@@ -167,34 +168,30 @@ begin ...@@ -167,34 +168,30 @@ begin
); );
end; end;
procedure TFViewOrders.ShowOrderListForm(); procedure TFViewOrders.ShowOrderListForm();
var var
newform: TFOrderList; OrdersPanel: TJSHTMLElement;
formattedBkNum: string;
begin begin
newform := TFOrderList.CreateNew; // Get the panel element for orders
OrdersPanel := TJSHTMLElement(document.getElementById('pnl_orders'));
{newform.FUserInfo := AUserInfo;
newform.FBKNum := ABKNum;
newform.FSource := ASource;
newform.FViewImages := AViewImages;}
newform.Caption := 'Select Company an Order Type'; // Hide the panel before loading the form
newForm.Popup := True; if Assigned(OrdersPanel) then
newForm.Border := fbDialog; OrdersPanel.style.setProperty('display', 'none');
console.log(newForm.GetElementHandle);
// used to manage Back button handling to close subform // Create the order list form, passing the ElementID
window.location.hash := 'subform'; TFOrderList.CreateForm(pnlOrders.ElementID);
newform.ShowModal( // Show the panel after the form is created
procedure(AValue: TModalResult) if Assigned(OrdersPanel) then
begin OrdersPanel.style.setProperty('display', 'block');
//ShowMessage('View Booking Details Form closed');
end
);
end; end;
procedure TFViewOrders.AddRowToTable(temp: string); procedure TFViewOrders.AddRowToTable(temp: string);
// Adds rows to the table // Adds rows to the table
// PhoneNumber: phone number of the location // PhoneNumber: phone number of the location
......
...@@ -22,10 +22,9 @@ object AuthDatabase: TAuthDatabase ...@@ -22,10 +22,9 @@ object AuthDatabase: TAuthDatabase
SpecificOptions.Strings = ( SpecificOptions.Strings = (
'PostgreSQL.Schema=envoy') 'PostgreSQL.Schema=envoy')
Username = 'root' Username = 'root'
Server = '192.168.159.132' Server = '192.168.75.133'
Connected = True
LoginPrompt = False LoginPrompt = False
Left = 67 Left = 69
Top = 131 Top = 131
EncryptedPassword = '9AFF92FF8CFF86FF8CFFCFFFCEFF' EncryptedPassword = '9AFF92FF8CFF86FF8CFFCFFFCEFF'
end end
......
...@@ -8,8 +8,7 @@ object FDatabaseModule: TFDatabaseModule ...@@ -8,8 +8,7 @@ object FDatabaseModule: TFDatabaseModule
SpecificOptions.Strings = ( SpecificOptions.Strings = (
'PostgreSQL.Schema=envoy') 'PostgreSQL.Schema=envoy')
Username = 'root' Username = 'root'
Server = '192.168.159.132' Server = '192.168.75.133'
Connected = True
LoginPrompt = False LoginPrompt = False
Left = 75 Left = 75
Top = 139 Top = 139
......
...@@ -60,13 +60,6 @@ object FMain: TFMain ...@@ -60,13 +60,6 @@ object FMain: TFMain
TabOrder = 4 TabOrder = 4
OnClick = btnAuthSwaggerUIClick OnClick = btnAuthSwaggerUIClick
end end
object tmrTwilio: TTimer
Enabled = False
Interval = 300000
OnTimer = tmrTwilioTimer
Left = 167
Top = 399
end
object initTimer: TTimer object initTimer: TTimer
OnTimer = initTimerTimer OnTimer = initTimerTimer
Left = 58 Left = 58
......
...@@ -17,13 +17,11 @@ type ...@@ -17,13 +17,11 @@ type
btnApiSwaggerUI: TButton; btnApiSwaggerUI: TButton;
btnData: TButton; btnData: TButton;
btnExit: TButton; btnExit: TButton;
tmrTwilio: TTimer;
initTimer: TTimer; initTimer: TTimer;
btnAuthSwaggerUI: TButton; btnAuthSwaggerUI: TButton;
procedure btnApiSwaggerUIClick(Sender: TObject); procedure btnApiSwaggerUIClick(Sender: TObject);
procedure btnDataClick(Sender: TObject); procedure btnDataClick(Sender: TObject);
procedure btnExitClick(Sender: TObject); procedure btnExitClick(Sender: TObject);
procedure tmrTwilioTimer(Sender: TObject);
procedure ContactFormData(AText: String); procedure ContactFormData(AText: String);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure initTimerTimer(Sender: TObject); procedure initTimerTimer(Sender: TObject);
...@@ -128,28 +126,6 @@ begin ...@@ -128,28 +126,6 @@ begin
Logger.Log( 1, '--Database->Server: Entry not found' ) Logger.Log( 1, '--Database->Server: Entry not found' )
else else
Logger.Log( 1, '--Database->Server: ' + iniStr ); Logger.Log( 1, '--Database->Server: ' + iniStr );
iniStr := IniFile.ReadString( 'Options', 'TwilioUpdateTime', '' );
if iniStr.IsEmpty then
Logger.Log( 1, '--Options->TwilioUpdateTime: Entry not found' )
else
begin
Logger.Log( 1, '--Options->TwilioUpdateTime: ' + iniStr );
if iniStr = '0' then
begin
Logger.Log( 1, '--Twilio Update Timer not enabled due to timer length of ' +
'0. Edit the ini file to enable auto updates.');
tmrTwilio.Enabled := False;
end
else
begin
Logger.Log( 1, '--Twilio Update Timer enabled and set to update every '+ iniStr + ' minutes.');
tmrTwilio.Interval := StrToInt(IniStr) * 60000;
tmrTwilio.Enabled := True;
end;
end;
Logger.Log(1, ''); Logger.Log(1, '');
finally finally
IniFile.Free; IniFile.Free;
...@@ -165,17 +141,6 @@ begin ...@@ -165,17 +141,6 @@ begin
AppServerModule.StartAppServer( serverConfig.url ); AppServerModule.StartAppServer( serverConfig.url );
end; end;
procedure TFMain.tmrTwilioTimer(Sender: TObject);
var
key: string;
phoneNum: string;
begin
memoInfo.Lines.Add('Timer set off');
tmrTwilio.Enabled := False;
tmrTwilio.Enabled := True;
end;
procedure TFMain.FormClose(Sender: TObject; var Action: TCloseAction); procedure TFMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin begin
phoneDict.Free; phoneDict.Free;
......
[Options] [Options]
LogFileNum=223 LogFileNum=226
UpdateTimerLength=0 UpdateTimerLength=0
[Database] [Database]
Server=192.168.159.132 --Server=192.168.159.132
--Server=192.168.102.129 --Server=192.168.102.129
Server=192.168.75.133
[Twilio] [Twilio]
AccountSID=AC37aeef9c36a2cccbaecbadafc172b2ff AccountSID=AC37aeef9c36a2cccbaecbadafc172b2ff
......
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