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

📄 realtyf11a.pas

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

interface

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

type
    Tf_RealtyF11A = class(TForm)
    L1: TLabel;
    L2: TLabel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Edit1: TEdit;
    edit4: TEdit;
    Edit3: TEdit;
    Label4: TLabel;
    edit5: TEdit;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Edit9: TEdit;
    Label9: TLabel;
    Edit10: TEdit;
    edit2: TDateTimePicker;
    edit7: TDateTimePicker;
    edit8: TComboBox;
    edit6: TComboBox;
    button1: TButton;
    Button2: TButton;
    Button3: TButton;
    CheckBox1: TCheckBox;
    Button7: TButton;
    Button5: TButton;
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure Button2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ToolButton10Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure button1Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);

  private
    { Private declarations }
  public
    { Public declarations }
       bOK:bool;
       T:string;
  end;

var
  f_RealtyF11A: Tf_RealtyF11A;
  sNum:string;

implementation

uses data, main,RealtyF11,Car4s931,RealtyL23,realtyI11C;

{$R *.dfm}


procedure Tf_RealtyF11A.FormCreate(Sender: TObject);
var
    i:integer;
    query:TADOQuery;
    s:string;
begin
    Query:=TADOQuery.Create(nil);
    Query.Connection:=DataModuleADO.ADOConnection1;

    edit8.Items.Add('满意');
    edit8.Items.Add('不满意');
    edit8.Items.Add('非常满意');
    edit8.Items.Add('非常不满意');

    query.SQL.Add('select * from 辅助资料 where 类别 ='''+'回访方式'+'''');
    query.Open;
    while not query.Eof do
    begin
        edit6.Items.Add(query.fieldbyname('名称').Value);
        query.Next;
    end;


    if f_RealtyF11.bnew=true then
    begin
        edit2.date:=date;
        edit7.date:=date;
    end;

    if f_RealtyF11.bnew=false then
    begin
        edit1.Text:=f_RealtyF11.ListView1.Selected.Caption;
        edit2.date:=strtodate(f_RealtyF11.ListView1.Selected.SubItems[0]);
        edit3.Text:=f_RealtyF11.ListView1.Selected.SubItems[1];
        if f_RealtyF11.ListView1.Selected.SubItems[3]='Y' then checkbox1.Checked:=true
        else checkbox1.Checked:=false;
        edit4.Text:=f_RealtyF11.ListView1.Selected.SubItems[3];
        edit5.Text:=f_RealtyF11.ListView1.Selected.SubItems[4];
        edit6.ItemIndex:=edit6.Items.IndexOf(f_RealtyF11.ListView1.Selected.SubItems[5]);
        edit7.date:=strtodate(f_RealtyF11.ListView1.Selected.SubItems[6]);
        edit8.ItemIndex:=edit8.Items.IndexOf(f_RealtyF11.ListView1.Selected.SubItems[7]);
        edit9.Text:=f_RealtyF11.ListView1.Selected.SubItems[8];
        edit10.Text:=f_RealtyF11.ListView1.Selected.SubItems[9];
    end;
end;

//Tab
procedure Tf_RealtyF11A.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_RealtyF11A.Button2Click(Sender: TObject);
begin
    f_RealtyL23:=Tf_RealtyL23.Create(self);
   f_RealtyL23.Button2.Visible:=true;
   f_RealtyL23.ShowModal;

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

procedure Tf_RealtyF11A.ToolButton10Click(Sender: TObject);
begin
    close;
end;
//新增
procedure Tf_RealtyF11A.Button3Click(Sender: TObject);
begin
    f_RealtyL23:=Tf_RealtyL23.Create(self);
   f_RealtyL23.Button2.Visible:=true;
   f_RealtyL23.ShowModal;

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

procedure Tf_RealtyF11A.button1Click(Sender: TObject);
begin
    f_realtyI11C:=Tf_realtyI11C.Create(self);
    f_RealtyI11C.button1.Visible:=true;
    f_realtyI11C.ShowModal;

    if  f_realtyI11C.bOk=true then
    begin
        edit1.Text:=f_realtyI11C.ListView1.Selected.SubItems[0];
    end;
end;

procedure Tf_RealtyF11A.Button7Click(Sender: TObject);
var
    s1:string;
begin
    s1:='N';
    if checkbox1.Checked=true then s1:='Y';
    if edit1.Text='' then
    begin
        showmessage('请选择处理单位');
        edit1.SetFocus;
        exit;
    end;

    if edit3.Text='' then
    begin
        showmessage('请选择处理人');
        edit3.SetFocus;
        exit;
    end;

    if edit5.Text='' then
    begin
        showmessage('请选择回访人');
        edit5.SetFocus;
        exit;
    end;

    if edit6.Text='' then
    begin
        showmessage('请选择回访方式');
        edit6.SetFocus;
        exit;
    end;

    if edit8.Text='' then
    begin
        showmessage('请选择满意程度');
        edit8.SetFocus;
        exit;
    end;
    if edit10.Text='' then edit10.Text:='-';
    if edit9.Text='' then edit9.Text:='-';
    if edit4.Text='' then edit4.Text:='-';

    if  f_RealtyF11.bnew=true then
    begin
        with f_RealtyF11.ListView1.Items.Add do
        begin
            caption:=edit1.Text;
            subitems.Add(datetostr(Edit2.date));
            subitems.Add(edit3.Text);
            subitems.Add(S1);
            subitems.Add(edit4.Text);
            subitems.Add(edit5.Text);
            subitems.Add(edit6.Text);
            subitems.Add(datetostr(Edit7.date));
            subitems.Add(edit8.Text);
            subitems.Add(edit9.Text);
            subitems.Add(edit10.Text);
        end;
        if f_RealtyF11.listview1.Items.Count>0 then f_RealtyF11.listview1.Items.Item[0].Selected:=true;

        edit1.Text:='';
        edit2.date:=date;
        edit3.Text:='';
        edit4.Text:='';
        edit5.Text:='';
        edit6.ItemIndex:=edit6.items.IndexOf('');
        edit7.date:=date;
        edit8.ItemIndex:=edit8.Items.IndexOf('');
        edit9.Text:='';
        edit10.Text:='';
        checkbox1.Checked:=false;

    end;

    if  f_RealtyF11.bnew=false then
    begin
        with f_RealtyF11.ListView1.Selected do
        begin
            caption:=edit1.Text;
            subitems[0]:=datetostr(Edit2.date);
            subitems[1]:=edit3.Text;
            subitems[2]:=S1;
            subitems[3]:=edit4.Text;
            subitems[4]:=Edit5.Text;
            subitems[5]:=edit6.Text;
            subitems[6]:=datetostr(edit7.date);
            subitems[7]:=Edit8.Text;
            subitems[8]:=edit9.Text;
            subitems[9]:=edit10.Text;
        end;
    end;

end;

procedure Tf_RealtyF11A.Button5Click(Sender: TObject);
begin
    close;
end;

procedure Tf_RealtyF11A.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
    Action := caFree;
end;

end.

⌨️ 快捷键说明

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