Commit 4fbdce5d by Cam Hayes

Search String now saves across pages

parent d607fed9
<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="d-flex align-items-center">
<a id="view.main.apptitle" class="navbar-brand" href="index.html">Koehler-Gibson Orders</a>
......
......@@ -29,7 +29,7 @@
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
<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>
</ul>
</div>
......
......@@ -481,8 +481,7 @@ begin
dtpShipDate.Date := 0;
dtpApprovedDate.Date := 0;
edtOrderNum.Text := '';
btnPDF.Enabled := False;
btnDelete.Enabled := False;
EditMode();
ShowNotification('Success:Order Successfully Copied');
window.scrollTo(0, 0);
end;
......
......@@ -172,30 +172,70 @@ procedure TFViewOrders.WebFormCreate(Sender: TObject);
// PageSize: Number of entries per page.
var
today: TDateTime;
params: TStringList;
begin
DMConnection.ApiConnection.Connected := True;
PageNumber := 1;
TotalPages := 1; // Initial total pages
//Status 1
startDate1 := FormatDateTime('yyyy/mm/dd', 0);
endDate1 := FormatDateTime('yyyy/mm/dd', 0);
filterType1 := '';
null1 := false;
//Status 2
startDate2 := FormatDateTime('yyyy/mm/dd', 0);
endDate2 := FormatDateTime('yyyy/mm/dd', 0);
filterType2 := '';
null2 := false;
orderType := '';
//today := TDateTime.Today;
wcbPageSize.Text := '500';
PageSize := 500;
wlcbOrderBy.DisplayText := 'Order Date';
OrderBy := 'o.ORDER_DATE DESC';
if FViewMain.search = '' then
begin
//Status 1
startDate1 := FormatDateTime('yyyy/mm/dd', 0);
endDate1 := FormatDateTime('yyyy/mm/dd', 0);
filterType1 := '';
null1 := false;
//Status 2
startDate2 := FormatDateTime('yyyy/mm/dd', 0);
endDate2 := FormatDateTime('yyyy/mm/dd', 0);
filterType2 := '';
null2 := false;
orderType := '';
//today := TDateTime.Today;
wcbPageSize.Text := '500';
PageSize := 500;
wlcbOrderBy.DisplayText := 'Order Date';
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());
end;
......@@ -273,7 +313,7 @@ begin
newform.Caption := 'Input Search Options';
newForm.Popup := True;
newForm.Border := fbDialog;
newForm.searchOptions := GenerateSearchOptions();//FViewMain.search;
newForm.searchOptions := FViewMain.search;
// used to manage Back button handling to close subform
window.location.hash := 'subform';
......@@ -304,10 +344,10 @@ begin
companyID := newform.DBID;
orderType := newform.wcbOrderType.Text;
//FViewMain.search := generateSearchOptions();
searchOptions := generateSearchOptions();
edtSearch.Text := searchOptions;
getOrders(searchOptions);
FViewMain.search := generateSearchOptions();
//searchOptions := generateSearchOptions();
edtSearch.Text := FViewMain.search;
getOrders(FViewMain.search);
end;
end
);
......
......@@ -350,7 +350,7 @@ object FSearch: TFSearch
Items.Strings = (
'Corrugated'
'Web'
'Cutting Die'
'Cutting die'
'Any')
end
object wcbFilterType2: TWebComboBox
......
......@@ -116,7 +116,7 @@ begin
DateFormatSettings := TFormatSettings.Create;
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));
edtOrderID.Text := params.Values['orderID'];
edtCompanyID.Text := params.Values['companyID'];
......
......@@ -2,7 +2,7 @@
MemoLogLevel=3
FileLogLevel=5
webClientVersion=0.9.2
LogFileNum=434
LogFileNum=438
[Database]
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