⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mc_fwxxscq.pas

📁 delph6.0关于物业管理的源码.rar
💻 PAS
字号:
unit MC_FWXXSCQ;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, DBTables, DBCtrls, StdCtrls, Grids, DBGrids, ComCtrls, ExtCtrls,
  Buttons;

type
  TFWXXSCQ = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    DBLookupComboBox1: TDBLookupComboBox;
    DataSource1: TDataSource;
    Query1: TQuery;
    Query1BDEDesigner: TStringField;
    Query1BDEDesigner2: TStringField;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    Table1: TTable;
    DataSource2: TDataSource;
    Table1BDEDesigner: TStringField;
    Table1BDEDesigner2: TStringField;
    Table1BDEDesigner3: TStringField;
    DBGrid1: TDBGrid;
    Bevel1: TBevel;
    Label11: TLabel;
    Label12: TLabel;
    Label9: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    DBLookupComboBox2: TDBLookupComboBox;
    DBLookupComboBox3: TDBLookupComboBox;
    DBLookupComboBox4: TDBLookupComboBox;
    DBLookupComboBox5: TDBLookupComboBox;
    DBLookupComboBox6: TDBLookupComboBox;
    DataSource3: TDataSource;
    Query2: TQuery;
    Query2BDEDesigner: TStringField;
    DataSource4: TDataSource;
    Query3: TQuery;
    Query3BDEDesigner: TStringField;
    DataSource5: TDataSource;
    Query4: TQuery;
    Query4BDEDesigner: TStringField;
    DataSource6: TDataSource;
    Query5: TQuery;
    Query5BDEDesigner: TStringField;
    DataSource7: TDataSource;
    Query6: TQuery;
    Query6BDEDesigner: TStringField;
    Bevel2: TBevel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Bevel3: TBevel;
    Label4: TLabel;
    Query7: TQuery;
    Label5: TLabel;
    Label6: TLabel;
    Edit3: TEdit;
    UpDown3: TUpDown;
    Edit4: TEdit;
    UpDown4: TUpDown;
    Label10: TLabel;
    Edit5: TEdit;
    UpDown5: TUpDown;
    Label13: TLabel;
    Edit6: TEdit;
    UpDown6: TUpDown;
    procedure BitBtn2Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FWXXSCQ: TFWXXSCQ;

implementation

uses MC_MainForm;

{$R *.DFM}

procedure TFWXXSCQ.FormShow(Sender: TObject);
begin
  DBLookupComboBox1.KeyValue:=Query1.FieldByName('小区名').AsString;
  DBLookupComboBox2.KeyValue:=Query2.FieldByName('房屋朝向').AsString;
  DBLookupComboBox3.KeyValue:=Query3.FieldByName('权属类型').AsString;
  DBLookupComboBox4.KeyValue:=Query4.FieldByName('房间结构').AsString;
  DBLookupComboBox5.KeyValue:=Query5.FieldByName('配备信息').AsString;
  DBLookupComboBox6.KeyValue:=Query6.FieldByName('房间类别').AsString;
  if MainForm.Query1.Locate('使用选项','房屋信息生成',[loCaseInsensitive]) then
  begin
     if MainForm.Query1.FieldByname('读写').AsString='读' then
     begin
       Bitbtn1.Enabled:=False;
     end;
  end;
end;

procedure TFWXXSCQ.BitBtn1Click(Sender: TObject);
var FJH,a,b,c:integer;
begin
For a:=StrToInt(Edit3.Text) to StrToInt(Edit4.Text) do
  begin
  For b:=1 to StrToInt(Edit5.Text) do
    begin
    For c:=1 to StrToInt(Edit6.Text) do
      begin
       Query7.Close;
       Query7.SQL.Clear;
       Query7.SQL.Add('Insert 房屋信息表(房间编号,区名,大楼编号,大楼名,房间号码,朝向,权属类型,房间结构,配备设施,房间类别,单元,楼层)');
       Query7.SQL.Add('Values(:A,:B,:N1,:C,:D,:E,:F,:G,:H,:J,:M,:N)');
       Query7.ParamByName('A').AsString:=DBLookupComboBox1.keyValue
          +Table1.FieldByName('大楼名称').AsString
          +IntToStr(a)+IntToStr(b)+'0'+IntToStr(C);
       Query7.ParamByName('B').AsString:=DBLookupComboBox1.KeyValue;
       Query7.ParamByName('C').AsString:=Table1.FieldbyName('大楼名称').AsString;
       Query7.ParamByName('D').AsString:=IntToStr(a)+IntToStr(b)+'0'+IntToStr(C);
       Query7.ParamByName('E').AsString:=DBLookupComboBox2.KeyValue;
       Query7.ParamByName('F').AsString:=DBLookupComboBox3.KeyValue;
       Query7.ParamByName('G').AsString:=DBLookupComboBox4.KeyValue;
       Query7.ParamByName('H').AsString:=DBLookupComboBox5.KeyValue;
       Query7.ParamByName('J').AsString:=DBLookupComboBox6.KeyValue;
       Query7.ParamByName('M').AsSTring:=IntToStr(a);
       Query7.ParamByName('N').AsString:=IntTostr(b);
       Query7.ParamByName('N1').AsString:=Table1.FieldByName('大楼编号').AsString;
       Try
          Query7.ExecSQL;
       Except
         begin
           ShowMessage('重复房间号,此房屋已存在.');
           Exit;
         end;
       end;
      end;
    end;
  end;
ShowMessage('生成完毕');
end;
procedure TFWXXSCQ.BitBtn2Click(Sender: TObject);
begin
   Close;
end;

procedure TFWXXSCQ.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  FWXXSCQ.Release;
  FWXXSCQ:=Nil;
end;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -