Commit 4fbdce5d by Cam Hayes

Search String now saves across pages

parent d607fed9
<div id="wrapper"> <div id="wrapper">
<nav class="navbar navbar-expand navbar-light bg-light sticky-top" style="margin-bottom: 0px;"> <nav class="navbar navbar-expand navbar-light bg-light" style="margin-bottom: 0px;">
<div class="container-fluid"> <div class="container-fluid">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<a id="view.main.apptitle" class="navbar-brand" href="index.html">Koehler-Gibson Orders</a> <a id="view.main.apptitle" class="navbar-brand" href="index.html">Koehler-Gibson Orders</a>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button> <button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<button id="btnclose" class="btn btn-secondary btn-sm">Close</button> <button id="btnclose" class="btn btn-primary btn-sm">Close</button>
</li> </li>
</ul> </ul>
</div> </div>
......
...@@ -481,8 +481,7 @@ begin ...@@ -481,8 +481,7 @@ begin
dtpShipDate.Date := 0; dtpShipDate.Date := 0;
dtpApprovedDate.Date := 0; dtpApprovedDate.Date := 0;
edtOrderNum.Text := ''; edtOrderNum.Text := '';
btnPDF.Enabled := False; EditMode();
btnDelete.Enabled := False;
ShowNotification('Success:Order Successfully Copied'); ShowNotification('Success:Order Successfully Copied');
window.scrollTo(0, 0); window.scrollTo(0, 0);
end; end;
......
...@@ -172,11 +172,14 @@ procedure TFViewOrders.WebFormCreate(Sender: TObject); ...@@ -172,11 +172,14 @@ procedure TFViewOrders.WebFormCreate(Sender: TObject);
// PageSize: Number of entries per page. // PageSize: Number of entries per page.
var var
today: TDateTime; today: TDateTime;
params: TStringList;
begin begin
DMConnection.ApiConnection.Connected := True; DMConnection.ApiConnection.Connected := True;
PageNumber := 1; PageNumber := 1;
TotalPages := 1; // Initial total pages TotalPages := 1; // Initial total pages
if FViewMain.search = '' then
begin
//Status 1 //Status 1
startDate1 := FormatDateTime('yyyy/mm/dd', 0); startDate1 := FormatDateTime('yyyy/mm/dd', 0);
endDate1 := FormatDateTime('yyyy/mm/dd', 0); endDate1 := FormatDateTime('yyyy/mm/dd', 0);
...@@ -196,6 +199,43 @@ begin ...@@ -196,6 +199,43 @@ begin
PageSize := 500; PageSize := 500;
wlcbOrderBy.DisplayText := 'Order Date'; wlcbOrderBy.DisplayText := 'Order Date';
OrderBy := 'o.ORDER_DATE DESC'; OrderBy := 'o.ORDER_DATE DESC';
end
else
begin
params := TStringList.Create;
params.StrictDelimiter := true;
// parse the searchOptions
params.Delimiter := '&';
params.DelimitedText := FViewMain.search;
PageNumber := StrToInt(params.Values['pagenumber']);
PageSize := StrToInt(params.Values['pagesize']);
wcbPageSize.Text := IntToStr(PageSize);
OrderBy := params.Values['orderby'];
wlcbOrderBy.DisplayText := OrderBy;
orderType := params.Values['orderType'].ToLower();
OrderID := params.Values['orderID'];
companyID := params.Values['companyID'];
jobName := params.Values['jobName'];
// Status1
startDate1 := params.Values['startDate1'];
endDate1 := params.Values['endDate1'];
filterType1 := params.Values['filterType1'];
if params.Values['null1'] = '' then
null1 := false
else
null1 := StrToBool(params.Values['null1']);
// Status 2
startDate2 := params.Values['startDate2'];
endDate2 := params.Values['endDate2'];
filterType2 := params.Values['filterType2'];
if params.Values['null2'] = '' then
null2 := false
else
null2 := StrToBool(params.Values['null2']);
end;
getOrders(GenerateSearchOptions()); getOrders(GenerateSearchOptions());
end; end;
...@@ -273,7 +313,7 @@ begin ...@@ -273,7 +313,7 @@ begin
newform.Caption := 'Input Search Options'; newform.Caption := 'Input Search Options';
newForm.Popup := True; newForm.Popup := True;
newForm.Border := fbDialog; newForm.Border := fbDialog;
newForm.searchOptions := GenerateSearchOptions();//FViewMain.search; newForm.searchOptions := FViewMain.search;
// used to manage Back button handling to close subform // used to manage Back button handling to close subform
window.location.hash := 'subform'; window.location.hash := 'subform';
...@@ -304,10 +344,10 @@ begin ...@@ -304,10 +344,10 @@ begin
companyID := newform.DBID; companyID := newform.DBID;
orderType := newform.wcbOrderType.Text; orderType := newform.wcbOrderType.Text;
//FViewMain.search := generateSearchOptions(); FViewMain.search := generateSearchOptions();
searchOptions := generateSearchOptions(); //searchOptions := generateSearchOptions();
edtSearch.Text := searchOptions; edtSearch.Text := FViewMain.search;
getOrders(searchOptions); getOrders(FViewMain.search);
end; end;
end end
); );
......
...@@ -350,7 +350,7 @@ object FSearch: TFSearch ...@@ -350,7 +350,7 @@ object FSearch: TFSearch
Items.Strings = ( Items.Strings = (
'Corrugated' 'Corrugated'
'Web' 'Web'
'Cutting Die' 'Cutting die'
'Any') 'Any')
end end
object wcbFilterType2: TWebComboBox object wcbFilterType2: TWebComboBox
......
...@@ -116,7 +116,7 @@ begin ...@@ -116,7 +116,7 @@ begin
DateFormatSettings := TFormatSettings.Create; DateFormatSettings := TFormatSettings.Create;
DateFormatSettings.ShortDateFormat := 'yyyy/mm/dd'; DateFormatSettings.ShortDateFormat := 'yyyy/mm/dd';
console.log(UpperCase(Copy(params.Values['orderType'], 1, 1)) + LowerCase(Copy(params.Values['orderType'], 2, MaxInt)));
wcbOrderType.Text := UpperCase(Copy(params.Values['orderType'], 1, 1)) + LowerCase(Copy(params.Values['orderType'], 2, MaxInt)); wcbOrderType.Text := UpperCase(Copy(params.Values['orderType'], 1, 1)) + LowerCase(Copy(params.Values['orderType'], 2, MaxInt));
edtOrderID.Text := params.Values['orderID']; edtOrderID.Text := params.Values['orderID'];
edtCompanyID.Text := params.Values['companyID']; edtCompanyID.Text := params.Values['companyID'];
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
MemoLogLevel=3 MemoLogLevel=3
FileLogLevel=5 FileLogLevel=5
webClientVersion=0.9.2 webClientVersion=0.9.2
LogFileNum=434 LogFileNum=438
[Database] [Database]
Server=192.168.159.131 Server=192.168.159.131
......
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