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

📄 pas_hinttimes.~pas

📁 比较详细的功能
💻 ~PAS
字号:
unit pas_hinttimes;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Grids, DBGrids, Buttons, ToolWin, ComCtrls;

type
  TForm_hinttime = class(TForm)
    ToolBar1: TToolBar;
    selectContract: TSpeedButton;
    DBGrid: TDBGrid;
    Label1: TLabel;
    Edit_times: TEdit;
    Label2: TLabel;
    cb_no: TComboBox;
    procedure Edit_timesKeyPress(Sender: TObject; var Key: Char);
    procedure selectContractClick(Sender: TObject);
    procedure cb_noDropDown(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form_hinttime: TForm_hinttime;

implementation
     uses pas_dm2, pas_inputtimes, Pas_DM;
{$R *.dfm}

procedure TForm_hinttime.Edit_timesKeyPress(Sender: TObject;
  var Key: Char);
var
   s:string;
begin
   if key<>#13 then exit;
 try
 strtoint(edit_times.text);
 except
 end;
 if IDOK=messagebox(handle,pchar('确定是要付款 '+edit_times.Text+' 次吗???'),'警告', MB_OKCANCEL) then
  begin
  if cb_no.Text='' then
  begin
    showmessage('合同号不能为空');
    exit;
  end;
  with pas_dm2.DM2.query_hinttime do
  begin
     close;
     sql.Clear;
     s:='select ho_contractno 合同编号 from house_histry where ho_contractno='''+trim(cb_no.text)+'''';
     sql.Add(s);
     open;
     if dm2.query_hinttime.RecordCount = 0 then
     begin
       showmessage('没有合同号');
       exit;
     end;

    if application.FindComponent('Form_inputtime')=nil then
      begin
         application.CreateForm(TForm_inputtime,Form_inputtime);
      end;
      try
         Form_inputtime.ShowModal;
      except
         showmessage('窗口显示错误');
         Form_inputtime.Free;
         Form_inputtime:=nil;
      end;

  end;
  end;
end;

procedure TForm_hinttime.selectContractClick(Sender: TObject);
var
  s:string;
begin
  if cb_no.Text='' then
  begin
    showmessage('合同号不能为空');
    exit;
  end;
  with pas_dm2.DM2.query_hinttime do
  begin
     close;
     sql.Clear;
     s:='select hi_cno 合同编号,hi_times 付款次数,hi_fktime 付款时间,hi_fkorno 付款没有,hi_days 提前天数 from hint where hi_cno='''+trim(cb_no.text)+'''';
     sql.Add(s);
     open;
     if dm2.query_hinttime.RecordCount = 0 then
     begin
       showmessage('这个合同的付款时间未设置');
       exit;
     end;
  end;
end;

procedure TForm_hinttime.cb_noDropDown(Sender: TObject);
var
   s:string;
begin
  try
   with dm.aq1 do
   begin
     close;
     sql.Clear;
     s:='select ho_contractno from house_histry ';
     sql.Add(s);
     open;
     cb_no.Items.Clear;
     while not dm.aq1.Eof do
     begin
      cb_no.Items.Add(fields.Fields[0].asstring);
      next;
    end;
   end;
  except
  end;
end;

end.

⌨️ 快捷键说明

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