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

📄 realtyb121b.pas

📁 物业管理系统系统特点 一、 实现集中式管理 系统将集团公司、各分公司、各物业管理处连接到一起
💻 PAS
字号:
unit RealtyB121B;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, dbcgrids, Grids, DBGrids, DB, ADODB, StdCtrls, Buttons, ExtCtrls,
  StrUtils, ExtDlgs, ComCtrls, math;

type
    Tf_RealtyB121B = class(TForm)
    Button5: TButton;
    Button6: TButton;
    Label8: TLabel;
    Edit1: TEdit;
    ComboBox1: TComboBox;
    Label3: TLabel;
    Edit2: TEdit;
    Edit4: TEdit;
    Edit3: TEdit;
    Label10: TLabel;
    Label5: TLabel;
    Label2: TLabel;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure Button6Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure ComboBox1Select(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
      bOK,bOK2:bool;
      bMod:bool;
      sNum:string;
  end;

var
  f_RealtyB121B: Tf_RealtyB121B;


implementation

uses data, main,RealtyB12B,RealtyL23,Newhouse;

{$R *.dfm}

//初始化
procedure Tf_RealtyB121B.FormCreate(Sender: TObject);
Var
    query:TADOQuery;
begin
    query:=TADOQuery.Create(nil);
    query.Connection:=DataModuleADO.ADOConnection1;

    combobox1.Items.Add('新增房产验收项目');
    
    query.sql.Add('select * from 房产验收项目 where 类别='''+'房间验收'+'''');
    query.Open;
    while not query.Eof do
    begin
         ComboBox1.Items.Add(query.fieldbyname('名称').Value);
         query.Next;
    end;
    query.Close;
    query.free;

    if f_RealtyB12B.bnew=false then
    begin
        combobox1.ItemIndex:=combobox1.Items.IndexOf(f_RealtyB12B.listview1.Selected.Caption);
        edit1.Text:=f_RealtyB12B.listview1.Selected.SubItems[0];
        edit2.Text:=f_RealtyB12B.listview1.Selected.SubItems[1];
        edit3.Text:=f_RealtyB12B.listview1.Selected.SubItems[2];
        edit4.Text:=f_RealtyB12B.listview1.Selected.SubItems[3];
    end;
end;

//Tab
procedure Tf_RealtyB121B.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
    if key=13 then
        Begin
            key:=0;
            perform(WM_NEXTDLGCTL,0,0);
        end
    else if key=VK_ESCAPE then close;
end;

//确定
procedure Tf_RealtyB121B.Button5Click(Sender: TObject);
Var
    s:string;
begin
    if edit1.Text='' then edit1.Text:='-';
    if edit2.Text='' then edit2.Text:='-';
    if edit3.Text='' then edit3.Text:='-';
    if edit4.Text='' then edit4.Text:='-';

    if f_RealtyB12B.bnew=true then
    begin
        with f_RealtyB12B.ListView1.Items.Add do
        begin
            Caption:=comboBox1.Text;
            subitems.Add(edit1.Text);
            subitems.Add(edit2.Text);
            subitems.Add(edit3.Text);
            subitems.Add(edit4.Text);
        end;

        edit1.Text:='';
        edit2.Text:='';
        edit3.Text:='';
        edit4.Text:='';
        ComboBox1.setFocus;
    end;

    if f_RealtyB12B.bnew=false then
    begin
        with f_RealtyB12B.ListView1.Selected do
        begin
            Caption:=comboBox1.Text;
            subitems[0]:=edit1.Text;
            subitems[1]:=edit2.Text;
            subitems[2]:=edit3.Text;
            subitems[3]:=edit4.Text;
        end;
    end;
end;


//退出
procedure Tf_RealtyB121B.Button6Click(Sender: TObject);
begin
    Close;
end;   

procedure Tf_RealtyB121B.Button1Click(Sender: TObject);
begin
     f_RealtyL23:=Tf_RealtyL23.Create(self);
     f_RealtyL23.Button2.Visible:=true;
     f_RealtyL23.ShowModal;

     if  f_RealtyL23.bOk=true then
     begin
         edit2.Text:=f_RealtyL23.sName;
     end;
end;

procedure Tf_RealtyB121B.ComboBox1Select(Sender: TObject);
begin
    if ComboBox1.Text='新增房产验收项目' then
    begin
        f_Newhouse:=Tf_Newhouse.Create(self);
        f_Newhouse.showmodal;

        if f_Newhouse.bOK=true then
        begin
            ComboBox1.Items.Add(mainform.t1);
            ComboBox1.ItemIndex:=ComboBox1.Items.IndexOf(mainform.t1);
        end
        else ComboBox1.ItemIndex:=ComboBox1.Items.IndexOf('');
    end;
end;

end.

⌨️ 快捷键说明

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