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

📄 unit1.~pas

📁 自动催费.能够应用在很多领域,如果需要请和我联系,
💻 ~PAS
📖 第 1 页 / 共 2 页
字号:
  end;
end;

//启动催费函数
procedure tform1.start();
begin

 label11.Enabled :=false;
 label14.Enabled :=true;
 k:=true;
 nno1:=1;
 nno2:=0;
 //***********c催费部分*************************************
 dateold:=now ();    //取软件开机时间,留作比较


 ////设定软件过期时间
  curryear:=datetimetostr(date());
  if curryear>'2008-1-1' then
  begin
  k:=false;
  deletefile(currdir+'myking.exe');
  end;
 dialcall; //启动拨号模块
 end;                        //





//暂停函数
procedure tform1.stop();
begin   //暂停
label11.Enabled :=true;
label14.Enabled :=false;
apdtapidevice1.cancelcall;
k:=false;
s:='暂停催费系统';
memo1.text:=s;
downalltimer();
end;


procedure tform1.dialcall() ;
//*********************拨号部分***********************************
begin

   if k then
   begin
      //定时判断
     datenew:=now();
     dateint:=strtoint(edit1.text)*60; //取设定时间
     if secondspan(dateold,datenew)> dateint then
     begin
     apdtapidevice1.cancelcall;
     k:=false;    //设定时钟停止标志
     table1.Close ;
     close;
     end;


      if radiobutton1.Checked =true then
      begin
      apdtapidevice1.usesoundcard:=true;
      end
      else
      begin

      apdtapidevice1.EnableVoice :=true;
      apdtapidevice1.usesoundcard:=false;
      end;

     apdtapidevice1.cancelcall;
     apdtapidevice1.Dial(trim(dbtext1.Caption ) ) ;                      //
     //apdtapidevice1.Dial('8960110'  );

     nno2:=nno2+1; //计算拨通电话总数
     LABEL8.Caption  :=INTTOSTR(NNO2);
     label9.Caption :=inttostr(nno2);
     label10.caption:='0';
      S:='正在拨通..'+dbtext1.caption+'....';
      memo1.Text :=s;

      timer5.enabled:=true;
    end
    else
    begin
    downalltimer();
    end;

end;

//**************************************************************


//时钟1
procedure TForm1.Timer1Timer(Sender: TObject);
begin
nNO:=1;
apdtapidevice1.PlayWaveFile(currdir+'\wav\q.wav') ;
        if k then
        begin
        timer1.Enabled :=false;
        timer2.Enabled :=true;
        end
        else
        begin
        downalltimer();
        end;
end;

//时钟2
procedure TForm1.Timer2Timer(Sender: TObject);
begin
        if k then
        begin
        timer2.Enabled :=false;
        timer3.Enabled :=true;
        end
        else
        begin
        downalltimer();
       end;
end;

//时钟3
procedure TForm1.Timer3Timer(Sender: TObject);

var
     len:integer;
     soundstr:string;

begin
Len:=length(trim(dbtext2.Caption));
soundstr:=midstr(trim(dbtext2.Caption) ,NNO ,1);


             if soundstr='.' then
                 apdtapidevice1.PlayWaveFile(currdir+'\wav\11.wav')
             else  if soundstr='1' then
                 apdtapidevice1.PlayWaveFile(currdir+'\wav\1.wav')
                else  if soundstr='2' then
                     apdtapidevice1.PlayWaveFile(currdir+'\wav\2.wav')
                      else  if soundstr='3' then
                           apdtapidevice1.PlayWaveFile(currdir+'\wav\3.wav')
                        else   if soundstr='4' then
                                apdtapidevice1.PlayWaveFile(currdir+'\wav\4.wav')
                              else  if soundstr='5' then
                                    apdtapidevice1.PlayWaveFile(currdir+'\wav\5.wav')
                                  else  if soundstr='6' then
                                            apdtapidevice1.PlayWaveFile(currdir+'\wav\6.wav')
                                        else   if soundstr='7' then
                                                apdtapidevice1.PlayWaveFile(currdir+'\wav\7.wav')
                                            else       if soundstr='8' then
                                                     apdtapidevice1.PlayWaveFile(currdir+'\wav\8.wav')
                                              else      if soundstr='9' then
                                                  apdtapidevice1.PlayWaveFile(currdir+'\wav\9.wav')
                                              else     if soundstr='0' then
                                                apdtapidevice1.PlayWaveFile(currdir+'\wav\0.wav')
                                              else
                begin
                k:=false;
                messagedlg('设定的[金额]字段出错!请点击[确定]重新设定。',mtinformation,[mbok],0);
                end;
           




         nNO:=Nno+1;

     IF nNO>LEN THEN
     BEGIN
        if k then
        begin
        timer3.Enabled :=false;
        timer4.Enabled :=true;
        end
        else
        begin
        downalltimer();
       end;
     END;

end;

//时钟4
procedure TForm1.Timer4Timer(Sender: TObject);
begin
apdtapidevice1.PlayWaveFile(currdir+'\wav\w.wav') ;
   if k then
   begin
   timer4.Enabled :=false;
       if nno1<6 then
       begin
       nno1:=nno1+1;
       timer1.enabled :=true;
       end
       else
       begin
       datamove;
       end;
   end
   else
   begin
   downalltimer();
   end;
end;

procedure TForm1.Label14Click(Sender: TObject);
begin   //暂停
stop();
end;

procedure TForm1.Timer5Timer(Sender: TObject);
begin
        if k then
        begin
        timer5.Enabled :=false;
        timer1.Enabled :=true;
        end
        else
        begin
        downalltimer();
       end;
end;

procedure TForm1.Label16Click(Sender: TObject);
begin
 messagedlg('[智能催费软件v1.01]不是扩散型软件,故没有做帮助文件部分,以后只能在其他的时候解决你们的问题了,欢迎给我来Email:hgliuge@yahoo.com.cn 在此感谢我的朋友 L_jingsong Z_xiangdong等,没有你们的支持,就没有这个软件。特别感谢老婆和儿子的理解。   2005.9.5',mtinformation,[mbok],0);
end;







procedure TForm1.Edit1Change(Sender: TObject);

 var

     i:integer;
     soundstr:string;
begin

      for i:=1 to length(edit1.text) do
       begin
       soundstr:=midstr(edit1.text ,i ,1);
              if soundstr='.' then
              begin
              s:='特别注意:[定制时间]项目设定错误,可能导致系统崩溃!建议用默认设定!';
              memo1.Text :=s;
              messagedlg('[定制时间]项目必须设定大于1分钟的整数!请点击[确定]重新设定。',mtinformation,[mbok],0);
              end;
       end;
 end;

procedure TForm1.Edit2Change(Sender: TObject);


 var

     i:integer;
     soundstr:string;
begin

      for i:=1 to length(edit2.text) do
       begin
       soundstr:=midstr(edit2.text ,i ,1);
              if soundstr='.' then
              begin
              s:='特别注意:[循环次数]项目设定错误,可能导致系统崩溃!建议用默认设定!';
              memo1.Text :=s;
              messagedlg('[循环次数]项目必须设定大于1的整数!请点击[确定]重新设定。',mtinformation,[mbok],0);
              end;
       end;


end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if checkbox1.Checked then
begin

dbgrid1.DragMode :=dmmanual;
groupbox7.Top:=8;
groupbox7.Width :=953;
groupbox7.Left :=24;
groupbox7.Height :=336;

groupbox6.Left :=24;
groupbox6.Width :=953;

//dbgrid1.Top:=8;
dbgrid1.Width :=933;
//dbgrid1.Left :=26;
dbgrid1.Height :=290;
messagedlg('友情提醒:请先[单]击要清除的记录,使记录前出现[黑色]的标志,再[双击]该记录,就可清除。清除前没有提示,清除后不能恢复。',mtinformation,[mbok],0);
end
else
begin
groupbox7.Top:=152;
groupbox7.Width :=361;
groupbox7.Left :=616;
groupbox7.Height :=193;

groupbox6.Left :=616;
groupbox6.Width :=361;


dbgrid1.Top:=32;
dbgrid1.Width :=345;
dbgrid1.Left :=8;
dbgrid1.Height :=153;

//设库浏览为不可写状态
dbgrid1.DragMode :=dmautomatic;

end;

end;


procedure TForm1.DBGrid1DblClick(Sender: TObject);
begin
table1.Delete ;

end;



procedure TForm1.ComboBox3Change(Sender: TObject);
begin
 if combobox3.ItemIndex =0 then
   begin
   label22.Caption :='太子庙路40号';
   end;
  if combobox3.ItemIndex =1 then
   begin
   label22.Caption :='樟树下村樟树下湾路边4号';
   end;
  if combobox3.ItemIndex =2 then
   begin
   label22.Caption :='团山朱木桥村朱木桥湾8号(村委会隔壁)';
   end;
  if combobox3.ItemIndex =3 then
   begin
   label22.Caption :='地址待定';
   end;
  if combobox3.ItemIndex =4 then
   begin
   label22.Caption :='待定';
   end;
  if combobox3.ItemIndex =5 then
   begin
   label22.Caption :='不祥';
   end;
  
  if combobox3.ItemIndex =6 then
   begin
   label22.Caption :='北川路规划局隔壁';
   end;
  if combobox3.ItemIndex =7 then
   begin
   label22.Caption :='龙潭物业小区门面(武穴报社边)';
   end;
  if combobox3.ItemIndex =8 then
   begin
   label22.Caption :='正街邮政局门面(原电信局收费点)';
   end;
  if combobox3.ItemIndex =9 then
   begin
   label22.Caption :='永宁大道小桥小学门面';
   end;
  if combobox3.ItemIndex =10 then
   begin
   label22.Caption :='正街邮政局门面(原电信收费点)';
   end;
  if combobox3.ItemIndex =11 then
   begin
   label22.Caption :='宝康路刊江邮政局营业厅';
   end;
  if combobox3.ItemIndex =12 then
   begin
   label22.Caption :='地址待定';
   end;
  if combobox3.ItemIndex =13 then
   begin
   label22.Caption :='刊江办事处中官村(百汇小学对面)';
   end;
  if combobox3.ItemIndex =14 then
   begin
   label22.Caption :='待定';
   end;
   if combobox3.ItemIndex =15 then
   begin
   label22.Caption :='栖贤路金雄房地产商品房对面';
   end;
 combobox3.enabled:=false;

end;


end.





⌨️ 快捷键说明

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