96 lines
2.0 KiB
ObjectPascal
96 lines
2.0 KiB
ObjectPascal
|
|
unit U_BatchEditUnit;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
|
|||
|
|
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics,
|
|||
|
|
cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
|
|||
|
|
Vcl.Menus, Vcl.StdCtrls, cxButtons, cxLabel, cxTextEdit, cxMaskEdit,
|
|||
|
|
cxDropDownEdit, dxSkinsCore, dxSkinWXI, Data.DB, Data.Win.ADODB, U_BaseInput;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmBatchEditUnit = class(TfrmBaseInput)
|
|||
|
|
btnOK: TcxButton;
|
|||
|
|
btnCancel: TcxButton;
|
|||
|
|
cxLabel2: TcxLabel;
|
|||
|
|
ADOConnection1: TADOConnection;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
QtyUnit: TcxComboBox;
|
|||
|
|
procedure btnCancelClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure btnOKClick(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
|
|||
|
|
public
|
|||
|
|
FDRSIDList: string;
|
|||
|
|
Fflag: Integer;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmBatchEditUnit: TfrmBatchEditUnit;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink;
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmBatchEditUnit.btnCancelClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBatchEditUnit.btnOKClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
if Trim(QtyUnit.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>뵥λ', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if FDRSIDList = '' then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
// ֻ<><D6BB><EFBFBD><EFBFBD> Tab=2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Trade_Cloth_DR_Sub <20><> QtyUnit<69><74>
|
|||
|
|
if Fflag = 2 then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
SQL.Add('update Trade_Cloth_DR_Sub set QtyUnit = ' + QuotedStr(QtyUnit.Text) +
|
|||
|
|
' where DRSID in (' + FDRSIDList + ')');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
ModalResult := mrOk;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmBatchEditUnit.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
with ADOConnection1 do
|
|||
|
|
begin
|
|||
|
|
if not Connected then
|
|||
|
|
begin
|
|||
|
|
Connected := false;
|
|||
|
|
ConnectionString := DConString;
|
|||
|
|
LoginPrompt := false;
|
|||
|
|
Connected := true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><><EFBFBD><EFBFBD>', mb_Ok + MB_ICONERROR);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|