Commit 951448d9 by Elias Sarraf

Merge branch 'cam2'

parents d2ea84ea afced290
...@@ -43,6 +43,8 @@ type ...@@ -43,6 +43,8 @@ type
{ Private declarations } { Private declarations }
public public
{ Public declarations } { Public declarations }
var
confirm: boolean;
end; end;
var var
...@@ -60,11 +62,13 @@ end; ...@@ -60,11 +62,13 @@ end;
procedure TFAddOrder.btnConfirmClick(Sender: TObject); procedure TFAddOrder.btnConfirmClick(Sender: TObject);
begin begin
confirm := true;
Close; Close;
end; end;
procedure TFAddOrder.WebFormShow(Sender: TObject); procedure TFAddOrder.WebFormShow(Sender: TObject);
begin begin
confirm := false;
getCustomers(); getCustomers();
end; end;
......
object FViewOrders: TFViewOrders object FViewOrders: TFViewOrders
Width = 676 Width = 676
Height = 480 Height = 480
Caption = 'edtorderid'
CSSLibrary = cssBootstrap CSSLibrary = cssBootstrap
ElementFont = efCSS ElementFont = efCSS
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
...@@ -9,6 +10,7 @@ object FViewOrders: TFViewOrders ...@@ -9,6 +10,7 @@ object FViewOrders: TFViewOrders
Font.Name = 'Tahoma' Font.Name = 'Tahoma'
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
Visible = True
OnCreate = WebFormCreate OnCreate = WebFormCreate
OnShow = WebFormShow OnShow = WebFormShow
object lblEntries: TWebLabel object lblEntries: TWebLabel
...@@ -23,63 +25,16 @@ object FViewOrders: TFViewOrders ...@@ -23,63 +25,16 @@ object FViewOrders: TFViewOrders
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object wcbSortBy: TWebComboBox object lblSearch: TWebLabel
Left = 368 Left = 594
Top = 16 Top = 116
Width = 145 Width = 47
Height = 21 Height = 13
ElementID = 'wcbsortby' Caption = 'Search = '
ElementFont = efCSS ElementID = 'lblsearch'
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
TabOrder = 4
TabStop = False
Text = 'PROOF DONE'
WidthPercent = 100.000000000000000000
ItemIndex = -1
Items.Strings = (
'PROOF DUE'
'PROOF DONE'
'ART DUE'
'ART DONE'
'PLATE DUE'
'PLATE DONE'
'MOUNT DUE'
'MOUNT DONE'
'SHIP DUE'
'SHIP DONE')
end
object btnApply: TWebButton
Left = 542
Top = 16
Width = 96
Height = 25
Caption = 'Apply'
ChildOrder = 7
ElementID = 'btnapply'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
TabOrder = 5
TabStop = False
WidthPercent = 100.000000000000000000
OnClick = btnApplyClick
end
object edtSearch: TWebEdit
Left = 35
Top = 16
Width = 121
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementClassName = 'form-control'
ElementID = 'edtsearch'
ElementFont = efCSS ElementFont = efCSS
HeightStyle = ssAuto HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
HideSelection = False
TabOrder = 1
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object btnAddOrder: TWebButton object btnAddOrder: TWebButton
...@@ -98,12 +53,12 @@ object FViewOrders: TFViewOrders ...@@ -98,12 +53,12 @@ object FViewOrders: TFViewOrders
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnAddOrderClick OnClick = btnAddOrderClick
end end
object btnFilters: TWebButton object btnSearch: TWebButton
Left = 462 Left = 462
Top = 79 Top = 79
Width = 96 Width = 96
Height = 25 Height = 25
Caption = 'Show Filters' Caption = 'Search'
ChildOrder = 6 ChildOrder = 6
ElementID = 'btnfilters' ElementID = 'btnfilters'
ElementFont = efCSS ElementFont = efCSS
...@@ -112,41 +67,7 @@ object FViewOrders: TFViewOrders ...@@ -112,41 +67,7 @@ object FViewOrders: TFViewOrders
TabOrder = 9 TabOrder = 9
TabStop = False TabStop = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnFiltersClick OnClick = btnSearchClick
end
object dtpStartDate: TWebDateTimePicker
Left = 168
Top = 16
Width = 85
Height = 22
ElementID = 'dtpstartdate'
HeightStyle = ssAuto
BorderStyle = bsSingle
ChildOrder = 7
Color = clWhite
Date = 45553.505972858790000000
ElementFont = efCSS
Role = ''
TabOrder = 2
TabStop = False
Text = ''
end
object dtpEndDate: TWebDateTimePicker
Left = 266
Top = 16
Width = 87
Height = 22
ElementID = 'dtpenddate'
HeightStyle = ssAuto
BorderStyle = bsSingle
ChildOrder = 7
Color = clWhite
Date = 45553.505972858790000000
ElementFont = efCSS
Role = ''
TabOrder = 3
TabStop = False
Text = ''
end end
object pnlMessage: TWebPanel object pnlMessage: TWebPanel
Left = 82 Left = 82
...@@ -160,7 +81,7 @@ object FViewOrders: TFViewOrders ...@@ -160,7 +81,7 @@ object FViewOrders: TFViewOrders
ElementFont = efCSS ElementFont = efCSS
ElementPosition = epRelative ElementPosition = epRelative
Role = 'alert' Role = 'alert'
TabOrder = 7 TabOrder = 2
object lblMessage: TWebLabel object lblMessage: TWebLabel
Left = 32 Left = 32
Top = 11 Top = 11
...@@ -269,6 +190,11 @@ object FViewOrders: TFViewOrders ...@@ -269,6 +190,11 @@ object FViewOrders: TFViewOrders
Title = 'Job Name' Title = 'Job Name'
end end
item item
DataField = 'orderType'
Title = 'Order Type'
end
item
ElementClassName = 'text-nowrap'
DataField = 'orderDate' DataField = 'orderDate'
Title = 'Order Date' Title = 'Order Date'
end end
...@@ -289,6 +215,14 @@ object FViewOrders: TFViewOrders ...@@ -289,6 +215,14 @@ object FViewOrders: TFViewOrders
Title = 'Art Done' Title = 'Art Done'
end end
item item
DataField = 'plateDue'
Title = 'Plate Due'
end
item
DataField = 'plateDone'
Title = 'Plate Done'
end
item
DataField = 'mountDue' DataField = 'mountDue'
Title = 'Mount Due' Title = 'Mount Due'
end end
...@@ -310,25 +244,103 @@ object FViewOrders: TFViewOrders ...@@ -310,25 +244,103 @@ object FViewOrders: TFViewOrders
end end
item item
DataField = 'qbRefNum' DataField = 'qbRefNum'
Title = 'Quickbooks Reference Number' Title = 'QB Ref Num'
end end
item item
DataField = 'colors' DataField = 'colors'
Title = 'Colors' Title = 'Colors'
end>
DataSource = wdsOrders
end
object wcbPageSize: TWebComboBox
Left = 22
Top = 52
Width = 145
Height = 21
ElementClassName = 'custom-select'
ElementID = 'wcbpagesize'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
Text = '500'
WidthPercent = 100.000000000000000000
OnChange = wcbPageSizeChange
ItemIndex = -1
Items.Strings = (
'100'
'250'
'500'
'1000')
end
object wlcbOrderBy: TWebLookupComboBox
Left = 188
Top = 52
Width = 145
Height = 22
ElementClassName = 'custom-select'
ElementID = 'wlcborderby'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = wlcbOrderByChange
ItemIndex = -1
LookupValues = <
item
Value = 'o.ORDER_ID DESC'
DisplayText = 'ID'
end end
item item
DataField = 'plateDue' Value = 'c.NAME ASC'
Title = 'Plate Due' DisplayText = 'Company Name'
end end
item item
DataField = 'plateDone' Value = 'o.JOB_NAME ASC'
Title = 'Plate Done' DisplayText = 'Job Name'
end end
item item
DataField = 'orderType' Value = 'o.ORDER_DATE DESC'
Title = 'Order Type' DisplayText = 'Order Date'
end
item
Value = 'PROOF_DUE DESC'
DisplayText = 'Proof Due'
end
item
Value = 'PROOF_DONE DESC'
DisplayText = 'Proof Done'
end
item
Value = 'ART_DUE DESC'
DisplayText = 'Art Due'
end
item
Value = 'ART_DONE DESC'
DisplayText = 'Art Done'
end
item
Value = 'PLATE_DUE DESC'
DisplayText = 'Plate Due'
end
item
Value = 'PLATE_DONE DESC'
DisplayText = 'Plate Done'
end
item
Value = 'MOUNT_DUE DESC'
DisplayText = 'Mount Due'
end
item
Value = 'MOUNT_DONE DESC'
DisplayText = 'Mount Done'
end
item
Value = 'SHIP_DUE DESC'
DisplayText = 'Ship Due'
end
item
Value = 'SHIP_DONE DESC'
DisplayText = 'Ship Done'
end> end>
DataSource = wdsOrders
end end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
...@@ -348,6 +360,9 @@ object FViewOrders: TFViewOrders ...@@ -348,6 +360,9 @@ object FViewOrders: TFViewOrders
object xdwdsOrdersjobName: TStringField object xdwdsOrdersjobName: TStringField
FieldName = 'jobName' FieldName = 'jobName'
end end
object xdwdsOrdersorderType: TStringField
FieldName = 'orderType'
end
object xdwdsOrdersorderDate: TStringField object xdwdsOrdersorderDate: TStringField
FieldName = 'orderDate' FieldName = 'orderDate'
end end
...@@ -363,6 +378,12 @@ object FViewOrders: TFViewOrders ...@@ -363,6 +378,12 @@ object FViewOrders: TFViewOrders
object xdwdsOrdersartDone: TStringField object xdwdsOrdersartDone: TStringField
FieldName = 'artDone' FieldName = 'artDone'
end end
object xdwdsOrdersplateDue: TStringField
FieldName = 'plateDue'
end
object xdwdsOrdersplateDone: TStringField
FieldName = 'plateDone'
end
object xdwdsOrdersmountDue: TStringField object xdwdsOrdersmountDue: TStringField
FieldName = 'mountDue' FieldName = 'mountDue'
end end
...@@ -384,15 +405,6 @@ object FViewOrders: TFViewOrders ...@@ -384,15 +405,6 @@ object FViewOrders: TFViewOrders
object xdwdsOrderscolors: TStringField object xdwdsOrderscolors: TStringField
FieldName = 'colors' FieldName = 'colors'
end end
object xdwdsOrdersplateDue: TStringField
FieldName = 'plateDue'
end
object xdwdsOrdersplateDone: TStringField
FieldName = 'plateDone'
end
object xdwdsOrdersorderType: TStringField
FieldName = 'orderType'
end
end end
object wdsOrders: TWebDataSource object wdsOrders: TWebDataSource
DataSet = xdwdsOrders DataSet = xdwdsOrders
......
<div class="container h-100 d-flex flex-column mt-0" style="max-width: 95%;"> <div class="container h-100 d-flex flex-column mt-0" style="max-width: 100%; padding-bottom: 0;">
<!-- Alert Section --> <!-- Alert Section -->
<div class="row"> <div class="row">
<div class="col-sm"> <div class="col-sm">
...@@ -9,62 +9,45 @@ ...@@ -9,62 +9,45 @@
</div> </div>
</div> </div>
<!-- Filters Section --> <!-- Actions Row -->
<div class="container mb-3"> <div class="row mt-3 justify-content-center">
<!-- Filters Row (Hidden Initially) --> <div class="col-auto d-flex align-items-center">
<div id="filter_info" style="display: none;"> <label class="mt-3" style="font-weight: 700;">Show <select class="custom-select" id="wcbpagesize" style="font-size: 1.00rem;"></select> entries</label>
<div class="row justify-content-center">
<div class="col-auto">
<label for="edtsearch" class="fw-bold">Search:</label>
<input type="text" id="edtsearch" class="form-control">
</div>
<div class="col-auto">
<label for="dtpstartdate" class="fw-bold">Start Date:</label>
<input type="date" id="dtpstartdate" class="form-control">
</div>
<div class="col-auto">
<label for="dtpenddate" class="fw-bold">End Date:</label>
<input type="date" id="dtpenddate" class="form-control">
</div>
<div class="col-auto">
<label for="wcbsortby" class="fw-bold">Property Type*</label>
<select class="form-select" id="wcbsortby"></select>
</div>
<div class="col-auto d-flex align-items-end">
<button id="btnapply" class="btn btn-primary">Apply</button>
</div>
</div>
</div> </div>
<div class="col-auto d-flex align-items-center">
<!-- Actions Row --> <label class="mt-3" style="font-weight: 700;">Order By: <select class="custom-select" id="wlcborderby" style="font-size: 1.00rem;"></select></label>
<div class="row mt-3 justify-content-center"> </div>
<div class="col-auto"> <div class="col-auto">
<button id="btnaddorder" class="btn btn-secondary mt-3">Add Order</button> <button id="btnaddorder" class="btn btn-secondary mt-3">Add Order</button>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button id="btnsetstatus" class="btn btn-secondary mt-3">Set Status</button> <button id="btnsetstatus" class="btn btn-secondary mt-3">Set Status</button>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button id="btngeneratepdf" class="btn btn-secondary mt-3" type="button">Generate PDF</button> <button id="btngeneratepdf" class="btn btn-secondary mt-3" type="button">Generate PDF</button>
<div class="invalid-feedback"> <div class="invalid-feedback">
No order selected. Please select an order to generate a PDF. No order selected. Please select an order to generate a PDF.
</div>
</div>
<div class="col-auto">
<button id="btnfilters" class="btn btn-secondary mt-3">Filters</button>
</div> </div>
</div> </div>
<div class="col-auto">
<button id="btnfilters" class="btn btn-secondary mt-3">Filters</button>
</div>
</div> </div>
<!-- Entries Label Section --> <!-- Entries Label Section d-flex justify-content-between w-100 mt-2-->
<div class="d-flex justify-content-between w-100 mt-2"> <div class="row">
<label id="lblentries"></label> <div class="col text-start">
<label id="lblentries"></label>
</div>
<div class="col text-end">
<label id="lblsearch"></label>
</div>
</div> </div>
<!-- Table Section --> <!-- Table Section -->
<div id="order_table_section" class="overflow-auto mt-2" <div id="order_table_section" class="overflow-auto mt-2"
style="max-height: calc(100vh - 380px); border-bottom: none; padding-bottom: 0;"> style="max-height: calc(100vh - 250px); padding-bottom: 0; width: 100%;">
<table id="tblPhoneGrid" class="table table-striped table-bordered"> <table id="tblPhoneGrid" class="table table-striped table-bordered" style="width: 100%;">
<thead class="sticky-top bg-light"> <thead class="sticky-top bg-light">
<tr style="font-size: 0.875rem;"> <tr style="font-size: 0.875rem;">
<!-- Table headers are dynamically generated --> <!-- Table headers are dynamically generated -->
...@@ -86,22 +69,3 @@ ...@@ -86,22 +69,3 @@
</div> </div>
</div> </div>
<!-- Confirmation Modal -->
<div id="confirmation_modal" class="modal fade" tabindex="-1" aria-labelledby="confirmation_modal_label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 id="confirmation_modal_label" class="modal-title">Select Customer</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<select id="wcbcustomer" class="form-control input-sm"></select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" id="btn_confirm_order">Confirm</button>
</div>
</div>
</div>
</div>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>TMS Web Project</title>
<style>
</style>
</head>
<body>
</body>
</html>
unit View.Search;
interface
uses
System.SysUtils, System.Generics.Collections, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Dialogs, WEBLib.Menus, WEBLib.ExtCtrls, WEBLib.StdCtrls,
WEBLib.JSON, Auth.Service, XData.Web.Client, WebLib.Storage,
ConnectionModule, App.Types, Vcl.StdCtrls, Vcl.Controls, WEBLib.DBCtrls,
Data.DB, XData.Web.JsonDataset, XData.Web.Dataset, WEBLib.DB, WEBLib.Grids,
Vcl.Grids, VCL.TMSFNCTypes, VCL.TMSFNCUtils, VCL.TMSFNCGraphics,
VCL.TMSFNCGraphicsTypes, VCL.TMSFNCGridCell, VCL.TMSFNCGridOptions,
VCL.TMSFNCCustomControl, VCL.TMSFNCCustomScrollControl, VCL.TMSFNCGridData,
VCL.TMSFNCCustomGrid, VCL.TMSFNCGrid;
type
TFSearch = class(TWebForm)
pnlMessage: TWebPanel;
lblMessage: TWebLabel;
btnCloseNotification: TWebButton;
wcbFilterType1: TWebComboBox;
btnConfirm: TWebButton;
edtOrderID: TWebEdit;
dtpStartDate1: TWebDateTimePicker;
dtpEndDate1: TWebDateTimePicker;
cbNull1: TWebCheckBox;
wcbOrderType: TWebComboBox;
lblStatus1: TWebLabel;
lblType1: TWebLabel;
lblStartDate1: TWebLabel;
lblEndDate1: TWebLabel;
wcbFilterType2: TWebComboBox;
dtpStartDate2: TWebDateTimePicker;
dtpEndDate2: TWebDateTimePicker;
cbNull2: TWebCheckBox;
lblStatus2: TWebLabel;
lblType2: TWebLabel;
lblStartDate2: TWebLabel;
lblEndDate2: TWebLabel;
WebLabel1: TWebLabel;
WebLabel2: TWebLabel;
TMSFNCGrid1: TTMSFNCGrid;
edtSearch: TWebEdit;
edtCompanyID: TWebEdit;
lblCompanyID: TWebLabel;
XDataWebClient1: TXDataWebClient;
xdwdsCustomers: TXDataWebDataSet;
xdwdsCustomersID: TIntegerField;
xdwdsCustomersNAME: TStringField;
xdwdsCustomersSHORT_NAME: TStringField;
xdwdsCustomersADDRESS: TStringField;
wdsCustomers: TWebDataSource;
WebLabel3: TWebLabel;
edtJobName: TWebEdit;
WebLabel4: TWebLabel;
btnCancel: TWebButton;
btnClear: TWebButton;
procedure btnConfirmClick(Sender: TObject);
procedure WebFormShow(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure edtSearchChange(Sender: TObject);
procedure TMSFNCGrid1CellClick(Sender: TObject; ACol, ARow: Integer);
procedure btnClearClick(Sender: TObject);
private
//FJSONProc: TJSONProc;
[async] procedure getCustomers;
procedure PopulateGridManually;
procedure ApplyFilter;
var
temp: string;
public
class function CreateForm(AElementID: string): TWebForm;
var
confirm: boolean;
searchOptions: string;
end;
var
FSearch: TFSearch;
implementation
{$R *.dfm}
class function TFSearch.CreateForm(AElementID: string): TWebForm;
begin
Application.CreateForm(TFSearch, AElementID, Result,
procedure(AForm: TObject)
begin
with TFSearch(AForm) do
begin
end;
end
);
end;
procedure TFSearch.edtSearchChange(Sender: TObject);
begin
ApplyFilter;
end;
procedure TFSearch.WebFormShow(Sender: TObject);
var
params: TStringList;
DateFormatSettings: TFormatSettings;
begin
params := TStringList.Create;
params.StrictDelimiter := true;
params.Delimiter := '&';
params.DelimitedText := searchOptions;
confirm := false;
DateFormatSettings := TFormatSettings.Create;
DateFormatSettings.ShortDateFormat := 'yyyy/mm/dd';
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'];
edtJobName.Text := params.Values['jobName'];
// Status 1
if params.Values['filterType1'] <> '' then
wcbFilterType1.Text := params.Values['filterType1']
else
wcbFilterType1.Text := 'NONE';
console.log(params.Values['startDate1']);
if params.Values['startDate1'] = '' then
dtpStartDate1.Date := 0
else
begin
dtpStartDate1.Date := StrToDateTime(params.Values['startDate1'], DateFormatSettings);
end;
if params.Values['endDate1'] = '' then
dtpEndDate1.Date := 0
else
dtpEndDate1.Date := StrToDateTime(params.Values['endDate1'], DateFormatSettings);
if params.values['null1'] <> '' then
cbNull1.Checked := StrToBool(params.Values['null1']);
// Status 2
if params.Values['filterType2'] <> '' then
wcbFilterType2.Text := params.Values['filterType2']
else
wcbFilterType2.Text := 'NONE';
if params.Values['startDate2'] = '1899/12/30' then
dtpStartDate2.Date := 0
else
dtpStartDate2.Date := StrToDateTime(params.Values['startDate2'], DateFormatSettings);
if params.Values['endDate2'] = '1899/12/30' then
dtpEndDate2.Date := 0
else
dtpEndDate2.Date := StrToDateTime(params.Values['endDate2'], DateFormatSettings);
if params.values['null2'] <> '' then
cbNull1.Checked := StrToBool(params.Values['null2']);
params.Free;
getCustomers();
end;
procedure TFSearch.btnCancelClick(Sender: TObject);
begin
Close;
end;
procedure TFSearch.btnClearClick(Sender: TObject);
begin
edtOrderID.Text := '';
edtCompanyID.Text := '';
edtSearch.Text := '';
edtJobName.Text := '';
wcbOrderType.Text := 'Any';
wcbFilterType1.Text := 'NONE';
dtpStartDate1.Date := 0;
dtpEndDate1.Date := 0;
cbNull1.Checked := False;
wcbFilterType2.Text := 'NONE';
dtpStartDate2.Date := 0;
dtpEndDate2.Date := 0;
cbNull2.Checked := false;
end;
procedure TFSearch.btnConfirmClick(Sender: TObject);
begin
confirm := true;
Close;
end;
[async] procedure TFSearch.getCustomers();
var
xdcResponse: TXDataClientResponse;
customerList: TJSObject;
begin
// Fetch data from XData service
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetCustomers', []));
customerList := TJSObject(xdcResponse.Result);
// Load data into TXDataWebDataset
xdwdsCustomers.Close;
xdwdsCustomers.SetJsonData(customerList['data']);
xdwdsCustomers.Open;
// Manually populate the grid
PopulateGridManually;
end;
procedure TFSearch.TMSFNCGrid1CellClick(Sender: TObject; ACol, ARow: Integer);
begin
edtCompanyID.Text := TMSFNCGrid1.Cells[0, ARow];
end;
procedure TFSearch.PopulateGridManually;
var
RowIndex: Integer;
begin
TMSFNCGrid1.BeginUpdate;
try
TMSFNCGrid1.Clear; // Clear any existing data
// Set up column headers
TMSFNCGrid1.ColumnCount := 4;
TMSFNCGrid1.RowCount := 1;
TMSFNCGrid1.Cells[0, 0] := 'ID';
TMSFNCGrid1.Cells[1, 0] := 'Short Name';
TMSFNCGrid1.Cells[2, 0] := 'Name';
TMSFNCGrid1.Cells[3, 0] := 'Address';
// TMSFNCGrid1.ColumnWidths[0] := 40;
// TMSFNCGrid1.ColumnWidths[1] := 80;
// TMSFNCGrid1.ColumnWidths[2] := 250;
// Populate the grid with data from the dataset
xdwdsCustomers.First;
RowIndex := 1;
while not xdwdsCustomers.EOF do
begin
TMSFNCGrid1.RowCount := RowIndex + 1;
TMSFNCGrid1.Cells[0, RowIndex] := xdwdsCustomers.FieldByName('ID').AsString;
TMSFNCGrid1.Cells[1, RowIndex] := xdwdsCustomers.FieldByName('SHORT_NAME').AsString;
TMSFNCGrid1.Cells[2, RowIndex] := xdwdsCustomers.FieldByName('NAME').AsString;
TMSFNCGrid1.Cells[3, RowIndex] := xdwdsCustomers.FieldByName('ADDRESS').AsString;
Inc(RowIndex);
xdwdsCustomers.Next;
end;
finally
TMSFNCGrid1.EndUpdate;
end;
end;
procedure TFSearch.ApplyFilter;
var
fd: TTMSFNCGridFilterData;
i: Integer;
SearchText: string;
begin
SearchText := Trim(edtSearch.Text);
TMSFNCGrid1.RemoveFilter;
TMSFNCGrid1.Filter.Clear;
// match on first 3 columns
for i := 0 to 2 do
begin
fd := TMSFNCGrid1.Filter.Add;
fd.Column := i;
fd.Condition := '*' + SearchText + '*'; // Match text anywhere in the cell
fd.CaseSensitive := False; // Make the filter case-insensitive
// Use foOR for "match any column" logic
if i > 0 then
fd.Operation := foOR
else
fd.Operation := foNONE; // First filter has no logical operation
end;
// Apply the filters to the grid
TMSFNCGrid1.ApplyFilter;
end;
end.
...@@ -14,6 +14,16 @@ input[type="text"] { ...@@ -14,6 +14,16 @@ input[type="text"] {
padding-left: 5px; padding-left: 5px;
} }
.input-search input {
width: 100px; /* Adjust the width of the input */
height: 35px; /* Set the height to match label height */
padding: 5px; /* Padding for input text */
font-size: 14px; /* Font size for input text */
border: 1px solid #ced4da; /* Border style */
border-radius: 5px; /* Rounded corners for the input */
box-sizing: border-box; /* Ensures padding and border are included in the element's total width and height */
}
.card-header { .card-header {
width: 100%; width: 100%;
text-align: left; /* Align text to the left */ text-align: left; /* Align text to the left */
......
...@@ -18,7 +18,8 @@ uses ...@@ -18,7 +18,8 @@ uses
View.EditUser in 'View.EditUser.pas' {FViewEditUser: TWebForm} {*.html}, View.EditUser in 'View.EditUser.pas' {FViewEditUser: TWebForm} {*.html},
View.Orders in 'View.Orders.pas' {FViewOrders: TWebForm} {*.html}, View.Orders in 'View.Orders.pas' {FViewOrders: TWebForm} {*.html},
View.OrderEntryCorrugated in 'View.OrderEntryCorrugated.pas' {FOrderEntry: TWebForm} {*.html}, View.OrderEntryCorrugated in 'View.OrderEntryCorrugated.pas' {FOrderEntry: TWebForm} {*.html},
View.AddOrder in 'View.AddOrder.pas' {FAddOrder: TWebForm} {*.html}; View.AddOrder in 'View.AddOrder.pas' {FAddOrder: TWebForm} {*.html},
View.Search in 'View.Search.pas' {FSearch: TWebForm} {*.html};
{$R *.res} {$R *.res}
......
...@@ -94,7 +94,6 @@ ...@@ -94,7 +94,6 @@
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode> <AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
<TMSUseJSDebugger>2</TMSUseJSDebugger> <TMSUseJSDebugger>2</TMSUseJSDebugger>
<TMSWebSingleInstance>1</TMSWebSingleInstance> <TMSWebSingleInstance>1</TMSWebSingleInstance>
<TMSWebBrowser>5</TMSWebBrowser>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''"> <PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols> <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
...@@ -176,6 +175,11 @@ ...@@ -176,6 +175,11 @@
<FormType>dfm</FormType> <FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass> <DesignClass>TWebForm</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="View.Search.pas">
<Form>FSearch</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<None Include="index.html"/> <None Include="index.html"/>
<None Include="css\app.css"/> <None Include="css\app.css"/>
<None Include="config\config.json"/> <None Include="config\config.json"/>
......
...@@ -78,6 +78,27 @@ type ...@@ -78,6 +78,27 @@ type
end; end;
TStatusSearchInfo = class
Public
startDate,
endDate,
filterType,
statusType,
statusSuffix,
statusTableShort,
statusTableLong,
altStatusTableShort,
altStatusTableLong: string;
null: boolean;
end;
TSQLQuery = class
Public
SQL,
whereSQL: string;
end;
TOrderList = class TOrderList = class
Public Public
count: integer; count: integer;
......
...@@ -20,25 +20,13 @@ uses ...@@ -20,25 +20,13 @@ uses
procedure LoadDatabaseSettings( uc: TUniConnection; iniFilename: string ); procedure LoadDatabaseSettings( uc: TUniConnection; iniFilename: string );
var var
iniFile: TIniFile; iniFile: TIniFile;
iniStr: string;
begin begin
iniFile := TIniFile.Create( ExtractFilePath(Application.ExeName) + iniFilename ); iniFile := TIniFile.Create( ExtractFilePath(Application.ExeName) + iniFilename );
try try
iniStr := iniFile.ReadString('Database', 'Server', ''); uc.Server := iniFile.ReadString('Database', 'Server', uc.Server);
if not iniStr.IsEmpty then uc.Database := iniFile.ReadString('Database', 'Database', uc.Database);
uc.Server := iniStr; uc.Username := iniFile.ReadString('Database', 'Username', uc.Username);
uc.Password := iniFile.ReadString('Database', 'Password', uc.Password);
iniStr := iniFile.ReadString('Database', 'Database', '');
if not iniStr.IsEmpty then
uc.Database := iniStr;
iniStr := iniFile.ReadString('Database', 'Username', '');
if not iniStr.IsEmpty then
uc.Username := iniStr;
iniStr := iniFile.ReadString('Database', 'Password', '');
if not iniStr.IsEmpty then
uc.Password := iniStr;
finally finally
iniFile.Free; iniFile.Free;
end; end;
......
[Settings] [Settings]
MemoLogLevel=5 MemoLogLevel=4
FileLogLevel=5 FileLogLevel=5
LogFileNum=34 LogFileNum=34
webClientVersion=1.0.0 webClientVersion=1.0.0
[Database] [Database]
--Server=192.168.159.132 Server=192.168.159.132
Server=192.168.60.129 --Server=192.168.60.129
--Server=192.168.75.133 --Server=192.168.75.133
--Database= --Database=
--Username= --Username=
Password=emsys!012 --Password=emsys!012
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