Commit 5ee48b91 by emsys

Merge remote-tracking branch 'origin/mac3' into mac3

parents dd3cf055 cc8b2b36
object FViewAddCustomer: TFViewAddCustomer object FViewAddCustomer: TFViewAddCustomer
Width = 842 Width = 842
Height = 607 Height = 607
OnShow = WebFormShow CSSLibrary = cssBootstrap
ElementFont = efCSS
object lblFormState: TWebLabel
Left = 18
Top = 16
Width = 3
Height = 15
ElementID = 'lbl_form_state'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object dtpStartDate: TWebDateTimePicker object dtpStartDate: TWebDateTimePicker
Left = 19 Left = 19
Top = 216 Top = 216
...@@ -236,7 +246,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -236,7 +246,7 @@ object FViewAddCustomer: TFViewAddCustomer
BorderColor = clSilver BorderColor = clSilver
ChildOrder = 11 ChildOrder = 11
ElementFont = efCSS ElementFont = efCSS
ElementHeaderClassName = 'thead-light sticky-top bg-light' ElementHeaderClassName = 'thead-light sticky-top bg-light border-light'
ElementPosition = epRelative ElementPosition = epRelative
ElementTableClassName = 'table table-striped table-hover table-bordered text-sm' ElementTableClassName = 'table table-striped table-hover table-bordered text-sm'
Footer.ButtonActiveElementClassName = 'btn btn-primary' Footer.ButtonActiveElementClassName = 'btn btn-primary'
...@@ -313,6 +323,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -313,6 +323,7 @@ object FViewAddCustomer: TFViewAddCustomer
Width = 121 Width = 121
Height = 22 Height = 22
ChildOrder = 22 ChildOrder = 22
EditType = weNumeric
ElementID = 'edtshippingzip' ElementID = 'edtshippingzip'
Enabled = False Enabled = False
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
...@@ -432,18 +443,6 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -432,18 +443,6 @@ object FViewAddCustomer: TFViewAddCustomer
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnShipAddClick OnClick = btnShipAddClick
end end
object btn_confirm_delete: TWebButton
Left = 725
Top = 433
Width = 96
Height = 25
Caption = 'Delete'
ChildOrder = 82
ElementID = 'btn_confirm_delete'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btn_confirm_deleteClick
end
object edtFirstLine: TWebEdit object edtFirstLine: TWebEdit
Left = 190 Left = 190
Top = 430 Top = 430
...@@ -475,12 +474,12 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -475,12 +474,12 @@ object FViewAddCustomer: TFViewAddCustomer
Top = 72 Top = 72
end end
object WebDataSource1: TWebDataSource object WebDataSource1: TWebDataSource
AutoEdit = False
DataSet = XDataWebDataSet1 DataSet = XDataWebDataSet1
Left = 532 Left = 532
Top = 126 Top = 126
end end
object XDataWebDataSet1: TXDataWebDataSet object XDataWebDataSet1: TXDataWebDataSet
AfterEdit = XDataWebDataSet1AfterEdit
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 426 Left = 426
Top = 132 Top = 132
...@@ -528,12 +527,12 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -528,12 +527,12 @@ object FViewAddCustomer: TFViewAddCustomer
end end
end end
object wdsShipTo: TWebDataSource object wdsShipTo: TWebDataSource
AutoEdit = False
DataSet = xdwdsShipTo DataSet = xdwdsShipTo
Left = 698 Left = 698
Top = 128 Top = 128
end end
object xdwdsShipTo: TXDataWebDataSet object xdwdsShipTo: TXDataWebDataSet
AfterEdit = xdwdsShipToAfterEdit
Left = 698 Left = 698
Top = 44 Top = 44
object xdwdsShipToADDRESS: TStringField object xdwdsShipToADDRESS: TStringField
...@@ -565,6 +564,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -565,6 +564,7 @@ object FViewAddCustomer: TFViewAddCustomer
Top = 42 Top = 42
end end
object wdsUsers: TWebDataSource object wdsUsers: TWebDataSource
AutoEdit = False
DataSet = xdwdsUsers DataSet = xdwdsUsers
Left = 776 Left = 776
Top = 144 Top = 144
......
...@@ -3,7 +3,7 @@ unit Utils; ...@@ -3,7 +3,7 @@ unit Utils;
interface interface
uses uses
System.Classes, SysUtils, JS, Web, WEBLib.Forms, WEBLib.Toast, DateUtils; System.Classes, SysUtils, JS, Web, WEBLib.Forms, WEBLib.Toast, DateUtils, WebLib.Dialogs;
procedure ShowStatusMessage(const AMessage, AClass: string; const AElementId: string); procedure ShowStatusMessage(const AMessage, AClass: string; const AElementId: string);
procedure HideStatusMessage(const AElementId: string); procedure HideStatusMessage(const AElementId: string);
...@@ -14,6 +14,7 @@ function CalculateAge(DateOfBirth: TDateTime): Integer; ...@@ -14,6 +14,7 @@ function CalculateAge(DateOfBirth: TDateTime): Integer;
function FormatPhoneNumber(PhoneNumber: string): string; function FormatPhoneNumber(PhoneNumber: string): string;
procedure ApplyReportTitle(CurrentReportType: string); procedure ApplyReportTitle(CurrentReportType: string);
procedure ShowToast(const MessageText: string; const ToastType: string = 'success'); procedure ShowToast(const MessageText: string; const ToastType: string = 'success');
procedure ShowConfirmationModal(msg, leftLabel, rightLabel: string; ConfirmProc: TProc<Boolean>);
// function FormatDollarValue(ValueStr: string): string; // function FormatDollarValue(ValueStr: string): string;
...@@ -67,6 +68,13 @@ begin ...@@ -67,6 +68,13 @@ begin
SpinnerElement := TJSHTMLElement(document.getElementById(SpinnerID)); SpinnerElement := TJSHTMLElement(document.getElementById(SpinnerID));
if Assigned(SpinnerElement) then if Assigned(SpinnerElement) then
begin begin
// Move spinner to the <body> if it's not already there
asm
if (SpinnerElement.parentNode !== document.body) {
document.body.appendChild(SpinnerElement);
}
end;
SpinnerElement.classList.remove('d-none'); SpinnerElement.classList.remove('d-none');
SpinnerElement.classList.add('d-block'); SpinnerElement.classList.add('d-block');
end; end;
...@@ -84,7 +92,7 @@ begin ...@@ -84,7 +92,7 @@ begin
end; end;
end; end;
// The $IFNDEF WIN32 was recommended by Holger to deal with any modal issues
procedure ShowErrorModal(msg: string); procedure ShowErrorModal(msg: string);
begin begin
asm asm
...@@ -113,6 +121,58 @@ begin ...@@ -113,6 +121,58 @@ begin
end; end;
// ShowConfirmationModal displays a two-button modal with custom labels.
// Params:
// - messageText: text shown in the modal body
// - leftButtonText: label for the left button (e.g., "Cancel")
// - rightButtonText: label for the right button (e.g., "Delete")
// - callback: procedure(confirmed: Boolean); confirmed = True if right button clicked
//
// Example:
// ShowConfirmationModal('Delete this?', 'Cancel', 'Delete',
// procedure(confirmed: Boolean)
// begin
// if confirmed then DeleteOrder();
// end);
procedure ShowConfirmationModal(msg, leftLabel, rightLabel: string; ConfirmProc: TProc<Boolean>);
var
modal, body, btnLeft, btnRight: TJSHTMLElement;
bsModal: JSValue;
begin
asm
modal = document.getElementById('main_confirmation_modal');
body = document.getElementById('main_modal_body');
btnLeft = document.getElementById('btn_confirm_left');
btnRight = document.getElementById('btn_confirm_right');
if (body) body.innerText = msg;
if (btnLeft) btnLeft.innerText = leftLabel;
if (btnRight) btnRight.innerText = rightLabel;
if (modal && modal.parentNode !== document.body) {
document.body.appendChild(modal);
}
btnLeft.onclick = null;
btnRight.onclick = null;
btnLeft.onclick = function () {
bsModal.hide();
ConfirmProc(true); // user confirmed
};
btnRight.onclick = function () {
bsModal.hide();
ConfirmProc(false); // user canceled
};
bsModal = new bootstrap.Modal(modal, { keyboard: false });
bsModal.show();
end;
end;
function CalculateAge(DateOfBirth: TDateTime): Integer; function CalculateAge(DateOfBirth: TDateTime): Integer;
var var
Today, BirthDate: TJSDate; Today, BirthDate: TJSDate;
......
object FViewCustomers: TFViewCustomers object FViewCustomers: TFViewCustomers
Width = 640 Width = 640
Height = 480 Height = 480
CSSLibrary = cssBootstrap
ElementFont = efCSS
OnCreate = WebFormCreate OnCreate = WebFormCreate
object lblEntries: TWebLabel object lblEntries: TWebLabel
Left = 12 Left = 12
......
...@@ -157,6 +157,12 @@ object FViewMain: TFViewMain ...@@ -157,6 +157,12 @@ object FViewMain: TFViewMain
ChildOrder = 3 ChildOrder = 3
ElementFont = efCSS ElementFont = efCSS
ElementPosition = epIgnore ElementPosition = epIgnore
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
Role = 'null' Role = 'null'
TabOrder = 0 TabOrder = 0
end end
...@@ -167,12 +173,14 @@ object FViewMain: TFViewMain ...@@ -167,12 +173,14 @@ object FViewMain: TFViewMain
Height = 83 Height = 83
ElementID = 'main.debugmemo' ElementID = 'main.debugmemo'
ElementPosition = epRelative ElementPosition = epRelative
Enabled = False
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
Lines.Strings = ( Lines.Strings = (
'WebMemo1') 'WebMemo1')
Role = 'null' Role = 'null'
SelLength = 0 SelLength = 0
SelStart = 0 SelStart = 0
ShowFocus = False
Visible = False Visible = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
......
...@@ -95,25 +95,25 @@ ...@@ -95,25 +95,25 @@
Please contact EMSystems to solve the issue. Please contact EMSystems to solve the issue.
</div> </div>
<div class="modal-footer justify-content-center"> <div class="modal-footer justify-content-center">
<button type="button" id="btn_modal_restart" class="btn btn-primary">Restart WebApp</button> <button type="button" id="btn_modal_restart" class="btn btn-primary">Back to Orders</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="confirmation_modal" tabindex="-1" aria-labelledby="confirmation_modal_label" aria-hidden="true"> <div class="modal fade" id="main_confirmation_modal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content shadow-lg"> <div class="modal-content shadow-lg">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="confirmation_modal_label">Confirm</h5> <h5 class="modal-title">Confirm</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body fs-6 fw-bold" id="modal_body"> <div class="modal-body fw-bold" id="main_modal_body">
Are you sure you want to delete this order? Placeholder text
</div> </div>
<div class="modal-footer justify-content-center"> <div class="modal-footer justify-content-center">
<button type="button" class="btn btn-secondary me-3" data-bs-dismiss="modal" id="btn_confirm_cancel">Cancel</button> <button type="button" class="btn btn-primary me-3" id="btn_confirm_left">Cancel</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" id="btn_confirm_delete">Delete</button> <button type="button" class="btn btn-secondary" id="btn_confirm_right">Confirm</button>
</div> </div>
</div> </div>
</div> </div>
...@@ -127,3 +127,4 @@ ...@@ -127,3 +127,4 @@
...@@ -47,7 +47,6 @@ type ...@@ -47,7 +47,6 @@ type
function GetUserInfo: string; function GetUserInfo: string;
procedure setActive(page: string); procedure setActive(page: string);
procedure ConfirmLogout; procedure ConfirmLogout;
procedure OnConfirmLogout(Event: TJSEvent);
public public
{ Public declarations } { Public declarations }
class procedure Display(LogoutProc: TLogoutProc); class procedure Display(LogoutProc: TLogoutProc);
...@@ -118,7 +117,7 @@ begin ...@@ -118,7 +117,7 @@ begin
setActive('Customers'); setActive('Customers');
end end
else else
ShowErrorModal('Please Save or Cancel your changes'); ShowToast('Please Save or Cancel your changes', 'danger');
end; end;
procedure TFViewMain.lblHomeClick(Sender: TObject); procedure TFViewMain.lblHomeClick(Sender: TObject);
...@@ -130,12 +129,11 @@ begin ...@@ -130,12 +129,11 @@ begin
//setActive('Home'); //setActive('Home');
end end
else else
ShowErrorModal('Please Save or Cancel your changes'); ShowToast('Please Save or Cancel your changes', 'danger');
end; end;
procedure TFViewMain.lblordersClick(Sender: TObject); procedure TFViewMain.lblordersClick(Sender: TObject);
begin begin
console.log(change);
if ( not ( change ) ) then if ( not ( change ) ) then
begin begin
ShowForm(TFViewOrders); ShowForm(TFViewOrders);
...@@ -143,7 +141,7 @@ begin ...@@ -143,7 +141,7 @@ begin
setActive('Orders'); setActive('Orders');
end end
else else
ShowErrorModal('Please Save or Cancel your changes'); ShowToast('Please Save or Cancel your changes', 'danger');
end; end;
procedure TFViewMain.lblQuickbooksClick(Sender: TObject); procedure TFViewMain.lblQuickbooksClick(Sender: TObject);
...@@ -155,7 +153,7 @@ begin ...@@ -155,7 +153,7 @@ begin
setActive('QuickBooks'); setActive('QuickBooks');
end end
else else
ShowErrorModal('Please Save or Cancel your changes'); ShowToast('Please Save or Cancel your changes', 'danger');
end; end;
procedure TFViewMain.lblUsersClick(Sender: TObject); procedure TFViewMain.lblUsersClick(Sender: TObject);
...@@ -166,7 +164,7 @@ begin ...@@ -166,7 +164,7 @@ begin
lblAppTitle.Caption := 'Koehler-Gibson Users'; lblAppTitle.Caption := 'Koehler-Gibson Users';
end end
else else
ShowErrorModal('Please Save or Cancel your changes'); ShowToast('Please Save or Cancel your changes', 'danger');
end; end;
procedure TFViewMain.lblItemsListClick(Sender: TObject); procedure TFViewMain.lblItemsListClick(Sender: TObject);
...@@ -178,7 +176,7 @@ begin ...@@ -178,7 +176,7 @@ begin
setActive('Items'); setActive('Items');
end end
else else
ShowErrorModal('Please Save or Cancel your changes'); ShowToast('Please Save or Cancel your changes', 'danger');
end; end;
procedure TFViewMain.setActive(page: string); procedure TFViewMain.setActive(page: string);
...@@ -210,47 +208,22 @@ begin ...@@ -210,47 +208,22 @@ begin
ConfirmLogout; ConfirmLogout;
end; end;
procedure TFViewMain.ConfirmLogout;
var
yesBtn: TJSElement;
begin
document.getElementById('modal_body').innerHTML := 'Are you sure you want to log out?';
document.getElementById('btn_confirm_cancel').innerText := 'No';
document.getElementById('btn_confirm_delete').innerText := 'Yes';
asm
var modal = document.getElementById('confirmation_modal');
if (modal && modal.parentNode !== document.body) {
document.body.appendChild(modal);
}
end;
// Detach any existing click handler (optional cleanup if reused often)
yesBtn := document.getElementById('btn_confirm_delete');
if Assigned(yesBtn) then
begin
TJSElement(yesBtn).removeEventListener('click', @OnConfirmLogout);
TJSElement(yesBtn).addEventListener('click', @OnConfirmLogout);
end;
asm procedure TFViewMain.ConfirmLogout;
var confirmationModal = new bootstrap.Modal(document.getElementById('confirmation_modal'), {
keyboard: false
});
confirmationModal.show();
end;
end;
procedure TFViewMain.OnConfirmLogout(Event: TJSEvent);
begin begin
if Assigned(FLogoutProc) then ShowConfirmationModal(
FLogoutProc(''); 'Are you sure you want to log out?',
'Yes',
'No',
procedure(confirmed: Boolean)
begin
if confirmed and Assigned(FLogoutProc) then
FLogoutProc('');
end
);
end; end;
procedure TFViewMain.wllblUserProfileClick(Sender: TObject); procedure TFViewMain.wllblUserProfileClick(Sender: TObject);
begin begin
ShowCrudForm(TFViewUserProfile); ShowCrudForm(TFViewUserProfile);
......
<nav class="navbar navbar-expand navbar-light bg-light border-light sticky-top" style="z-index: 100;">
<div class="container-fluid d-flex align-items-center ps-0 pe-0">
<nav class="navbar navbar-expand navbar-light bg-light border-light sticky-top" style="z-index: 100;"> <!-- Left-aligned label -->
<div class="container-fluid ps-0"> <div class="me-auto ps-3">
<ul class="navbar-nav me-auto ps-2"> <label id="lbl_form_state" class="form-label mb-0 fw-bold text-uppercase text-nowrap text-danger" style="font-size: 16px;">Test</label>
<li class="nav-item pe-2">
<button id="btnadd" class="btn btn-primary btn-sm">Add</button>
</li>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btncopy" class="btn btn-primary btn-sm">Copy</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
<li class="nav-item">
<button id="btnclose" class="btn btn-primary btn-sm">Close</button>
</li>
</ul>
</div> </div>
<!-- Right-aligned buttons -->
<ul class="navbar-nav ms-auto pe-2 mb-0">
<li class="nav-item pe-2">
<button id="btnadd" class="btn btn-primary btn-sm">Add</button>
</li>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btncopy" class="btn btn-primary btn-sm">Copy</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
<li class="nav-item">
<button id="btnclose" class="btn btn-primary btn-sm">Close</button>
</li>
</ul>
</div>
</nav> </nav>
<div class="row mx-5"> <div class="row mx-5">
<div class="col-12 col-md-8"> <div class="col-12 col-md-8">
...@@ -357,23 +364,4 @@ ...@@ -357,23 +364,4 @@
<textarea id="edtspecialinstructions" class="form-control" style=" width: 500px; height: 150px;"></textarea> <textarea id="edtspecialinstructions" class="form-control" style=" width: 500px; height: 150px;"></textarea>
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="confirmation_modal" tabindex="-1" aria-labelledby="confirmation_modal_label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content shadow-lg">
<div class="modal-header">
<h5 class="modal-title" id="confirmation_modal_label">Confirm</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body fs-6 fw-bold" id="modal_body">
Are you sure you want to delete this order?
</div>
<div class="modal-footer justify-content-center">
<button type="button" class="btn btn-secondary me-3" data-bs-dismiss="modal" id="btn_confirm_cancel">Cancel</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" id="btn_confirm_delete">Delete</button>
</div>
</div>
</div>
</div>
object FOrderEntryCuttingDie: TFOrderEntryCuttingDie object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
Width = 956 Width = 956
Height = 728 Height = 728
OnShow = WebFormShow
object WebLabel2: TWebLabel object WebLabel2: TWebLabel
Left = 26 Left = 26
Top = 72 Top = 72
...@@ -32,6 +31,15 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -32,6 +31,15 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
Visible = False Visible = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblFormState: TWebLabel
Left = 34
Top = 8
Width = 3
Height = 15
ElementID = 'lbl_form_state'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtCompanyAccountName: TWebDBEdit object edtCompanyAccountName: TWebDBEdit
Left = 24 Left = 24
Top = 120 Top = 120
...@@ -42,21 +50,20 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -42,21 +50,20 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ElementID = 'edtaccountcompanyname' ElementID = 'edtaccountcompanyname'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = dtpOrderDateChange
DataField = 'SHORT_NAME' DataField = 'SHORT_NAME'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
object edtInQuickBooks: TWebDBEdit object edtInQuickBooks: TWebDBEdit
Left = 26 Left = 24
Top = 148 Top = 152
Width = 121 Width = 121
Height = 23 Height = 23
AutoCompletion = acNope
AutoSize = True AutoSize = True
ChildOrder = 79 ChildOrder = 79
ElementID = 'edtinquickbooks' ElementID = 'edtinquickbooks'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = dtpOrderDateChange
DataField = 'inQuickBooks' DataField = 'inQuickBooks'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
...@@ -72,7 +79,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -72,7 +79,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
Date = 45638.529943136570000000 Date = 45638.529943136570000000
Role = '' Role = ''
Text = '' Text = ''
OnChange = dtpOrderDateChange
end end
object dtpProofDate: TWebDateTimePicker object dtpProofDate: TWebDateTimePicker
Left = 22 Left = 22
...@@ -86,7 +92,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -86,7 +92,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
Date = 45638.529943136570000000 Date = 45638.529943136570000000
Role = '' Role = ''
Text = '' Text = ''
OnChange = dtpOrderDateChange
end end
object dtpShipDate: TWebDateTimePicker object dtpShipDate: TWebDateTimePicker
Left = 22 Left = 22
...@@ -100,7 +105,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -100,7 +105,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
Date = 45638.529943136570000000 Date = 45638.529943136570000000
Role = '' Role = ''
Text = '' Text = ''
OnChange = dtpOrderDateChange
end end
object edtShipVia: TWebDBEdit object edtShipVia: TWebDBEdit
Left = 24 Left = 24
...@@ -112,7 +116,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -112,7 +116,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ElementID = 'edtshipvia' ElementID = 'edtshipvia'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = dtpOrderDateChange
DataField = 'staff_fields_ship_via' DataField = 'staff_fields_ship_via'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
...@@ -123,10 +126,10 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -123,10 +126,10 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
Height = 23 Height = 23
AutoSize = True AutoSize = True
ChildOrder = 79 ChildOrder = 79
EditType = weNumeric
ElementID = 'edtquantity' ElementID = 'edtquantity'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = dtpOrderDateChange
DataField = 'staff_fields_quantity' DataField = 'staff_fields_quantity'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
...@@ -139,7 +142,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -139,7 +142,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ElementID = 'edtprice' ElementID = 'edtprice'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = dtpOrderDateChange
DataField = 'staff_fields_price' DataField = 'staff_fields_price'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
...@@ -153,7 +155,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -153,7 +155,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ElementID = 'edtinvoiceto' ElementID = 'edtinvoiceto'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = dtpOrderDateChange
DataField = 'staff_fields_invoice_to' DataField = 'staff_fields_invoice_to'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
...@@ -181,7 +182,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -181,7 +182,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ElementID = 'edtponumber' ElementID = 'edtponumber'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = dtpOrderDateChange
DataField = 'staff_fields_po_number' DataField = 'staff_fields_po_number'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
...@@ -195,7 +195,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -195,7 +195,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ElementID = 'edtjobname' ElementID = 'edtjobname'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = dtpOrderDateChange
DataField = 'staff_fields_job_name' DataField = 'staff_fields_job_name'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
...@@ -209,7 +208,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -209,7 +208,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ElementID = 'edtspecialinstructions' ElementID = 'edtspecialinstructions'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = dtpOrderDateChange
DataField = 'general_special_instructions' DataField = 'general_special_instructions'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
...@@ -246,7 +244,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -246,7 +244,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ElementID = 'edtcompanyname' ElementID = 'edtcompanyname'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = dtpOrderDateChange
DataField = 'NAME' DataField = 'NAME'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
...@@ -258,7 +255,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -258,7 +255,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ElementID = 'wcbqbitem' ElementID = 'wcbqbitem'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = dtpOrderDateChange
ItemIndex = -1 ItemIndex = -1
DataField = 'staff_fields_quickbooks_item' DataField = 'staff_fields_quickbooks_item'
DataSource = WebDataSource1 DataSource = WebDataSource1
...@@ -312,18 +308,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -312,18 +308,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnCloseClick OnClick = btnCloseClick
end end
object btn_confirm_delete: TWebButton
Left = 776
Top = 279
Width = 96
Height = 25
Caption = 'Delete'
ChildOrder = 82
ElementID = 'btn_confirm_delete'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btn_confirm_deleteClick
end
object btnCopy: TWebButton object btnCopy: TWebButton
Left = 746 Left = 746
Top = 453 Top = 453
...@@ -373,15 +357,15 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -373,15 +357,15 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
OnClick = WebButton2Click OnClick = WebButton2Click
end end
object WebDataSource1: TWebDataSource object WebDataSource1: TWebDataSource
AutoEdit = False
DataSet = XDataWebDataSet1 DataSet = XDataWebDataSet1
OnDataChange = WebDataSource1DataChange Left = 418
Left = 318 Top = 86
Top = 262
end end
object XDataWebDataSet1: TXDataWebDataSet object XDataWebDataSet1: TXDataWebDataSet
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 318 Left = 422
Top = 208 Top = 28
object XDataWebDataSet1COMPANY_ID: TIntegerField object XDataWebDataSet1COMPANY_ID: TIntegerField
FieldName = 'COMPANY_ID' FieldName = 'COMPANY_ID'
end end
...@@ -442,40 +426,35 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -442,40 +426,35 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
object XDataWebDataSet1staff_fields_quantity: TStringField object XDataWebDataSet1staff_fields_quantity: TStringField
FieldName = 'staff_fields_quantity' FieldName = 'staff_fields_quantity'
end end
object XDataWebDataSet1inQuickBooks: TStringField
FieldName = 'inQuickBooks'
end
end end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
Left = 218 Left = 200
Top = 76 Top = 50
end
object tmrScrollTop: TWebTimer
Interval = 100
OnTimer = tmrScrollTopTimer
Left = 240
Top = 8
end end
object wdsShipTo: TWebDataSource object wdsShipTo: TWebDataSource
DataSet = xdwdsShipTo DataSet = xdwdsShipTo
Left = 302 Left = 526
Top = 418 Top = 86
end end
object xdwdsShipTo: TXDataWebDataSet object xdwdsShipTo: TXDataWebDataSet
AfterEdit = xdwdsShipToAfterEdit Left = 528
Left = 438 Top = 26
Top = 208
object xdwdsShipToADDRESS: TStringField object xdwdsShipToADDRESS: TStringField
FieldName = 'ADDRESS' FieldName = 'ADDRESS'
end end
end end
object wdsQBItem: TWebDataSource object wdsQBItem: TWebDataSource
DataSet = xdwdsQBItem DataSet = xdwdsQBItem
Left = 272 Left = 606
Top = 548 Top = 86
end end
object xdwdsQBItem: TXDataWebDataSet object xdwdsQBItem: TXDataWebDataSet
AfterEdit = xdwdsQBItemAfterEdit Left = 608
Left = 568 Top = 30
Top = 216
object xdwdsQBItemname: TStringField object xdwdsQBItemname: TStringField
FieldName = 'name' FieldName = 'name'
end end
......
<nav class="navbar navbar-expand navbar-light bg-light sticky-top" style="z-index: 100;"> <nav class="navbar navbar-expand navbar-light bg-light border-light sticky-top" style="z-index: 100;">
<div class="container-fluid ps-0"> <div class="container-fluid d-flex align-items-center ps-0 pe-0">
<ul class="navbar-nav me-auto ps-2">
<li class="nav-item pe-2"> <!-- Left-aligned label -->
<button id="btnadd" class="btn btn-primary btn-sm">Add</button> <div class="me-auto ps-3">
</li> <label id="lbl_form_state" class="form-label mb-0 fw-bold text-uppercase text-nowrap text-danger" style="font-size: 16px;">View Mode</label>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btncopy" class="btn btn-primary btn-sm">Copy</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<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>
</li>
</ul>
</div> </div>
<!-- Right-aligned buttons -->
<ul class="navbar-nav ms-auto pe-2 mb-0">
<li class="nav-item pe-2">
<button id="btnadd" class="btn btn-primary btn-sm">Add</button>
</li>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btncopy" class="btn btn-primary btn-sm">Copy</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
<li class="nav-item">
<button id="btnclose" class="btn btn-primary btn-sm">Close</button>
</li>
</ul>
</div>
</nav> </nav>
<div class="row mx-5"> <div class="row mx-5">
<h4 class="custom-h4 mt-3">Customer</h4> <h4 class="custom-h4 mt-3">Customer</h4>
...@@ -124,20 +132,4 @@ ...@@ -124,20 +132,4 @@
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="confirmation_modal" tabindex="-1" aria-labelledby="confirmation_modal_label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content shadow-lg">
<div class="modal-header">
<h5 class="modal-title" id="confirmation_modal_label">Confirm</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body fs-6 fw-bold" id="modal_body">
Are you sure you want to delete this order?
</div>
<div class="modal-footer justify-content-center">
<button type="button" class="btn btn-secondary me-3" data-bs-dismiss="modal" id="btn_confirm_cancel">Cancel</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" id="btn_confirm_delete">Delete</button>
</div>
</div>
</div>
</div>
<nav class="navbar navbar-expand navbar-light bg-light sticky-top" style="z-index: 100;"> <nav class="navbar navbar-expand navbar-light bg-light border-light sticky-top" style="z-index: 100;">
<div class="container-fluid ps-0"> <div class="container-fluid d-flex align-items-center ps-0 pe-0">
<ul class="navbar-nav me-auto ps-2">
<li class="nav-item pe-2"> <!-- Left-aligned label -->
<button id="btnadd" class="btn btn-primary btn-sm">Add</button> <div class="me-auto ps-3">
</li> <label id="lbl_form_state" class="form-label mb-0 fw-bold text-uppercase text-nowrap text-danger" style="font-size: 16px;">Test</label>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btncopy" class="btn btn-primary btn-sm">Copy</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<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>
</li>
</ul>
</div> </div>
<!-- Right-aligned buttons -->
<ul class="navbar-nav ms-auto pe-2 mb-0">
<li class="nav-item pe-2">
<button id="btnadd" class="btn btn-primary btn-sm">Add</button>
</li>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btncopy" class="btn btn-primary btn-sm">Copy</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnpdf" class="btn btn-primary btn-sm">PDF</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
<li class="nav-item">
<button id="btnclose" class="btn btn-primary btn-sm">Close</button>
</li>
</ul>
</div>
</nav> </nav>
<div class="row mx-5"> <div class="row mx-5">
<h4 class="custom-h4 mt-3">Customer</h4> <h4 class="custom-h4 mt-3">Customer</h4>
...@@ -418,20 +426,4 @@ ...@@ -418,20 +426,4 @@
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="confirmation_modal" tabindex="-1" aria-labelledby="confirmation_modal_label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content shadow-lg">
<div class="modal-header">
<h5 class="modal-title" id="confirmation_modal_label">Confirm</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body fs-6 fw-bold" id="modal_body">
Are you sure you want to delete this order?
</div>
<div class="modal-footer justify-content-center">
<button type="button" class="btn btn-secondary me-3" data-bs-dismiss="modal" id="btn_confirm_cancel">Cancel</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" id="btn_confirm_delete">Delete</button>
</div>
</div>
</div>
</div>
...@@ -16,7 +16,6 @@ type ...@@ -16,7 +16,6 @@ type
edtCompanyAccountName: TWebDBEdit; edtCompanyAccountName: TWebDBEdit;
edtInQuickBooks: TWebDBEdit; edtInQuickBooks: TWebDBEdit;
XDataWebClient1: TXDataWebClient; XDataWebClient1: TXDataWebClient;
tmrScrollTop: TWebTimer;
XDataWebDataSet1: TXDataWebDataSet; XDataWebDataSet1: TXDataWebDataSet;
XDataWebDataSet1ORDER_ID: TIntegerField; XDataWebDataSet1ORDER_ID: TIntegerField;
XDataWebDataSet1COMPANY_ID: TIntegerField; XDataWebDataSet1COMPANY_ID: TIntegerField;
...@@ -199,16 +198,14 @@ type ...@@ -199,16 +198,14 @@ type
btnDelete: TWebButton; btnDelete: TWebButton;
btnClose: TWebButton; btnClose: TWebButton;
edtOrderNum: TWebEdit; edtOrderNum: TWebEdit;
btn_confirm_delete: TWebButton;
tmrReturn: TWebTimer; tmrReturn: TWebTimer;
btnEdit: TWebButton; btnEdit: TWebButton;
btnAdd: TWebButton; btnAdd: TWebButton;
WebButton2: TWebButton; WebButton2: TWebButton;
lblFormState: TWebLabel;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
procedure WebFormShow(Sender: TObject);
[async] procedure getOrder(Order_ID: string); [async] procedure getOrder(Order_ID: string);
[async] procedure getCustomer(customerID: string); [async] procedure getCustomer(customerID: string);
procedure tmrScrollTopTimer(Sender: TObject);
procedure WebButton1Click(Sender: TObject); procedure WebButton1Click(Sender: TObject);
procedure addColorRow(num, Color, LPI, Size: string); procedure addColorRow(num, Color, LPI, Size: string);
procedure btnSaveClick(Sender: TObject); procedure btnSaveClick(Sender: TObject);
...@@ -222,13 +219,10 @@ type ...@@ -222,13 +219,10 @@ type
procedure btnDeleteClick(Sender: TObject); procedure btnDeleteClick(Sender: TObject);
[async] procedure DelOrder; [async] procedure DelOrder;
procedure tmrReturnTimer(Sender: TObject); procedure tmrReturnTimer(Sender: TObject);
procedure btn_confirm_deleteClick(Sender: TObject);
function VerifyOrder(): boolean; function VerifyOrder(): boolean;
procedure btnAddClick(Sender: TObject); procedure btnAddClick(Sender: TObject);
procedure btnEditClick(Sender: TObject); procedure btnEditClick(Sender: TObject);
procedure EditMode(); procedure EditMode();
procedure XDataWebDataSet1AfterEdit(DataSet: TDataSet);
procedure dtpOrderDateChange(Sender: TObject);
procedure ViewMode(); procedure ViewMode();
procedure WebButton2Click(Sender: TObject); procedure WebButton2Click(Sender: TObject);
procedure ShowAddAddressForm(); procedure ShowAddAddressForm();
...@@ -243,9 +237,10 @@ type ...@@ -243,9 +237,10 @@ type
mode: string; mode: string;
notification: string; notification: string;
procedure RemoveColorRow(Sender: TObject); procedure RemoveColorRow(Sender: TObject);
[async] procedure InitializeForm;
//FJSONProc1: TJSONProc1; //FJSONProc1: TJSONProc1;
public public
class function CreateForm(AElementID, orderInfo, customerInfo, mode, info: string): TWebForm; class function CreateForm(AElementID, orderInfo, customerInfo, modeParam, info: string): TWebForm;
end; end;
var var
...@@ -258,6 +253,46 @@ implementation ...@@ -258,6 +253,46 @@ implementation
uses uses
View.Home, View.Main, View.AddOrder, View.AddAddress, Utils; View.Home, View.Main, View.AddOrder, View.AddAddress, Utils;
class function TFOrderEntryWeb.CreateForm(AElementID, orderInfo, customerInfo, modeParam, info: string): TWebForm;
begin
Application.CreateForm(TFOrderEntryWeb, AElementID, Result,
procedure(AForm: TObject)
begin
with TFOrderEntryWeb(AForm) do
begin
customerID := customerInfo;
orderID := orderInfo;
mode := modeParam;
notification := info;
console.log('Mode in createform: ' + modeParam);
InitializeForm;
end;
end
);
end;
[async] procedure TFOrderEntryWeb.InitializeForm;
begin
if mode = 'ADD' then
begin
await(getCustomer(customerID));
EditMode;
end
else
begin
await(getOrder(orderID));
ViewMode;
end;
edtOrderNum.Text := orderID;
if notification <> '' then
ShowToast(notification);
end;
procedure TFOrderEntryWeb.WebButton2Click(Sender: TObject); procedure TFOrderEntryWeb.WebButton2Click(Sender: TObject);
begin begin
ShowAddAddressForm(); ShowAddAddressForm();
...@@ -413,21 +448,23 @@ begin ...@@ -413,21 +448,23 @@ begin
window.scrollTo(0, 0); window.scrollTo(0, 0);
end; end;
procedure TFOrderEntryWeb.btnDeleteClick(Sender: TObject); procedure TFOrderEntryWeb.btnDeleteClick(Sender: TObject);
begin begin
FModalAction := 'delete'; ShowConfirmationModal(
document.getElementById('modal_body').innerHTML := 'Are you sure you want to delete this order?'; 'Are you sure you want to delete this order?',
document.getElementById('btn_confirm_cancel').innerText := 'Cancel'; 'Delete',
document.getElementById('btn_confirm_delete').innerText := 'Delete'; 'Cancel',
procedure(confirmed: Boolean)
asm begin
var modal = document.getElementById('confirmation_modal'); if confirmed then
if (modal && modal.parentNode !== document.body) { begin
document.body.appendChild(modal); Utils.ShowSpinner('spinner');
} DelOrder();
var confirmationModal = new bootstrap.Modal(modal, { keyboard: false }); tmrReturn.Enabled := true;
confirmationModal.show(); end;
end; end
);
end; end;
procedure TFOrderEntryWeb.btnEditClick(Sender: TObject); procedure TFOrderEntryWeb.btnEditClick(Sender: TObject);
...@@ -435,30 +472,12 @@ begin ...@@ -435,30 +472,12 @@ begin
EditMode(); EditMode();
end; end;
procedure TFOrderEntryWeb.EditMode;
begin
FViewMain.change := true;
btnCopy.Enabled := false;
btnPDF.Enabled := false;
btnDelete.Enabled := false;
btnClose.Enabled := false;
btnSave.Enabled := true;
btnCancel.Enabled := True;
btnEdit.Enabled := false;
btnAdd.Enabled := false;
end;
[async] procedure TFOrderEntryWeb.DelOrder(); [async] procedure TFOrderEntryWeb.DelOrder();
var var
Response: TXDataClientResponse; Response: TXDataClientResponse;
begin begin
Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.DelOrder', Response := await(XDataWebClient1.RawInvokeAsync('ILookupService.DelOrder', [OrderID, 'web', JS.toString(AuthService.TokenPayload.Properties['user_id'])]));
[OrderID, 'web', JS.toString(AuthService.TokenPayload.Properties['user_id'])]));
end;
procedure TFOrderEntryWeb.dtpOrderDateChange(Sender: TObject);
begin
EditMode();
end; end;
procedure TFOrderEntryWeb.SendOrderToServer(); procedure TFOrderEntryWeb.SendOrderToServer();
...@@ -556,32 +575,6 @@ begin ...@@ -556,32 +575,6 @@ begin
GenerateReportPDF; GenerateReportPDF;
end; end;
procedure TFOrderEntryWeb.btn_confirm_deleteClick(Sender: TObject);
begin
if FModalAction = 'cancel' then
begin
FViewMain.change := false;
if OrderID <> '' then
FViewMain.ViewOrderEntryWeb(OrderID, '', 'EDIT', 'Failure: Changes Discarded')
else
FViewMain.ViewOrders('');
end
else if FModalAction = 'delete' then
begin
Utils.ShowSpinner('spinner');
asm
var modal = document.getElementById('confirmation_modal');
if (modal && modal.parentNode !== document.body) {
document.body.appendChild(modal);
}
var bsModal = new bootstrap.Modal(modal, { keyboard: false });
bsModal.hide();
end;
DelOrder();
tmrReturn.Enabled := true;
end;
end;
procedure TFOrderEntryWeb.GenerateReportPDF; procedure TFOrderEntryWeb.GenerateReportPDF;
// sends the search to the server which then sends back a pdf of the results // sends the search to the server which then sends back a pdf of the results
var var
...@@ -624,27 +617,6 @@ begin ...@@ -624,27 +617,6 @@ begin
end; end;
end; end;
class function TFOrderEntryWeb.CreateForm(AElementID, orderInfo, customerInfo, mode, info: string): TWebForm;
var
localMode: string;
begin
localMode := mode;
Application.CreateForm(TFOrderEntryWeb, AElementID, Result,
procedure(AForm: TObject)
begin
with TFOrderEntryWeb(AForm) do
begin
TFOrderEntryWeb(AForm).customerID := customerInfo;
TFOrderEntryWeb(AForm).orderID := orderInfo;
TFOrderEntryWeb(AForm).mode := localMode;
TFOrderEntryWeb(AForm).notification := info;
end;
end
);
end;
procedure TFOrderEntryWeb.addColorRow(num: string; Color: string; LPI: string; Size: string); procedure TFOrderEntryWeb.addColorRow(num: string; Color: string; LPI: string; Size: string);
var var
container, newRow, col, labelEl, inputEl, removeCol: TJSHTMLElement; container, newRow, col, labelEl, inputEl, removeCol: TJSHTMLElement;
...@@ -763,19 +735,22 @@ end; ...@@ -763,19 +735,22 @@ end;
procedure TFOrderEntryWeb.btnCancelClick(Sender: TObject); procedure TFOrderEntryWeb.btnCancelClick(Sender: TObject);
begin begin
FModalAction := 'cancel'; ShowConfirmationModal(
document.getElementById('modal_body').innerHTML := 'Are you sure you want to cancel all changes?'; 'Are you sure you want to cancel all changes?',
document.getElementById('btn_confirm_cancel').innerText := 'No'; 'Yes',
document.getElementById('btn_confirm_delete').innerText := 'Yes'; 'No',
procedure(confirmed: Boolean)
asm begin
var modal = document.getElementById('confirmation_modal'); if confirmed then
if (modal && modal.parentNode !== document.body) { begin
document.body.appendChild(modal); FViewMain.change := false;
} if OrderID <> '' then
var confirmationModal = new bootstrap.Modal(modal, { keyboard: false }); FViewMain.ViewOrderEntryWeb(OrderID, '', 'EDIT', 'Failure: Changes Discarded')
confirmationModal.show(); else
end; FViewMain.ViewOrders('');
end;
end
);
end; end;
procedure TFOrderEntryWeb.btnCloseClick(Sender: TObject); procedure TFOrderEntryWeb.btnCloseClick(Sender: TObject);
...@@ -957,31 +932,6 @@ begin ...@@ -957,31 +932,6 @@ begin
end; end;
procedure TFOrderEntryWeb.WebFormShow(Sender: TObject);
begin
if mode <> 'ADD' then
begin
getOrder(orderID);
ViewMode();
end
else
begin
getCustomer(customerID);
EditMode();
end;
edtOrderNum.Text := OrderID;
if notification <> '' then
begin
ShowToast(notification);
end;
end;
procedure TFOrderEntryWeb.XDataWebDataSet1AfterEdit(DataSet: TDataSet);
begin
EditMode();
end;
procedure TFOrderEntryWeb.tmrReturnTimer(Sender: TObject); procedure TFOrderEntryWeb.tmrReturnTimer(Sender: TObject);
begin begin
Utils.HideSpinner('spinner'); Utils.HideSpinner('spinner');
...@@ -989,10 +939,25 @@ begin ...@@ -989,10 +939,25 @@ begin
FViewMain.ViewOrders('Success: Order Successfully Deleted'); FViewMain.ViewOrders('Success: Order Successfully Deleted');
end; end;
procedure TFOrderEntryWeb.tmrScrollTopTimer(Sender: TObject); procedure TFOrderEntryWeb.EditMode;
begin begin
tmrScrollTop.Enabled := False; XDataWebDataSet1.Edit;
window.scrollTo(0, 0); FViewMain.change := true;
btnCopy.Enabled := false;
btnPDF.Enabled := false;
btnDelete.Enabled := false;
btnClose.Enabled := false;
btnSave.Enabled := true;
btnCancel.Enabled := True;
btnEdit.Enabled := false;
btnAdd.Enabled := false;
cbPdf.Enabled := True;
cbInkJet.Enabled := True;
lblFormState.Caption := 'Edit Mode';
lblFormState.ElementHandle.classList.remove('text-danger');
lblFormState.ElementHandle.classList.add('text-success');
end; end;
procedure TFOrderEntryWeb.ViewMode; procedure TFOrderEntryWeb.ViewMode;
...@@ -1006,6 +971,13 @@ begin ...@@ -1006,6 +971,13 @@ begin
btnEdit.Enabled := true; btnEdit.Enabled := true;
btnAdd.Enabled := true; btnAdd.Enabled := true;
FViewMain.change := false; FViewMain.change := false;
cbPdf.Enabled := False;
cbInkJet.Enabled := False;
lblFormState.Caption := 'View Mode';
lblFormState.ElementHandle.classList.remove('text-success');
lblFormState.ElementHandle.classList.add('text-danger');
end; end;
......
...@@ -76,7 +76,7 @@ type ...@@ -76,7 +76,7 @@ type
procedure ClearTable(); procedure ClearTable();
procedure GeneratePagination(TotalPages: Integer); procedure GeneratePagination(TotalPages: Integer);
function GenerateSearchOptions(): string; function GenerateSearchOptions(): string;
procedure orderEntry(orderInfo, customerInfo, mode, orderType: string); procedure OrderEntry(orderInfo, customerInfo, mode, orderType: string);
procedure ShowAddOrderForm(); procedure ShowAddOrderForm();
procedure ShowSearchForm(); procedure ShowSearchForm();
procedure ShowSetStatusForm(); procedure ShowSetStatusForm();
...@@ -139,38 +139,25 @@ begin ...@@ -139,38 +139,25 @@ begin
); );
end; end;
procedure TFViewOrders.btnPDFClick(Sender: TObject); procedure TFViewOrders.btnPDFClick(Sender: TObject);
var
confirmBtn: TJSHTMLElement;
begin begin
if xdwdsOrders.RecordCount >= 100 then if xdwdsOrders.RecordCount >= 100 then
begin begin
FPendingPdfTab := nil; FPendingPdfTab := nil;
document.getElementById('modal_body').innerHTML := ShowConfirmationModal(
'You are about to generate a PDF for over 100 orders. This may take some time. Continue?'; 'You are about to generate a PDF for over 100 orders. This may take some time. Continue?',
document.getElementById('btn_confirm_cancel').innerText := 'Cancel'; 'Yes',
document.getElementById('btn_confirm_delete').innerText := 'Yes'; 'Cancel',
procedure(confirmed: Boolean)
confirmBtn := TJSHTMLElement(document.getElementById('btn_confirm_delete')); begin
confirmBtn.addEventListener('click', if confirmed then
TJSEventHandler(
procedure(Event: TJSEvent)
begin begin
asm bootstrap.Modal.getInstance(document.getElementById('confirmation_modal')).hide(); end;
HandlePDFConfirmation; HandlePDFConfirmation;
end end;
) end
); );
asm
var modal = document.getElementById('confirmation_modal');
if (modal && modal.parentNode !== document.body) {
document.body.appendChild(modal);
}
var confirmationModal = new bootstrap.Modal(modal, { keyboard: false });
confirmationModal.show();
end;
end end
else else
begin begin
...@@ -198,6 +185,7 @@ begin ...@@ -198,6 +185,7 @@ begin
end; end;
procedure TFViewOrders.HandlePDFConfirmation; procedure TFViewOrders.HandlePDFConfirmation;
begin begin
// Open tab only now // Open tab only now
...@@ -765,7 +753,10 @@ begin ...@@ -765,7 +753,10 @@ begin
// Update label // Update label
if orderListLength = 0 then if orderListLength = 0 then
lblEntries.Caption := 'No entries found' begin
lblEntries.Caption := 'No entries found';
ShowToast('No entries found', 'danger');
end
else if (PageNumber * PageSize) < orderListLength then else if (PageNumber * PageSize) < orderListLength then
lblEntries.Caption := Format('Showing entries %d - %d of %d', lblEntries.Caption := Format('Showing entries %d - %d of %d',
[(PageNumber - 1) * PageSize + 1, PageNumber * PageSize, orderListLength]) [(PageNumber - 1) * PageSize + 1, PageNumber * PageSize, orderListLength])
...@@ -784,18 +775,18 @@ begin ...@@ -784,18 +775,18 @@ begin
end; end;
procedure TFViewOrders.btnAddOrderClick(Sender: TObject); procedure TFViewOrders.btnAddOrderClick(Sender: TObject);
begin begin
ShowAddOrderForm(); ShowAddOrderForm();
end; end;
procedure TFViewOrders.orderEntry(orderInfo, customerInfo, mode, orderType: string); procedure TFViewOrders.OrderEntry(orderInfo, customerInfo, mode, orderType: string);
begin begin
if orderType = 'corrugated' then if orderType = 'corrugated' then
FViewMain.ViewOrderEntryCorrugated(orderInfo, customerInfo, mode, '') begin
FViewMain.ViewOrderEntryCorrugated(orderInfo, customerInfo, mode, '');
end
else if orderType = 'web' then else if orderType = 'web' then
FViewMain.ViewOrderEntryWeb(orderInfo, customerInfo, mode, '') FViewMain.ViewOrderEntryWeb(orderInfo, customerInfo, mode, '')
else else
......
object FSelectCustomer: TFSelectCustomer object FSelectCustomer: TFSelectCustomer
Width = 765 Width = 765
Height = 480 Height = 416
OnCreate = WebFormCreate OnCreate = WebFormCreate
OnShow = WebFormShow OnShow = WebFormShow
object WebLabel1: TWebLabel object WebLabel1: TWebLabel
Left = 8 Left = 8
Top = 81 Top = 27
Width = 95 Width = 95
Height = 15 Height = 15
Caption = 'Search Customers' Caption = 'Search Customers'
...@@ -14,7 +14,7 @@ object FSelectCustomer: TFSelectCustomer ...@@ -14,7 +14,7 @@ object FSelectCustomer: TFSelectCustomer
end end
object WebLabel2: TWebLabel object WebLabel2: TWebLabel
Left = 279 Left = 279
Top = 81 Top = 27
Width = 134 Width = 134
Height = 15 Height = 15
Caption = 'Selected Customer Name' Caption = 'Selected Customer Name'
...@@ -23,7 +23,7 @@ object FSelectCustomer: TFSelectCustomer ...@@ -23,7 +23,7 @@ object FSelectCustomer: TFSelectCustomer
end end
object WebLabel3: TWebLabel object WebLabel3: TWebLabel
Left = 131 Left = 131
Top = 81 Top = 27
Width = 113 Width = 113
Height = 15 Height = 15
Caption = 'Selected Customer ID' Caption = 'Selected Customer ID'
...@@ -32,7 +32,7 @@ object FSelectCustomer: TFSelectCustomer ...@@ -32,7 +32,7 @@ object FSelectCustomer: TFSelectCustomer
end end
object edtSearch: TWebEdit object edtSearch: TWebEdit
Left = 4 Left = 4
Top = 102 Top = 48
Width = 121 Width = 121
Height = 22 Height = 22
ChildOrder = 2 ChildOrder = 2
...@@ -42,7 +42,7 @@ object FSelectCustomer: TFSelectCustomer ...@@ -42,7 +42,7 @@ object FSelectCustomer: TFSelectCustomer
end end
object edtName: TWebEdit object edtName: TWebEdit
Left = 279 Left = 279
Top = 102 Top = 48
Width = 142 Width = 142
Height = 22 Height = 22
ChildOrder = 1 ChildOrder = 1
...@@ -52,7 +52,7 @@ object FSelectCustomer: TFSelectCustomer ...@@ -52,7 +52,7 @@ object FSelectCustomer: TFSelectCustomer
end end
object TMSFNCGrid1: TTMSFNCGrid object TMSFNCGrid1: TTMSFNCGrid
Left = 0 Left = 0
Top = 163 Top = 99
Width = 765 Width = 765
Height = 317 Height = 317
Align = alBottom Align = alBottom
...@@ -206,10 +206,11 @@ object FSelectCustomer: TFSelectCustomer ...@@ -206,10 +206,11 @@ object FSelectCustomer: TFSelectCustomer
ScrollMode = scmItemScrolling ScrollMode = scmItemScrolling
DesignTimeSampleData = True DesignTimeSampleData = True
OnCellClick = TMSFNCGrid1CellClick OnCellClick = TMSFNCGrid1CellClick
ExplicitTop = 163
end end
object btnCancel: TWebButton object btnCancel: TWebButton
Left = 556 Left = 556
Top = 101 Top = 47
Width = 96 Width = 96
Height = 25 Height = 25
Caption = 'Cancel' Caption = 'Cancel'
...@@ -220,7 +221,7 @@ object FSelectCustomer: TFSelectCustomer ...@@ -220,7 +221,7 @@ object FSelectCustomer: TFSelectCustomer
end end
object btnConfirm: TWebButton object btnConfirm: TWebButton
Left = 440 Left = 440
Top = 101 Top = 47
Width = 96 Width = 96
Height = 25 Height = 25
Caption = 'Select' Caption = 'Select'
...@@ -229,30 +230,9 @@ object FSelectCustomer: TFSelectCustomer ...@@ -229,30 +230,9 @@ object FSelectCustomer: TFSelectCustomer
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick OnClick = btnConfirmClick
end end
object edtNotification: TWebEdit
Left = 4
Top = 16
Width = 510
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementFont = efCSS
Enabled = False
Font.Charset = ANSI_CHARSET
Font.Color = clRed
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
HeightPercent = 100.000000000000000000
HideSelection = False
ParentFont = False
TabOrder = 1
WidthPercent = 100.000000000000000000
end
object edtID: TWebEdit object edtID: TWebEdit
Left = 131 Left = 131
Top = 102 Top = 48
Width = 142 Width = 142
Height = 22 Height = 22
ChildOrder = 1 ChildOrder = 1
......
<html> <div id="spinner" class="position-absolute top-50 start-50 translate-middle d-none">
<head> <div class="lds-roller">
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <div></div><div></div><div></div><div></div>
<title>TMS Web Project</title> <div></div><div></div><div></div><div></div>
<style> </div>
</style> </div>
</head>
<body>
</body>
</html>
\ No newline at end of file
...@@ -21,7 +21,6 @@ type ...@@ -21,7 +21,6 @@ type
TMSFNCGrid1: TTMSFNCGrid; TMSFNCGrid1: TTMSFNCGrid;
btnCancel: TWebButton; btnCancel: TWebButton;
btnConfirm: TWebButton; btnConfirm: TWebButton;
edtNotification: TWebEdit;
XDataWebClient1: TXDataWebClient; XDataWebClient1: TXDataWebClient;
xdwdsCustomers: TXDataWebDataSet; xdwdsCustomers: TXDataWebDataSet;
wdsCustomers: TWebDataSource; wdsCustomers: TWebDataSource;
...@@ -78,7 +77,6 @@ end; ...@@ -78,7 +77,6 @@ end;
procedure TFSelectCustomer.WebFormShow(Sender: TObject); procedure TFSelectCustomer.WebFormShow(Sender: TObject);
begin begin
Utils.ShowSpinner('spinner');
getCustomers(); getCustomers();
end; end;
...@@ -90,7 +88,7 @@ end; ...@@ -90,7 +88,7 @@ end;
procedure TFSelectCustomer.btnConfirmClick(Sender: TObject); procedure TFSelectCustomer.btnConfirmClick(Sender: TObject);
begin begin
if edtID.Text = '' then if edtID.Text = '' then
edtNotification.Text := 'Please Select a Customer' ShowToast('Please Select a Customer', 'danger')
else else
begin begin
xdwdsCustomers.Locate('Id', edtID.Text, []); xdwdsCustomers.Locate('Id', edtID.Text, []);
...@@ -111,6 +109,7 @@ var ...@@ -111,6 +109,7 @@ var
i: integer; i: integer;
begin begin
try try
Utils.ShowSpinner('spinner');
// Fetch data from XData service // Fetch data from XData service
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.getQBCustomers', [])); xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.getQBCustomers', []));
customerList := TJSObject(xdcResponse.Result); customerList := TJSObject(xdcResponse.Result);
...@@ -126,7 +125,6 @@ begin ...@@ -126,7 +125,6 @@ begin
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not retrieve QuickBooks customers: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal('Could not retrieve QuickBooks customers: ' + E.ErrorResult.ErrorMessage);
end; end;
Utils.HideSpinner('spinner');
end; end;
...@@ -165,6 +163,7 @@ begin ...@@ -165,6 +163,7 @@ begin
finally finally
TMSFNCGrid1.EndUpdate; TMSFNCGrid1.EndUpdate;
end; end;
Utils.HideSpinner('spinner');
end; end;
procedure TFSelectCustomer.TMSFNCGrid1CellClick(Sender: TObject; ACol, procedure TFSelectCustomer.TMSFNCGrid1CellClick(Sender: TObject; ACol,
......
object FSetStatus: TFSetStatus object FSetStatus: TFSetStatus
Width = 640 Width = 640
Height = 361 Height = 278
OnShow = WebFormShow OnShow = WebFormShow
object lblStatus1: TWebLabel object lblStatus1: TWebLabel
Left = 326 Left = 328
Top = 80 Top = 32
Width = 38 Width = 38
Height = 14 Height = 14
Caption = 'Status:' Caption = 'Status:'
...@@ -18,8 +18,8 @@ object FSetStatus: TFSetStatus ...@@ -18,8 +18,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object WebLabel1: TWebLabel object WebLabel1: TWebLabel
Left = 484 Left = 486
Top = 80 Top = 32
Width = 91 Width = 91
Height = 14 Height = 14
Caption = 'Date Completed:' Caption = 'Date Completed:'
...@@ -33,8 +33,8 @@ object FSetStatus: TFSetStatus ...@@ -33,8 +33,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object WebLabel2: TWebLabel object WebLabel2: TWebLabel
Left = 14 Left = 16
Top = 80 Top = 32
Width = 48 Width = 48
Height = 14 Height = 14
Caption = 'Order ID:' Caption = 'Order ID:'
...@@ -48,8 +48,8 @@ object FSetStatus: TFSetStatus ...@@ -48,8 +48,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object WebLabel3: TWebLabel object WebLabel3: TWebLabel
Left = 172 Left = 174
Top = 78 Top = 30
Width = 57 Width = 57
Height = 14 Height = 14
Caption = 'Job Name:' Caption = 'Job Name:'
...@@ -63,8 +63,8 @@ object FSetStatus: TFSetStatus ...@@ -63,8 +63,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object WebLabel4: TWebLabel object WebLabel4: TWebLabel
Left = 11 Left = 13
Top = 142 Top = 94
Width = 51 Width = 51
Height = 14 Height = 14
Caption = 'Ship Due:' Caption = 'Ship Due:'
...@@ -78,8 +78,8 @@ object FSetStatus: TFSetStatus ...@@ -78,8 +78,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object WebLabel5: TWebLabel object WebLabel5: TWebLabel
Left = 169 Left = 171
Top = 142 Top = 94
Width = 78 Width = 78
Height = 14 Height = 14
Caption = 'New Due Date:' Caption = 'New Due Date:'
...@@ -93,8 +93,8 @@ object FSetStatus: TFSetStatus ...@@ -93,8 +93,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblMount: TWebLabel object lblMount: TWebLabel
Left = 324 Left = 326
Top = 200 Top = 152
Width = 62 Width = 62
Height = 14 Height = 14
Caption = 'Mount Due:' Caption = 'Mount Due:'
...@@ -108,8 +108,8 @@ object FSetStatus: TFSetStatus ...@@ -108,8 +108,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblMountNew: TWebLabel object lblMountNew: TWebLabel
Left = 482 Left = 484
Top = 200 Top = 152
Width = 78 Width = 78
Height = 14 Height = 14
Caption = 'New Due Date:' Caption = 'New Due Date:'
...@@ -123,8 +123,8 @@ object FSetStatus: TFSetStatus ...@@ -123,8 +123,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblPlate: TWebLabel object lblPlate: TWebLabel
Left = 11 Left = 13
Top = 200 Top = 152
Width = 54 Width = 54
Height = 14 Height = 14
Caption = 'Plate Due:' Caption = 'Plate Due:'
...@@ -138,8 +138,8 @@ object FSetStatus: TFSetStatus ...@@ -138,8 +138,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblPlateNew: TWebLabel object lblPlateNew: TWebLabel
Left = 169 Left = 171
Top = 200 Top = 152
Width = 78 Width = 78
Height = 14 Height = 14
Caption = 'New Due Date:' Caption = 'New Due Date:'
...@@ -153,8 +153,8 @@ object FSetStatus: TFSetStatus ...@@ -153,8 +153,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblArt: TWebLabel object lblArt: TWebLabel
Left = 324 Left = 326
Top = 142 Top = 94
Width = 44 Width = 44
Height = 14 Height = 14
Caption = 'Art Due:' Caption = 'Art Due:'
...@@ -168,8 +168,8 @@ object FSetStatus: TFSetStatus ...@@ -168,8 +168,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblArtNew: TWebLabel object lblArtNew: TWebLabel
Left = 482 Left = 484
Top = 142 Top = 94
Width = 78 Width = 78
Height = 14 Height = 14
Caption = 'New Due Date:' Caption = 'New Due Date:'
...@@ -183,8 +183,8 @@ object FSetStatus: TFSetStatus ...@@ -183,8 +183,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object wlcbStatus: TWebLookupComboBox object wlcbStatus: TWebLookupComboBox
Left = 326 Left = 328
Top = 100 Top = 52
Width = 145 Width = 145
Height = 22 Height = 22
ElementClassName = 'custom-select' ElementClassName = 'custom-select'
...@@ -194,8 +194,8 @@ object FSetStatus: TFSetStatus ...@@ -194,8 +194,8 @@ object FSetStatus: TFSetStatus
LookupValues = <> LookupValues = <>
end end
object dtpDate: TWebDateTimePicker object dtpDate: TWebDateTimePicker
Left = 484 Left = 486
Top = 100 Top = 52
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -206,8 +206,8 @@ object FSetStatus: TFSetStatus ...@@ -206,8 +206,8 @@ object FSetStatus: TFSetStatus
Text = '' Text = ''
end end
object btnConfirm: TWebButton object btnConfirm: TWebButton
Left = 14 Left = 16
Top = 273 Top = 225
Width = 96 Width = 96
Height = 25 Height = 25
Caption = 'Confirm' Caption = 'Confirm'
...@@ -222,8 +222,8 @@ object FSetStatus: TFSetStatus ...@@ -222,8 +222,8 @@ object FSetStatus: TFSetStatus
OnClick = btnConfirmClick OnClick = btnConfirmClick
end end
object btnCancel: TWebButton object btnCancel: TWebButton
Left = 125 Left = 127
Top = 273 Top = 225
Width = 96 Width = 96
Height = 25 Height = 25
Caption = 'Cancel' Caption = 'Cancel'
...@@ -238,8 +238,8 @@ object FSetStatus: TFSetStatus ...@@ -238,8 +238,8 @@ object FSetStatus: TFSetStatus
OnClick = btnCancelClick OnClick = btnCancelClick
end end
object edtOrderID: TWebEdit object edtOrderID: TWebEdit
Left = 14 Left = 16
Top = 100 Top = 52
Width = 145 Width = 145
Height = 22 Height = 22
HelpType = htKeyword HelpType = htKeyword
...@@ -259,31 +259,9 @@ object FSetStatus: TFSetStatus ...@@ -259,31 +259,9 @@ object FSetStatus: TFSetStatus
TabOrder = 1 TabOrder = 1
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object edtNotification: TWebEdit
Left = 14
Top = 24
Width = 303
Height = 22
HelpType = htKeyword
TabStop = False
ChildOrder = 8
ElementClassName = 'form-control'
ElementFont = efCSS
Enabled = False
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
end
object edtJobName: TWebEdit object edtJobName: TWebEdit
Left = 172 Left = 174
Top = 100 Top = 52
Width = 145 Width = 145
Height = 22 Height = 22
HelpType = htKeyword HelpType = htKeyword
...@@ -304,8 +282,8 @@ object FSetStatus: TFSetStatus ...@@ -304,8 +282,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object dtpShipDue: TWebDateTimePicker object dtpShipDue: TWebDateTimePicker
Left = 11 Left = 13
Top = 162 Top = 114
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -317,8 +295,8 @@ object FSetStatus: TFSetStatus ...@@ -317,8 +295,8 @@ object FSetStatus: TFSetStatus
Text = '' Text = ''
end end
object dtpNewShipDue: TWebDateTimePicker object dtpNewShipDue: TWebDateTimePicker
Left = 169 Left = 171
Top = 162 Top = 114
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -329,8 +307,8 @@ object FSetStatus: TFSetStatus ...@@ -329,8 +307,8 @@ object FSetStatus: TFSetStatus
Text = '' Text = ''
end end
object dtpMountDue: TWebDateTimePicker object dtpMountDue: TWebDateTimePicker
Left = 324 Left = 326
Top = 220 Top = 172
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -342,8 +320,8 @@ object FSetStatus: TFSetStatus ...@@ -342,8 +320,8 @@ object FSetStatus: TFSetStatus
Text = '' Text = ''
end end
object dtpNewMountDue: TWebDateTimePicker object dtpNewMountDue: TWebDateTimePicker
Left = 482 Left = 484
Top = 220 Top = 172
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -354,8 +332,8 @@ object FSetStatus: TFSetStatus ...@@ -354,8 +332,8 @@ object FSetStatus: TFSetStatus
Text = '' Text = ''
end end
object dtpPlateDue: TWebDateTimePicker object dtpPlateDue: TWebDateTimePicker
Left = 11 Left = 13
Top = 220 Top = 172
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -367,8 +345,8 @@ object FSetStatus: TFSetStatus ...@@ -367,8 +345,8 @@ object FSetStatus: TFSetStatus
Text = '' Text = ''
end end
object dtpNewPlateDue: TWebDateTimePicker object dtpNewPlateDue: TWebDateTimePicker
Left = 169 Left = 171
Top = 220 Top = 172
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -379,8 +357,8 @@ object FSetStatus: TFSetStatus ...@@ -379,8 +357,8 @@ object FSetStatus: TFSetStatus
Text = '' Text = ''
end end
object dtpArtDue: TWebDateTimePicker object dtpArtDue: TWebDateTimePicker
Left = 324 Left = 326
Top = 162 Top = 114
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -392,8 +370,8 @@ object FSetStatus: TFSetStatus ...@@ -392,8 +370,8 @@ object FSetStatus: TFSetStatus
Text = '' Text = ''
end end
object dtpNewArtDue: TWebDateTimePicker object dtpNewArtDue: TWebDateTimePicker
Left = 482 Left = 484
Top = 162 Top = 114
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
......
...@@ -17,7 +17,6 @@ type ...@@ -17,7 +17,6 @@ type
btnCancel: TWebButton; btnCancel: TWebButton;
WebLabel2: TWebLabel; WebLabel2: TWebLabel;
edtOrderID: TWebEdit; edtOrderID: TWebEdit;
edtNotification: TWebEdit;
edtJobName: TWebEdit; edtJobName: TWebEdit;
WebLabel3: TWebLabel; WebLabel3: TWebLabel;
WebLabel4: TWebLabel; WebLabel4: TWebLabel;
......
...@@ -57,35 +57,19 @@ begin ...@@ -57,35 +57,19 @@ begin
Exit; Exit;
end; end;
asm ShowConfirmationModal(
var modal = document.getElementById('confirmation_modal'); 'Are you sure you want to save changes to your profile?',
var btnCancel = document.getElementById('btn_confirm_cancel'); 'Save',
var btnConfirm = document.getElementById('btn_confirm_delete'); 'Cancel',
var modalBody = document.getElementById('modal_body'); procedure(confirmed: Boolean)
var self = this; begin
if confirmed then
if (modal && btnCancel && btnConfirm && modalBody) { EditUser;
modalBody.innerText = 'Are you sure you want to save changes to your profile?'; end
btnCancel.innerText = 'Cancel'; );
btnConfirm.innerText = 'Save';
if (modal.parentNode !== document.body) {
document.body.appendChild(modal);
}
var bsModal = new bootstrap.Modal(modal, { keyboard: false });
bsModal.show();
btnConfirm.onclick = function () {
self.EditUser();
bsModal.hide();
};
}
end;
end; end;
[async] procedure TFViewUserProfile.EditUser; [async] procedure TFViewUserProfile.EditUser;
var var
xdcResponse: TXDataClientResponse; xdcResponse: TXDataClientResponse;
...@@ -114,28 +98,33 @@ begin ...@@ -114,28 +98,33 @@ begin
end; end;
procedure TFViewUserProfile.btnCancelClick(Sender: TObject); procedure TFViewUserProfile.btnCancelClick(Sender: TObject);
var
xdcResponse: TXDataClientResponse;
userList: TJSObject;
data: TJSArray;
user: TJSObject;
begin begin
GetUser(); ShowConfirmationModal(
showToast('Failure: Changes discarded'); 'Are you sure you want to cancel all your changes?',
'Yes',
'No',
procedure(confirmed: Boolean)
begin
if confirmed then
begin
GetUser();
ShowToast('Changes discarded', 'danger');
end;
end
);
end; end;
procedure TFViewUserProfile.WebFormShow(Sender: TObject); procedure TFViewUserProfile.WebFormShow(Sender: TObject);
begin begin
GetUser(); GetUser();
//edtJwt.Text := TJSJSON.stringify(AuthService.TokenPayload); //edtJwt.Text := TJSJSON.stringify(AuthService.TokenPayload);
// View.UserProfile.WebFormShow // View.UserProfile.WebFormShow
chkAdminUser.Checked := SameText(string(AuthService.TokenPayload.Properties['user_admin']), 'true'); chkAdminUser.Checked := SameText(string(AuthService.TokenPayload.Properties['user_admin']), 'true');
end; end;
procedure TFViewUserProfile.GetUser; procedure TFViewUserProfile.GetUser;
var var
xdcResponse: TXDataClientResponse; xdcResponse: TXDataClientResponse;
......
...@@ -43,22 +43,5 @@ ...@@ -43,22 +43,5 @@
</div> </div>
</div> </div>
</div> </div>
<!--</div> -->
<!--</div> -->
<div class="modal fade" id="confirmation_modal" tabindex="-1" aria-labelledby="confirmation_modal_label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="confirmation_modal_label">Confirm</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Are you sure you want to make these changes?
</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_delete" >Confirm</button>
</div>
</div>
</div>
</div>
...@@ -382,6 +382,15 @@ is-invalid .form-check-input { ...@@ -382,6 +382,15 @@ is-invalid .form-check-input {
animation: slideInLeft 0.4s ease-out forwards; animation: slideInLeft 0.4s ease-out forwards;
} }
#spinner {
position: fixed !important;
z-index: 9999 !important;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
......
...@@ -87,6 +87,7 @@ uses ...@@ -87,6 +87,7 @@ uses
System.Generics.Collections, System.Generics.Collections,
XData.Sys.Exceptions, uLibrary, rOrderWeb, rOrderCutting; XData.Sys.Exceptions, uLibrary, rOrderWeb, rOrderCutting;
procedure TLookupService.AfterConstruction; procedure TLookupService.AfterConstruction;
begin begin
inherited; inherited;
...@@ -94,12 +95,14 @@ begin ...@@ -94,12 +95,14 @@ begin
end; end;
procedure TLookupService.BeforeDestruction; procedure TLookupService.BeforeDestruction;
begin begin
ordersDB.Free; ordersDB.Free;
inherited; inherited;
end; end;
function TLookupService.DelShippingAddress(AddressID, CustomerID: string): TJSONObject; function TLookupService.DelShippingAddress(AddressID, CustomerID: string): TJSONObject;
var var
SQL: string; SQL: string;
...@@ -300,7 +303,6 @@ begin ...@@ -300,7 +303,6 @@ begin
end; end;
function TLookupService.AddShippingAddress(AddressInfo: string): TJSONObject; function TLookupService.AddShippingAddress(AddressInfo: string): TJSONObject;
var var
JSONData: TJSONObject; JSONData: TJSONObject;
...@@ -1686,7 +1688,7 @@ begin ...@@ -1686,7 +1688,7 @@ begin
if ( JSONData.GetValue<string>('staff_fields_mount_due') <> '' ) and ( JSONData.GetValue<string>('staff_fields_mount_due') <> '12/30/1899' ) then if ( JSONData.GetValue<string>('staff_fields_mount_due') <> '' ) and ( JSONData.GetValue<string>('staff_fields_mount_due') <> '12/30/1899' ) then
AddStatusSchedule('MOUNT', JSONData, ORDER_ID); AddStatusSchedule('MOUNT', JSONData, ORDER_ID);
addToRevisionsTable(intToStr(ORDER_ID), 'corrugated_plate_orders_revisions', JSONData); AddToRevisionsTable(intToStr(ORDER_ID), 'corrugated_plate_orders_revisions', JSONData);
if mode = 'ADD' then if mode = 'ADD' then
msg := 'Success: Order Successfully Added' msg := 'Success: Order Successfully Added'
...@@ -2239,25 +2241,22 @@ end; ...@@ -2239,25 +2241,22 @@ end;
function TLookupService.delOrder(OrderID, orderType, UserID: string): TJSONObject; function TLookupService.delOrder(OrderID, orderType, UserID: string): TJSONObject;
var var
table: string; table, table2, SQL: string;
table2: string; stream: TStringStream;
sql: string;
CorrugatedOrder: TFullOrder;
WebOrder: TWebOrder;
CuttingDieOrder: TCuttingDie;
DateFormat: TFormatSettings; DateFormat: TFormatSettings;
JSONData: TJSONObject; JSONValue: TJSONValue;
JSONObject, DataObject, JSONData: TJSONObject;
JSONArray: TJSONArray; JSONArray: TJSONArray;
Pair: TJSONPair; Pair: TJSONPair;
Field: TField; Field: TField;
mode: string; RevisionID, rev_num, OrderIDInt: Integer;
stream: TStringStream;
RevisionID, rev_num: integer;
JSONValue: TJSONValue;
JSONObject: TJSONObject;
DataObject: TJSONObject;
begin begin
try try
// Convert ORDER_ID to integer safely
OrderIDInt := StrToIntDef(OrderID, -1);
if OrderIDInt = -1 then
raise Exception.Create('Invalid OrderID: not a valid integer');
if orderType = 'corrugated' then if orderType = 'corrugated' then
begin begin
table := 'corrugated_plate_orders'; table := 'corrugated_plate_orders';
...@@ -2274,97 +2273,92 @@ begin ...@@ -2274,97 +2273,92 @@ begin
table2 := 'cutting_die_orders_revisions'; table2 := 'cutting_die_orders_revisions';
end; end;
stream := TStringStream.Create('', TEncoding.UTF8); // Get new revision ID
DateFormat := TFormatSettings.Create; SQL := 'UPDATE idfield SET KEYVALUE = KEYVALUE + 1 WHERE KEYNAME = ' + QuotedStr('GEN_ORDER_REVISION_ID');
DateFormat.ShortDateFormat := 'yyyy-mm-dd';
DateFormat.DateSeparator := '-';
//Update RevisionID
SQL := 'UPDATE idfield set KEYVALUE = KEYVALUE + 1 WHERE KEYNAME = ' + quotedStr('GEN_ORDER_REVISION_ID');
OrdersDB.UniQuery1.SQL.Text := SQL; OrdersDB.UniQuery1.SQL.Text := SQL;
OrdersDB.UniQuery1.ExecSQL; OrdersDB.UniQuery1.ExecSQL;
//Retrieve updated RevisionID SQL := 'SELECT KEYVALUE FROM idfield WHERE KEYNAME = ' + QuotedStr('GEN_ORDER_REVISION_ID');
SQL := 'select KEYVALUE from idfield where KEYNAME = ' + quotedStr('GEN_ORDER_REVISION_ID');
doQuery(OrdersDB.UniQuery1, SQL); doQuery(OrdersDB.UniQuery1, SQL);
RevisionID := OrdersDB.UniQuery1.FieldByName('KEYVALUE').AsInteger; RevisionID := OrdersDB.UniQuery1.FieldByName('KEYVALUE').AsInteger;
// Convert Order into JSON // Fetch the order to archive it
SQL := 'select * from ' + table + ' where ORDER_ID = ' + OrderID; SQL := 'SELECT * FROM ' + table + ' WHERE ORDER_ID = ' + IntToStr(OrderIDInt);
doQuery(ordersDB.UniQuery1, SQL); doQuery(OrdersDB.UniQuery1, SQL);
ordersDB.UniQuery1.SaveToJSON(stream); stream := TStringStream.Create('', TEncoding.UTF8);
stream.Position := 0; try
JSONValue := TJSONObject.ParseJSONValue(Stream.DataString); OrdersDB.UniQuery1.SaveToJSON(stream);
stream.Position := 0;
JSONValue := TJSONObject.ParseJSONValue(stream.DataString);
if not Assigned(JSONValue) then if not Assigned(JSONValue) then
raise Exception.Create('Invalid JSON content'); raise Exception.Create('Invalid JSON content');
try
if not (JSONValue is TJSONObject) then if not (JSONValue is TJSONObject) then
raise Exception.Create('Expected JSON object'); raise Exception.Create('Expected JSON object');
JSONObject := TJSONObject(JSONValue); JSONObject := TJSONObject(JSONValue);
// Get the "data" object
if not JSONObject.TryGetValue('data', DataObject) then if not JSONObject.TryGetValue('data', DataObject) then
raise Exception.Create('Missing "data" object in JSON'); raise Exception.Create('Missing "data" object in JSON');
// Get the "rows" array
if not DataObject.TryGetValue('rows', JSONArray) then if not DataObject.TryGetValue('rows', JSONArray) then
raise Exception.Create('Missing "rows" array in JSON data'); raise Exception.Create('Missing "rows" array in JSON data');
JSONData := JSONArray.Items[0] as TJSONObject; if JSONArray.Count = 0 then
raise Exception.Create('No order found with ORDER_ID = ' + IntToStr(OrderIDInt));
SQL := 'select max(REVISION_NUMBER) as rev_num from ' + table2 + ' where ORDER_ID = ' + orderID; JSONData := JSONArray.Items[0] as TJSONObject;
doQuery(ordersDB.UniQuery1, SQL);
rev_num := ordersDB.UniQuery1.FieldByName('rev_num').AsInteger + 1;
SQL := 'select * from ' + table2 + ' where ORDER_ID = ' + orderID; // Get current max revision number
doQuery(ordersDB.UniQuery1, SQL); SQL := 'SELECT MAX(REVISION_NUMBER) AS rev_num FROM ' + table2 + ' WHERE ORDER_ID = ' + IntToStr(OrderIDInt);
doQuery(OrdersDB.UniQuery1, SQL);
rev_num := OrdersDB.UniQuery1.FieldByName('rev_num').AsInteger + 1;
doQuery(ordersDB.UniQuery1, SQL); // Insert into revisions
try SQL := 'SELECT * FROM ' + table2 + ' WHERE ORDER_ID = ' + IntToStr(OrderIDInt);
ordersDB.UniQuery1.Insert; doQuery(OrdersDB.UniQuery1, SQL);
for Pair in JSONData do OrdersDB.UniQuery1.Insert;
for Pair in JSONData do
begin
Field := OrdersDB.UniQuery1.FindField(Pair.JsonString.Value);
if Assigned(Field) then
begin begin
Field := ordersDB.UniQuery1.FindField(Pair.JsonString.Value); // Checks if the field exists in the dataset if (Field is TDateTimeField) and (Pair.JsonValue.Value <> '') then
if Assigned(Field) then TDateTimeField(Field).AsDateTime := ISO8601ToDate(Pair.JsonValue.Value, False)
begin else if Pair.JsonValue.Value <> '' then
// handles any dates or datetimes Field.AsString := Pair.JsonValue.Value;
if (Field is TDateTimeField) and (Pair.JsonValue.Value <> '') then
TDateTimeField(Field).AsDateTime := ISO8601ToDate(Pair.JsonValue.Value, False)
else if Pair.JsonValue.Value <> '' then
Field.AsString := Pair.JsonValue.Value;
end;
end; end;
ordersDB.UniQuery1.FieldByName('ORDER_ID').AsString := OrderID;
ordersDB.UniQuery1.FieldByName('ORDER_STATUS').AsString := 'DELETED';
ordersDB.UniQuery1.FieldByName('REVISION_NUMBER').AsInteger := 1;
ordersDB.UniQuery1.FieldByName('ORDER_REVISION_ID').AsInteger := RevisionID;
ordersDB.UniQuery1.FieldByName('REVISION_USER_ID').AsString := UserID;
// Post the record to the database
ordersDB.UniQuery1.Post;
Result := TJSONObject.Create.AddPair('status', 'success');
Result.AddPair('OrderID', OrderID);
TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result);
except
on E: Exception do
begin
Result := TJSONObject.Create.AddPair('error', E.Message);
end
end; end;
OrdersDB.UniQuery1.FieldByName('ORDER_ID').AsInteger := OrderIDInt;
OrdersDB.UniQuery1.FieldByName('ORDER_STATUS').AsString := 'DELETED';
OrdersDB.UniQuery1.FieldByName('REVISION_NUMBER').AsInteger := rev_num;
OrdersDB.UniQuery1.FieldByName('ORDER_REVISION_ID').AsInteger := RevisionID;
OrdersDB.UniQuery1.FieldByName('REVISION_USER_ID').AsString := UserID;
OrdersDB.UniQuery1.Post;
finally finally
JSONData.Free; stream.Free;
JSONValue.Free;
end; end;
sql := 'delete from ' + table + ' where ORDER_ID = ' + OrderID;
// Delete from order tables
SQL := 'DELETE FROM ' + table + ' WHERE ORDER_ID = ' + IntToStr(OrderIDInt);
OrdersDB.UniQuery1.SQL.Text := SQL; OrdersDB.UniQuery1.SQL.Text := SQL;
OrdersDB.UniQuery1.ExecSQL; OrdersDB.UniQuery1.ExecSQL;
sql := 'delete from orders where ORDER_ID = ' + OrderID;
SQL := 'DELETE FROM orders WHERE ORDER_ID = ' + IntToStr(OrderIDInt);
OrdersDB.UniQuery1.SQL.Text := SQL; OrdersDB.UniQuery1.SQL.Text := SQL;
OrdersDB.UniQuery1.ExecSQL; OrdersDB.UniQuery1.ExecSQL;
// Return result
Result := TJSONObject.Create;
Result.AddPair('status', 'success');
Result.AddPair('OrderID', IntToStr(OrderIDInt));
TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result);
except except
on E: Exception do on E: Exception do
begin begin
......
...@@ -5,8 +5,8 @@ webClientVersion=0.9.6 ...@@ -5,8 +5,8 @@ webClientVersion=0.9.6
LogFileNum=819 LogFileNum=819
[Database] [Database]
Server=192.168.159.144 --Server=192.168.159.153
--Server=192.168.102.130 Server=192.168.102.130
--Server=192.168.75.133 --Server=192.168.75.133
Database=kg_order_entry Database=kg_order_entry
Username=root Username=root
......
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