447 lines
12 KiB
ObjectPascal
447 lines
12 KiB
ObjectPascal
|
|
unit U_FKChkList;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
|||
|
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin,
|
|||
|
|
StdCtrls, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
|||
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
|||
|
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
|||
|
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
|||
|
|
IdTCPClient, IdFTP,ShellAPI,IniFiles, cxCheckBox, cxCalendar,
|
|||
|
|
cxButtonEdit, cxTextEdit, cxPC, cxCurrencyEdit, Menus, cxDropDownEdit,
|
|||
|
|
cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack,
|
|||
|
|
dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
|
|||
|
|
dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle,
|
|||
|
|
dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary,
|
|||
|
|
dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin,
|
|||
|
|
dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
|
|||
|
|
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
|
|||
|
|
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
|
|||
|
|
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
|||
|
|
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin,
|
|||
|
|
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
|
|||
|
|
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
|
|||
|
|
dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine,
|
|||
|
|
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter,
|
|||
|
|
dxBarBuiltInMenu, cxNavigator;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmFKChkList = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
YFName: TEdit;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
FactoryName: TEdit;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
begdate: TDateTimePicker;
|
|||
|
|
Enddate: TDateTimePicker;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
DS_HZ: TDataSource;
|
|||
|
|
CDS_HZ: TClientDataSet;
|
|||
|
|
cxTabControl1: TcxTabControl;
|
|||
|
|
Tchk: TToolButton;
|
|||
|
|
TNochk: TToolButton;
|
|||
|
|
Nochk: TToolButton;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
CheckBox1: TCheckBox;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
Note: TEdit;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
Tv2: TcxGridDBTableView;
|
|||
|
|
v2Ssel: TcxGridDBColumn;
|
|||
|
|
v2Column5: TcxGridDBColumn;
|
|||
|
|
v2FKNo: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
|
v2FactoryName: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
|
v2KPType: TcxGridDBColumn;
|
|||
|
|
VYB: TcxGridDBColumn;
|
|||
|
|
v2PayMent: TcxGridDBColumn;
|
|||
|
|
VBZ: TcxGridDBColumn;
|
|||
|
|
v2Column2: TcxGridDBColumn;
|
|||
|
|
v2Column3: TcxGridDBColumn;
|
|||
|
|
v2Column4: TcxGridDBColumn;
|
|||
|
|
v2Chkstatus: TcxGridDBColumn;
|
|||
|
|
v2Column1: TcxGridDBColumn;
|
|||
|
|
v2IFSC: TcxGridDBColumn;
|
|||
|
|
VHL: TcxGridDBColumn;
|
|||
|
|
VBB: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
SQType: TComboBox;
|
|||
|
|
v2DFQK: TcxGridDBColumn;
|
|||
|
|
v2DFQP: TcxGridDBColumn;
|
|||
|
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
|
cxStyle1: TcxStyle;
|
|||
|
|
cxStyle2: TcxStyle;
|
|||
|
|
v2Column6: TcxGridDBColumn;
|
|||
|
|
v2Column7: TcxGridDBColumn;
|
|||
|
|
v2Column8: TcxGridDBColumn;
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
procedure FactoryNameChange(Sender: TObject);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure ComTaitouChange(Sender: TObject);
|
|||
|
|
procedure TchkClick(Sender: TObject);
|
|||
|
|
procedure TNochkClick(Sender: TObject);
|
|||
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
|
procedure NochkClick(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
|
procedure v2SselPropertiesChange(Sender: TObject);
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
procedure InitGrid();
|
|||
|
|
procedure SetStatus();
|
|||
|
|
|
|||
|
|
public
|
|||
|
|
fflag:integer;
|
|||
|
|
{ Public declarations }
|
|||
|
|
RKFlag,FCYID,fmanage:String;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmFKChkList: TfrmFKChkList;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_Fun,U_FjList_RZ,U_RTFun;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.SetStatus();
|
|||
|
|
var
|
|||
|
|
i:integer;
|
|||
|
|
begin
|
|||
|
|
Tchk.Enabled:=false;
|
|||
|
|
TNochk.Enabled:=false;
|
|||
|
|
for i:=0 to tv2.ColumnCount-1 do
|
|||
|
|
begin
|
|||
|
|
IF uppercase(tv2.Columns[i].DataBinding.FieldName)<>'SSEL' then
|
|||
|
|
tv2.Columns[i].Options.Editing:=false;
|
|||
|
|
end;
|
|||
|
|
if cxTabControl1.TabIndex=0 then
|
|||
|
|
begin
|
|||
|
|
Tchk.Enabled:=true;
|
|||
|
|
end;
|
|||
|
|
if cxTabControl1.TabIndex=1 then
|
|||
|
|
begin
|
|||
|
|
TNochk.Enabled:=true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.InitGrid();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered:=False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' select A.*,KHZJM=dbo.getPinYin(A.FactoryName)');
|
|||
|
|
sql.Add(',IFSC=(Case when isnull((select Top 1 C.WBID from TP_File C where C.WBID=A.YFID),'''')='''' then '''' else ''<27><>'' end)');
|
|||
|
|
SQL.Add(',XTLJMoney=(select Sum((B.Money-isnull(B.FXMoney,0)-isnull(B.SXMoney,0))*B.QtyFlag) ');
|
|||
|
|
sql.add('from YF_Money_CR B where B.CRtype in (''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'') and isnull(B.status,''0'')<>''0''');
|
|||
|
|
sql.add(' and isnull(B.FeeType,'''')<>''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and B.FactoryName=A.FactoryName)');
|
|||
|
|
SQL.Add(',XTLJQP=(select Sum((B.Money-isnull(B.FXMoney,0)-isnull(B.SXMoney,0))*(case when B.CRtype=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' then 1 else -1 end)) ');
|
|||
|
|
sql.add('from YF_Money_CR B where B.CRtype in (''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'',''Ӧ<><D3A6><EFBFBD>Ʊ<EEB7A2>Ǽ<EFBFBD>'') and isnull(B.status,''0'')<>''0'' and B.KPType<>''<27><><EFBFBD><EFBFBD>Ʊ''');
|
|||
|
|
sql.add(' and isnull(B.FeeType,'''')<>''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and B.FactoryName=A.FactoryName)');
|
|||
|
|
sql.Add(' from YF_Money_CR A');
|
|||
|
|
sql.Add(' where A.CRTime>='''+FormatDateTime('yyyy-MM-dd',begdate.DateTime)+''' ');
|
|||
|
|
sql.Add(' and CRTime<'''+FormatDateTime('yyyy-MM-dd',Enddate.DateTime+1)+''' ');
|
|||
|
|
sql.Add(' and isnull(SQType,'''')<>'''' ');
|
|||
|
|
IF cxTabControl1.TabIndex=0 then
|
|||
|
|
sql.Add(' and A.status=''1'' ');
|
|||
|
|
IF cxTabControl1.TabIndex=1 then
|
|||
|
|
sql.Add(' and A.status=''2'' ');
|
|||
|
|
IF cxTabControl1.TabIndex=2 then
|
|||
|
|
sql.Add(' and A.status=''3'' ');
|
|||
|
|
//ShowMessage(sql.Text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
|||
|
|
label12.Caption:='0';
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
//ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmFKChkList:=nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action:=caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2',Tv2,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1');
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
procedure TfrmFKChkList.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
fflag:=0;
|
|||
|
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2',Tv2,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1');
|
|||
|
|
Enddate.DateTime:=SGetServerDate(ADOQueryTemp);
|
|||
|
|
begdate.DateTime:=SGetServerDateMBeg(ADOQueryTemp);
|
|||
|
|
VBZ.Visible:=true;
|
|||
|
|
SetStatus();
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
toolbar1.SetFocus;
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.ToolButton2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fsj:string;
|
|||
|
|
begin
|
|||
|
|
Label12.Caption:='0';
|
|||
|
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
|
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.FactoryNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.IsEmpty then Exit;
|
|||
|
|
SelExportData(Tv2,ADOQueryMain,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.ComTaitouChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.TchkClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
IF CDS_HZ.IsEmpty then exit;
|
|||
|
|
if CDS_HZ.Locate('ssel',true,[])=false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
IF Fieldbyname('ssel').AsBoolean=true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update YF_Money_CR SET status=''2'',Chker='''+trim(DName)+''',Chktime=getdate(),ChkStatus=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add('where YFID ='+quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.TNochkClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
IF CDS_HZ.IsEmpty then exit;
|
|||
|
|
if CDS_HZ.Locate('ssel',true,[])=false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
IF Fieldbyname('ssel').AsBoolean=true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update YF_Money_CR SET status=''1'',Chker=NUll,ChkStatus=Null,ChkTime=NUll ');
|
|||
|
|
sql.Add('where YFID ='+quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
sql.Add(' and isnull(status,'''')<>''3'' ');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.cxTabControl1Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SetStatus();
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.NochkClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
IF CDS_HZ.IsEmpty then exit;
|
|||
|
|
|
|||
|
|
if CDS_HZ.Locate('ssel',true,[])=false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
IF Fieldbyname('ssel').AsBoolean=true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update YF_Money_CR SET status=''0'',Chker='''+Trim(DName)+''',ChkTime=getdate()');
|
|||
|
|
sql.Add(',chkstatus=''<27><>ͨ<EFBFBD><CDA8>'' ');
|
|||
|
|
sql.Add('where YFID ='+quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
sql.Add(' and isnull(status,'''')<>''3'' ');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_HZ,True);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_HZ,false);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.CheckBox1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Label12.Caption:='0';
|
|||
|
|
IF CDS_HZ.IsEmpty then exit;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
first;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
fieldbyname('ssel').Value:=checkbox1.Checked;
|
|||
|
|
if checkbox1.Checked=true then
|
|||
|
|
begin
|
|||
|
|
Label12.Caption:=floattostr(strtofloat(Label12.Caption)+fieldbyname('Money').AsCurrency);
|
|||
|
|
end;
|
|||
|
|
post;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.v2SselPropertiesChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
HJ(CDS_HZ,Label12,CDS_HZ.fieldbyname('Money').AsCurrency);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFKChkList.ToolButton3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then Exit;
|
|||
|
|
try
|
|||
|
|
frmFjList_RZ:=TfrmFjList_RZ.Create(Application);
|
|||
|
|
with frmFjList_RZ do
|
|||
|
|
begin
|
|||
|
|
fkeyNO:=Trim(Self.CDS_HZ.fieldbyname('YFID').AsString);
|
|||
|
|
fType:='<27><>ͬ';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmFjList_RZ.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|