【delphi开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了delphi开源代码-MC_CNFDY.pas的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
unit MC_CNFDY;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
DBTables, Db, Grids, DBGrids, DBCtrls, StdCtrls, Buttons, Qrctrls,
QuickRpt, ExtCtrls;
type
TCNFDY = class(TForm)
GroupBox1: TGroupBox;
DBLookupComboBox1: TDBLookupComboBox;
GroupBox2: TGroupBox;
DBGrid1: TDBGrid;
GroupBox4: TGroupBox;
DBGrid2: TDBGrid;
DataSource1: TDataSource;
DataSource2: TDataSource;
Table2: TTable;
Table2BDEDesigner2: TStringField;
Table2BDEDesigner5: TIntegerField;
Table2BDEDesigner6: TStringField;
Table2BDEDesigner7: TStringField;
Table2BDEDesigner: TStringField;
Query1: TQuery;
Query1BDEDesigner: TStringField;
Query1BDEDesigner2: TStringField;
Table1: TTable;
Table1BDEDesigner: TStringField;
Table1BDEDesigner2: TStringField;
Table1BDEDesigner3: TStringField;
Table1BDEDesigner4: TStringField;
Table1BDEDesigner5: TStringField;
Table1BDEDesigner6: TStringField;
Table1BDEDesigner7: TStringField;
DataSource3: TDataSource;
GroupBox3: TGroupBox;
GroupBox5: TGroupBox;
ComboBox1: TComboBox;
Label1: TLabel;
ComboBox2: TComboBox;
Edit1: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
DBGrid3: TDBGrid;
Query2: TQuery;
DataSource4: TDataSource;
QuickRep1: TQuickRep;
PageHeaderBand1: TQRBand;
QRLabel1: TQRLabel;
QRShape1: TQRShape;
TitleBand1: TQRBand;
QRShape2: TQRShape;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRLabel4: TQRLabel;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRShape9: TQRShape;
QRShape10: TQRShape;
DetailBand1: TQRBand;
QRShape11: TQRShape;
QRShape12: TQRShape;
QRShape13: TQRShape;
QRShape14: TQRShape;
QRShape15: TQRShape;
QRShape16: TQRShape;
QRShape17: TQRShape;
QRShape18: TQRShape;
QRShape19: TQRShape;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
QRDBText9: TQRDBText;
SummaryBand1: TQRBand;
QRShape20: TQRShape;
QRLabel11: TQRLabel;
QRExpr1: TQRExpr;
QRLabel12: TQRLabel;
QRExpr2: TQRExpr;
Query2BDEDesigner: TStringField;
Query2BDEDesigner2: TStringField;
Query2BDEDesigner3: TFloatField;
Query2BDEDesigner4: TDateTimeField;
Query2BDEDesigner5: TDateTimeField;
Query2BDEDesigner6: TFloatField;
Query2BDEDesigner7: TFloatField;
Query2BDEDesigner8: TFloatField;
Query2BDEDesigner9: TFloatField;
Query2BDEDesigner10: TFloatField;
Query2BDEDesigner11: TStringField;
Query2BDEDesigner12: TStringField;
Table1BDEDesigner8: TStringField;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure QuickRep1Preview(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure DBGrid1DblClick(Sender: TObject);
procedure DBGrid2DblClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
CNFDY: TCNFDY;
implementation
uses MC_DYYLBrose;
{$R *.DFM}
procedure TCNFDY.FormClose(Sender: TObject; var Action: TCloseAction);
begin
CNFDY.Release;
CNFDY:=Nil;
end;
procedure TCNFDY.FormShow(Sender: TObject);
begin
ComboBox1.ItemIndex:=0;
ComboBox2.ItemIndex:=0;
end;
procedure TCNFDY.BitBtn3Click(Sender: TObject);
begin
Close;
end;
procedure TCNFDY.BitBtn1Click(Sender: TObject);
begin
if ComboBox2.Text='Like' then
if Edit1.Text='*' then
begin
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add('Select * From 采暖费');
Query2.Open;
end
else
begin
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add('Select * From 采暖费');
Query2.SQL.Add('Where '+Combobox1.Items[ComboBox1.ItemIndex]+' Like '''+Edit1.Text+'%''');
Query2.Open;
end;
if comboBox2.Text='=' then
with Query2 do begin
close;
SQL.Clear;
SQL.Add('Select * From 采暖费');
SQL.Add('Where '+ComboBox1.Items[ComboBox1.ItemIndex]+' = '''
+Edit1.Text+'''');
Open; end;
if ComboBox2.Text='>' then
With Query2 do begin
Close;
SQL.Clear;
SQL.Add('Select * From 采暖费');
SQL.Add('Where '+comboBox1.Items[ComboBox1.ItemIndex]+' > '''
+Edit1.Text+'''');
Open; end;
if ComboBox2.Text='<' then
with Query2 do Begin
Close;
SQL.Clear;
SQL.Add('Select * From 采暖费');
SQL.Add('Where '+ComboBox1.Items[ComboBox1.ItemIndex]+' < '''
+Edit1.Text+'''');
Open; end;
end;
procedure TCNFDY.QuickRep1Preview(Sender: TObject);
begin
DYYLBrose.QRPreview1.QRPrinter:=QuickRep1.QRPrinter;
end;
procedure TCNFDY.BitBtn2Click(Sender: TObject);
begin
if Query2.Active then
if Query2.RecordCount<>0 then
begin
DYYLBrose.Show;
QUickRep1.Preview;
end;
end;
procedure TCNFDY.DBGrid1DblClick(Sender: TObject);
begin
if Table2.RecordCount<>0 then
begin
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add('Select * From 采暖费');
Query2.SQL.Add('Where 采暖费编号 in (');
Query2.SQL.Add('Select 房间编号 From 房屋信息表 ');
Query2.SQL.Add('Where 区名=:A and 大楼名=:B)');
Query2.ParamByName('A').AsString:=Query1.FieldByName('小区名').AsString;
Query2.ParamByName('B').AsString:=Table2.FieldByName('大楼名称').AsString;
Query2.Open;
end;
end;
procedure TCNFDY.DBGrid2DblClick(Sender: TObject);
begin
if Table2.RecordCount<>0 then
begin
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add('Select * From 采暖费');
Query2.SQL.Add('Where 采暖费编号=:A');
Query2.ParamByName('A').AsString:=Table1.FieldByName('房间编号').AsString;
Query2.Open;
end;
end;
end.
上一篇:
MC_CNFCSH.pas
下一篇:
投简历到国外的公司需考虑哪些东西?