Commit 20155abe by Cam Hayes

You can now search based on cad file and clicking on orders clears the search

parent 58589f2e
......@@ -137,6 +137,7 @@ procedure TFViewMain.lblordersClick(Sender: TObject);
begin
if ( not ( change ) ) then
begin
search := '';
ShowForm(TFViewOrders);
lblAppTitle.Caption := 'Koehler-Gibson Orders';
setActive('Orders');
......
......@@ -111,6 +111,7 @@ type
OrderBy: string;
direction: string;
cadFile: string;
filters: boolean;
info: string;
row: integer;
......@@ -459,6 +460,7 @@ begin
orderID := newform.edtOrderID.Text;
companyID := newform.DBID;
orderType := newform.wcbOrderType.Text;
cadFile := newform.edtCadFile.Text;
generateSearchOptions();
//searchOptions := generateSearchOptions();
......@@ -909,6 +911,10 @@ begin
if orderID <> '' then
searchOptions := searchOptions + '&orderID=' + orderID;
if cadFile <> '' then
searchOptions := searchOptions + '&cadFile=' + cadFile;
edtSearch.text := searchOptions;
FViewMain.search := searchOptions;
Result := searchOptions;
......
......@@ -219,6 +219,21 @@ object FSearch: TFSearch
ParentFont = False
WidthPercent = 100.000000000000000000
end
object WebLabel6: TWebLabel
Left = 338
Top = 368
Width = 48
Height = 14
Caption = 'CAD File:'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object wcbFilterType1: TWebComboBox
Left = 8
Top = 462
......@@ -701,15 +716,37 @@ object FSearch: TFSearch
TabOrder = 1
WidthPercent = 100.000000000000000000
end
object edtCadFile: TWebEdit
Left = 338
Top = 388
Width = 145
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementClassName = 'form-control'
ElementFont = efCSS
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Arial'
Font.Style = []
HeightPercent = 100.000000000000000000
HideSelection = False
ParentFont = False
TabOrder = 1
WidthPercent = 100.000000000000000000
OnChange = edtSearchChange
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 520
Top = 383
Left = 596
Top = 15
end
object xdwdsCustomers: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 418
Top = 393
Left = 494
Top = 25
object xdwdsCustomersSHORT_NAME: TStringField
FieldName = 'SHORT_NAME'
end
......@@ -725,7 +762,7 @@ object FSearch: TFSearch
end
object wdsCustomers: TWebDataSource
DataSet = xdwdsCustomers
Left = 594
Top = 387
Left = 662
Top = 5
end
end
......@@ -56,6 +56,8 @@ type
edtCompanyName: TWebEdit;
xdwdsCustomersSHORT_NAME: TStringField;
xdwdsCustomersCUSTOMER_ID: TIntegerField;
WebLabel6: TWebLabel;
edtCadFile: TWebEdit;
procedure btnConfirmClick(Sender: TObject);
procedure WebFormShow(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
......
......@@ -1077,7 +1077,7 @@ var
PageNum, PageSize: Integer;
OrderBy, offset, limit: string;
SQL, whereSQL: string;
OrderID, CompanyID, JobName, orderType: string;
OrderID, CompanyID, JobName, orderType, cadFile: string;
status1, status2: TStatusSearchInfo;
ForPDF: Boolean;
accessRights, userID: string;
......@@ -1111,6 +1111,7 @@ begin
JobName := params.Values['jobName'];
accessRights := params.Values['accessRights'];
userID := params.Values['userID'];
cadFile := params.Values['cadFile'];
status1 := createStatusSearchInfo(params, '1');
status2 := createStatusSearchInfo(params, '2');
......@@ -1148,6 +1149,8 @@ begin
whereSQL := whereSQL + ' AND c.CUSTOMER_ID = ' + CompanyID;
if JobName <> '' then
whereSQL := whereSQL + ' AND o.JOB_NAME LIKE ' + QuotedStr('%' + JobName + '%');
if cadFile <> '' then
whereSQL := whereSQL + ' AND cpo.layout_cad_file LIKE ' + QuotedStr('%' + cadFile + '%');
if accessRights = 'SALES' then
whereSQL := whereSQL + ' AND c.REP_USER_ID = ' + userID;
......
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