u_dm.pas

来自「一个地方税务征收管理系统」· PAS 代码 · 共 146 行

PAS
146
字号
unit u_dm;

interface

uses
  SysUtils, Classes, DB, DBTables, StdCtrls, ADODB;

type
  Tdm1 = class(TDataModule)
    ADOConnection1: TADOConnection;
    D_rc_sum: TDataSource;
    A_acount: TADOTable;
    D_acount: TDataSource;
    Q_temp: TADOQuery;
    ADOCommand1: TADOCommand;
    Q_1: TADOQuery;
    Q_2: TADOQuery;
    A_Person: TADOQuery;
    D_person: TDataSource;
    A_rw: TADOQuery;
    D_rw: TDataSource;
    A_person_find: TADOQuery;
    d_person_find: TDataSource;
    A_rc_item: TADOQuery;
    d_rc_item: TDataSource;
    A_rc_sum: TADOStoredProc;
    D_jd_she: TDataSource;
    A_jd_she: TADOStoredProc;
    A_person_r: TADOQuery;
    D_person_r: TDataSource;
    A_she: TADOQuery;
    D_she: TDataSource;
    p_acounr_new: TADOStoredProc;
    A_rw_she: TADOQuery;
    D_rw_she: TDataSource;
    a_fp_find: TADOQuery;
    d_fp_find: TDataSource;
    D_jd_person: TDataSource;
    A_jd_person: TADOStoredProc;
    A_jd_s1: TADOQuery;
    D_jd_s1: TDataSource;
    A_jd_person2: TADOQuery;
    d_jd_person2: TDataSource;
    A_rc_fp: TADOQuery;
    d_rc_fp: TDataSource;
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }
  public
    procedure Open_Q1(msql: string);
    procedure Open_Q2(msql: string);
    procedure Open_temp(msql: string);

    procedure EXE_SQL(MSQL: string);
    procedure Fill_comb(msql: string; comb: TComboBox);
    function Get_data(msql: string): string;
    { Public declarations }
  end;

var
  dm1: Tdm1;

implementation

uses StrUtils, RICH_SYS;

{$R *.dfm}

procedure Tdm1.EXE_SQL(MSQL: string);
begin
  with ADOCommand1 do
  begin
    CommandText := MSQL;
    Execute;
  end;
end;

procedure Tdm1.Fill_comb(msql: string; comb: TComboBox);
begin
  Open_temp(msql);
  with comb, Q_TEMP do
  begin
    Items.Clear;
    while not Q_TEMP.Eof do
    begin
      Items.Add(Fields[0].AsString);
      Next;
    end;
  end;
end;

procedure Tdm1.Open_Q1(msql: string);
begin
  with Q_1 do
  begin
    close;
    SQL.Clear;
    SQL.Add(msql);
    open;
  end;
end;

procedure Tdm1.Open_Q2(msql: string);
begin
  with Q_2 do
  begin
    close;
    SQL.Clear;
    SQL.Add(msql);
    open;
  end;
end;

procedure Tdm1.Open_temp(msql: string);
begin
  with Q_TEMP do
  begin
    close;
    SQL.Clear;
    SQL.Add(msql);
    open;
  end;
end;

function Tdm1.Get_data(msql: string): string;
begin
  with Q_temp do
  begin
    Close;
    SQL.Clear;
    SQL.Add(msql);
    Open;
    Result := trim(Fields[0].AsString);
  end;
end;

procedure Tdm1.DataModuleCreate(Sender: TObject);
begin
  ADOConnection1.Close;
  ADOConnection1.ConnectionString := ini_read_encript('conn', 'err');
  ADOConnection1.Open;
end;

end.

⌨️ 快捷键说明

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