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