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

📄 realtyb111a.pas

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

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_RealtyB111A = class(TForm)
    Button5: TButton;
    Button6: TButton;
    Label8: TLabel;
    Edit2: TEdit;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    Label1: TLabel;
    Label3: TLabel;
    Edit3: TEdit;
    Edit5: TEdit;
    Edit4: TEdit;
    Label10: TLabel;
    Label5: TLabel;
    Label2: TLabel;
    CheckBox1: TCheckBox;
    procedure FormCreate(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure Button6Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure ComboBox1Select(Sender: TObject);
   
  private
    { Private declarations }
  public
    { Public declarations }
      bOK,bOK2:bool;
      bMod:bool;
      sNum:string;
  end;

var
  f_RealtyB111A: Tf_RealtyB111A;


implementation

uses data, main,RealtyB22A,Car4s931;

{$R *.dfm}

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

     ComboBox1.Items.Add('新增开户银行');
     query.SQL.Add('select distinct 名称 from 辅助资料 where 类别='''+'开户银行'+'''');
     query.Open;
     while not query.Eof do
     begin
         ComboBox1.Items.Add(query.fieldbyname('名称').Value);
         query.next;
     end;

     ComBoBox2.Items.Add('个人');
     ComBoBox2.Items.Add('公家');

     if f_RealtyB22A.bMod then
     begin

              edit2.Text:=f_RealtyB22A.ListView1.Selected.Caption;
              combobox1.ItemIndex:=combobox1.Items.IndexOf(f_RealtyB22A.ListView1.Selected.SubItems[0]);
              edit3.Text:=f_RealtyB22A.ListView1.Selected.SubItems[1];
              combobox2.ItemIndex:=combobox2.Items.IndexOf(f_RealtyB22A.ListView1.Selected.SubItems[2]);
              edit4.Text:=f_RealtyB22A.ListView1.Selected.SubItems[3];
              if f_RealtyB22A.ListView1.Selected.SubItems[4]<>'N' then checkbox1.Checked:=true
              else checkbox1.Checked:=false;
              edit5.Text:=f_RealtyB22A.ListView1.Selected.SubItems[5];

     end;


end;

//Tab
procedure Tf_RealtyB111A.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_RealtyB111A.Button5Click(Sender: TObject);
Var
    s:string;
begin
    if edit2.Text='' then
    begin
        showmessage('开户名称不能为空!');
        edit2.SetFocus;
        exit;
    end;
    if edit3.Text='' then edit3.Text:='-';
    if edit4.Text='' then edit4.Text:='-';
    if edit5.Text='' then edit5.Text:='-';

    if f_RealtyB22A.bMod then
    begin
        if checkbox1.Checked then s:='Y'
        else s:='N';

        with f_RealtyB22A.ListView1.Selected do
        begin
            Caption:=edit2.Text;
            subitems[0]:=comboBox1.Text;
            subitems[1]:=edit3.Text;
            subitems[2]:=comboBox2.Text;
            subitems[3]:=edit4.Text;
            subitems[4]:=s;
            subitems[5]:=edit5.Text;
        end;
        close;
    end
    else
    begin
        if checkbox1.Checked then s:='Y'
        else s:='N';

        with f_RealtyB22A.ListView1.Items.Add do
        begin
            Caption:=edit2.Text;
            subitems.Add(comboBox1.Text);
            subitems.Add(edit3.Text);
            subitems.Add(comboBox2.Text);
            subitems.Add(edit4.Text);
            subitems.Add(s);
            subitems.Add(edit5.Text);
        end;
        edit2.Text:='';
        edit3.Text:='';
        edit4.Text:='';
        edit5.Text:='';
        combobox1.ItemIndex:=combobox1.Items.IndexOf('');
        combobox2.ItemIndex:=combobox2.Items.IndexOf('');
        edit2.SetFocus;
    end;

end;


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

procedure Tf_RealtyB111A.ComboBox1Select(Sender: TObject);
begin
    if ComboBox1.Text='新增开户银行' then
    begin
        mainform.t1:='开户银行';
        f_Car4s931:=Tf_Car4s931.Create(self);
        f_Car4s931.showmodal;

        if f_Car4s931.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 + -