如题,初来乍到,请各位大侠帮忙
解决方案 »
- DELPHI2010 DATASNAP 心跳包 TCP HTTP
- 存储空间不足,无法处理命令
- 公交查询系统问换乘问题
- 在 WebBrowser 中直接显示 mhtml 字符串(或流)中的内容
- ModalResult的问题,如果设置成了mrOk,怎么写代码控制让单击此按钮后不关闭窗口?
- 请教:Stringgrid单元格背景色与表中字段的关联
- 怎样下载协议为rtsp或mms格式的文件?(高分)
- 请大家看下invalid floating point operation原因
- 加密、解密的问题
- 请教高手 dephi 一个应用里怎么样关闭另一个一打开的应用?
- TcxDBTreeList 控件怎样设置选中后反色?
- 请教,我该如何建立这样的系统?
begin
Application.Terminate; Exit;
end;
以前做的程序这样子都没问题的
begin
Action:=cafree;end;
这样子不知道合适么,以前都不出问题的
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, SUIForm, cxStyles, cxCustomData, cxGraphics, cxFilter,
cxData, cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxClasses,
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxGrid, StdCtrls, RzCmboBx, SUIButton, RzLabel, ADODB,
dateutils, Mask, RzEdit, cxCurrencyEdit, frxClass, frxDBSet;type
Tfrm_kf_ck = class(TForm)
suiForm1: TsuiForm;
cxGrid1DBTableView1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid1: TcxGrid;
RzComboBox1: TRzComboBox;
RzComboBox2: TRzComboBox;
RzLabel1: TRzLabel;
RzLabel2: TRzLabel;
suiButton1: TsuiButton;
suiButton2: TsuiButton;
suiButton3: TsuiButton;
suiButton4: TsuiButton;
suiButton5: TsuiButton;
ADOQuery_ck: TADOQuery;
ADOQuery_temp: TADOQuery;
ADOConnection_kf: TADOConnection;
DataSource_ck: TDataSource;
cxStyleRepository1: TcxStyleRepository;
cxStyle1: TcxStyle;
cxStyleRepository2: TcxStyleRepository;
cxStyle2: TcxStyle;
cxStyleRepository3: TcxStyleRepository;
cxStyle3: TcxStyle;
RzLabel3: TRzLabel;
RzLabel4: TRzLabel;
RzLabel5: TRzLabel;
RzEdit1: TRzEdit;
RzEdit2: TRzEdit;
RzEdit3: TRzEdit;
suiButton6: TsuiButton;
cxGrid1DBTableView1F_CKRQ: TcxGridDBColumn;
cxGrid1DBTableView1F_CKDH: TcxGridDBColumn;
cxGrid1DBTableView1F_HTBH: TcxGridDBColumn;
cxGrid1DBTableView1F_CPBH: TcxGridDBColumn;
cxGrid1DBTableView1F_CPSH: TcxGridDBColumn;
cxGrid1DBTableView1F_TLPC: TcxGridDBColumn;
cxGrid1DBTableView1F_CPDJ: TcxGridDBColumn;
cxGrid1DBTableView1F_CPJC: TcxGridDBColumn;
cxGrid1DBTableView1F_CPPH: TcxGridDBColumn;
cxGrid1DBTableView1F_CPFL: TcxGridDBColumn;
cxGrid1DBTableView1F_DWDM: TcxGridDBColumn;
cxGrid1DBTableView1F_DW: TcxGridDBColumn;
cxGrid1DBTableView1F_FPBH: TcxGridDBColumn;
cxGrid1DBTableView1F_JTBH: TcxGridDBColumn;
cxGrid1DBTableView1F_CPJG: TcxGridDBColumn;
cxGrid1DBTableView1F_FH: TcxGridDBColumn;
cxGrid1DBTableView1F_CPKW: TcxGridDBColumn;
cxGrid1DBTableView1F_XH: TcxGridDBColumn;
cxGrid1DBTableView1F_BH: TcxGridDBColumn;
cxGrid1DBTableView1F_TZ: TcxGridDBColumn;
RzDateTimeEdit1: TRzDateTimeEdit;
RzLabel6: TRzLabel;
RzEdit4: TRzEdit;
RzEdit5: TRzEdit;
RzEdit6: TRzEdit;
cxStyleRepository4: TcxStyleRepository;
cxStyle4: TcxStyle;
suiButton7: TsuiButton;
suiButton8: TsuiButton;
RzEdit7: TRzEdit;
RzLabel7: TRzLabel;
ADOQuery1: TADOQuery;
frxDBDataset1: TfrxDBDataset;
frxReport1: TfrxReport;
procedure FormCreate(Sender: TObject);
procedure suiButton1Click(Sender: TObject);
procedure suiButton3Click(Sender: TObject);
procedure suiButton6Click(Sender: TObject);
procedure suiButton4Click(Sender: TObject);
procedure suiButton2Click(Sender: TObject);
procedure suiButton5Click(Sender: TObject);
procedure suiButton7Click(Sender: TObject);
procedure suiButton8Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;procedure MainFormset(a_Width,a_Height,a_Left,a_Top:integer);var
frm_kf_ck: Tfrm_kf_ck;implementationuses MDI_kf_ck_add,MDI_kf_ck;{$R *.dfm}
//***********************窗体设置函数*********************************************
procedure MainFormset(a_Width,a_Height,a_Left,a_Top:integer);
begin
application.MainForm.Width:=a_Width;
application.MainForm.Height:=a_Height;
application.MainForm.Left:=a_Left;
application.MainForm.Top:=a_Top;
end;//***********************窗体初始化***********************************************
procedure Tfrm_kf_ck.FormCreate(Sender: TObject);
begin
MainFormset(1024,740,0,0);
Application.Title:='库房出库';
RzComboBox1.Text:=IntToStr(YearOf(Now));
RzComboBox2.Text:=IntToStr(MonthOf(Now));
if length(RzComboBox2.Text)=1 then
begin
RzComboBox2.Text:='0'+RzComboBox2.Text;
end;
with ADOQuery_ck do
begin
Close;
SQL.Clear;
SQL.Add('select * from kfck'+RzComboBox1.Text+RzComboBox2.Text);
Open;
end;
RzEdit5.Text:=IntToStr(ADOQuery_ck.RecordCount);
end;//********************** 退出按钮点击事件 ****************************************
procedure Tfrm_kf_ck.suiButton1Click(Sender: TObject);
begin
Application.Terminate; Exit;
//frm_kf_ck.Close;
//PostMessage(handle,WM_CLOSE,0,0);
end;//********************** 添加按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton3Click(Sender: TObject);
begin
Application.CreateForm(Tfrm_kf_ck_add, frm_kf_ck_add);
end;//********************** 筛选按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton6Click(Sender: TObject);
begin
with ADOQuery_ck do
begin
Close;
SQL.Clear;
SQL.Add('select * from kfck'+RzComboBox1.Text+RzComboBox2.Text
+' where f_ckdh like ''%'+RzEdit1.Text+'%'''
+' and f_cpbh like ''%'+RzEdit2.Text+'%'''
+' and f_cpsh like ''%'+RzEdit3.Text+'%''');
if RzDateTimeEdit1.Text<>'' then
SQL.Add(' and f_ckrq='''+RzDateTimeEdit1.Text+'''');
Open;
end;
RzEdit5.Text:=IntToStr(ADOQuery_ck.RecordCount);
end;//********************** 编辑按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton4Click(Sender: TObject);
begin
// ADOQuery_ck.Edit;
end;//********************** 确定按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton2Click(Sender: TObject);
begin
with ADOQuery_ck do
begin
Close;
SQL.Clear;
SQL.Add('select * from kfck'+RzComboBox1.Text+RzComboBox2.Text);
Open;
end;
RzEdit5.Text:=IntToStr(ADOQuery_ck.RecordCount);
end;//********************** 删除按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton5Click(Sender: TObject);
begin
// ADOQuery_ck.Delete;
end;//********************** 读入按钮点击事件*****************************************
procedure Tfrm_kf_ck.suiButton7Click(Sender: TObject);
begin
Application.CreateForm(Tfrm_kf_ck_dao, frm_kf_ck_dao);
end;//********************** 打印按钮事件 ********************************************
procedure Tfrm_kf_ck.suiButton8Click(Sender: TObject);
begin
with ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('select * from kfck'+RzComboBox1.Text+RzComboBox2.Text
+' where f_ckdh='''+RzEdit7.Text+'''');
Open;
end;
frxReport1.Clear;
frxReport1.LoadFromFile('D:\smii\SMI_XS\deploy\CKMD.fr3');
frxReport1.PrepareReport;
frxReport1.ShowPreparedReport;
end;procedure Tfrm_kf_ck.FormClose(Sender: TObject; var Action: TCloseAction);
begin
frxReport1.Clear;
Action:=cafree;end;end.