RTFormwork/项目代码/RTBasicsV1/A09财务通用管理/U_BankFlowTotalList.pas
“ddf” 61630656e9 1
2024-07-07 09:35:27 +08:00

195 lines
5.6 KiB
ObjectPascal

unit U_BankFlowTotalList;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxEdit, DB, cxDBData, DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu,
cxPC, StdCtrls, ComCtrls, ExtCtrls, cxGridLevel, cxGridCustomTableView,
cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView,
cxGrid, ToolWin, cxCalendar, cxCurrencyEdit, cxTextEdit, cxLookAndFeels,
cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, cxNavigator,
dxDateRanges, dxBarBuiltInMenu, U_BaseList, dxSkinBasic, 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, dxSkinOffice2016Colorful, dxSkinOffice2016Dark,
dxSkinOffice2019Black, dxSkinOffice2019Colorful, dxSkinOffice2019DarkGray,
dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinValentine,
dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark,
dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint, dxSkinWXI,
dxSkinXmas2008Blue, dxScrollbarAnnotations, cxContainer, dxCore, cxDateUtils,
cxMaskEdit, cxDropDownEdit;
type
TfrmBankFlowTotalList = class(TfrmBaseList)
ToolBar1: TToolBar;
TINIT: TToolButton;
TGLV: TToolButton;
TCLOSE: TToolButton;
cxGrid1: TcxGrid;
TV1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
DataSource1: TDataSource;
AdoQueryTmp: TADOQuery;
ADOQueryCmd: TADOQuery;
cxGridPopupMenu1: TcxGridPopupMenu;
CDS_Main: TClientDataSet;
V1YEMoney: TcxGridDBColumn;
V1Column9: TcxGridDBColumn;
TV1Column2: TcxGridDBColumn;
Panel1: TPanel;
Label2: TLabel;
Label1: TLabel;
TV1Column3: TcxGridDBColumn;
ToolButton1: TToolButton;
Label3: TLabel;
begdate: TcxDateEdit;
BKName: TcxTextEdit;
cxTextEdit1: TcxTextEdit;
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TCLOSEClick(Sender: TObject);
procedure TINITClick(Sender: TObject);
procedure TGLVClick(Sender: TObject);
procedure GSTaiTouChange(Sender: TObject);
procedure cxTabControl1Change(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure ToolButton1Click(Sender: TObject);
procedure cxTextEdit1KeyPress(Sender: TObject; var Key: Char);
procedure BKNameClick(Sender: TObject);
private
procedure initGrid();
{ Private declarations }
public
{ Public declarations }
end;
var
frmBankFlowTotalList: TfrmBankFlowTotalList;
implementation
uses
U_DataLink, U_RTFun;
{$R *.dfm}
procedure TfrmBankFlowTotalList.InitGrid();
begin
with AdoQueryTmp do
begin
close;
sql.Clear;
sql.Add('exec P_Bank_Balance ');
sql.Add('@ExchangeRate=' + FloatToStr(strtofloatdef(cxTextEdit1.Text, 0)));
sql.Add(',@BFTime=' + quotedstr(formatdateTime('yyyy-MM-dd', begdate.Date)));
open;
end;
SCreateCDS(ADOQueryTmp, CDS_Main);
SInitCDSData(ADOQueryTmp, CDS_Main);
TV1.DataController.Filter.Clear;
CDS_Main.Last;
end;
procedure TfrmBankFlowTotalList.BKNameClick(Sender: TObject);
begin
inherited;
tglv.Click;
end;
procedure TfrmBankFlowTotalList.FormCreate(Sender: TObject);
begin
inherited;
cxgrid1.Align := alclient;
end;
procedure TfrmBankFlowTotalList.FormShow(Sender: TObject);
begin
inherited;
ReadCxGrid(self.Caption + tv1.Name, Tv1);
// enddate.datetime := SGetServerDateTime(ADOQueryTmp);
begdate.date := SGetServerDateTime(ADOQueryTmp);
initGrid();
end;
procedure TfrmBankFlowTotalList.FormDestroy(Sender: TObject);
begin
inherited;
frmBankFlowTotalList := nil;
end;
procedure TfrmBankFlowTotalList.cxTextEdit1KeyPress(Sender: TObject; var Key: Char);
begin
inherited;
if Key = #13 then
begin
InitGrid();
end;
end;
procedure TfrmBankFlowTotalList.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
InitGrid();
end;
end;
procedure TfrmBankFlowTotalList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
Action := cafree;
end;
procedure TfrmBankFlowTotalList.TCLOSEClick(Sender: TObject);
begin
close;
end;
procedure TfrmBankFlowTotalList.TINITClick(Sender: TObject);
begin
InitGrid();
end;
procedure TfrmBankFlowTotalList.ToolButton1Click(Sender: TObject);
begin
writeCxGrid(self.Caption + tv1.Name, Tv1);
end;
procedure TfrmBankFlowTotalList.TGLVClick(Sender: TObject);
begin
SDofilter(AdoQueryTmp, SGetFilters(Panel1, 1, 0));
SCreateCDS(AdoQueryTmp, CDS_Main);
SInitCDSData(AdoQueryTmp, CDS_Main);
end;
procedure TfrmBankFlowTotalList.GSTaiTouChange(Sender: TObject);
begin
SDofilter(AdoQueryTmp, SGetFilters(Panel1, 1, 0));
SCreateCDS(AdoQueryTmp, CDS_Main);
SInitCDSData(AdoQueryTmp, CDS_Main);
end;
procedure TfrmBankFlowTotalList.cxTabControl1Change(Sender: TObject);
begin
initGrid();
end;
end.