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

📄 unit1.pas

📁 自动催费.能够应用在很多领域,如果需要请和我联系,
💻 PAS
📖 第 1 页 / 共 2 页
字号:
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;

      apdtapidevice1.cancelcall; //拨号前初始化api

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

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

      end;

      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   //暂停
edit3.ReadOnly :=false;
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  liuge ',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 ansipos(soundstr,'0123456789')=0 then
              begin
              s:='特别注意:[定制时间]项目设定错误,可能导致系统崩溃!建议用默认设定!';
              memo1.Text :=s;
              messagedlg('[定制时间]项目必须设定大于1分钟的整数!请点击[确定]重新设定。',mtinformation,[mbok],0);
              edit1.Text:='120';
              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 ansipos(soundstr,'0123456789')=0 then
              begin
              s:='特别注意:[循环次数]项目设定错误,可能导致系统崩溃!建议用默认设定!';
              memo1.Text :=s;
              messagedlg('[循环次数]项目必须设定大于1的整数!请点击[确定]重新设定。',mtinformation,[mbok],0);
              edit2.Text:='10' ;
              end;
       end;


end;

procedure TForm1.CheckBox1Click(Sender: TObject);
var
sum6,sum7,sum8:variant;
begin
if checkbox1.Checked then
begin
  if (combobox1.Text='未选择状态') or (combobox2.Text='未选择状态') then
     begin
     messagedlg('友情提醒:请先选择好[数据源的设定],再进入[全屏修改状态],谢谢!',mtinformation,[mbok],0);
     checkbox1.Checked :=false;
     end
  else
     begin
  stop();
  dbtext3.Caption :='0.00';
  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;

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;

//设库浏览为不可写状态
sum6:=0;

sum7:=dbtext3.Caption ;
sum8:=dbtext4.Caption ;
sum6:=sum6+sum8-sum7;
dbtext4.Caption :=sum6;

dbgrid1.DragMode :=dmautomatic;

end;

end;


procedure TForm1.DBGrid1DblClick(Sender: TObject);
var
sum3,sum4,sum5:variant;
begin
sum3:=0;
sum4:=dbtext2.Caption ;
sum5:=dbtext3.caption ;
sum3:=sum3+sum4 +sum5;
dbtext3.caption :=sum3;
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;


procedure TForm1.Label23Click(Sender: TObject);
begin
memo2.Text :='';
end;

procedure TForm1.Label24Click(Sender: TObject);
var
stufile:tstringlist;

begin
 stufile:=tstringlist.Create;
  try

  stufile.Add (memo2.text);
      stufile.SaveToFile('c:\edit.txt');
    //stufile.savetofile(currdir+'edit.txt');
    //memo2.Lines.SaveToFile ('edit.text');
  finally
  stufile.Free ;
  messagedlg('友情提醒:数据已经成功保存在C:\edit.txt文件中, 谢谢!',mtinformation,[mbok],0);
  end;
end;

procedure TForm1.Label25Click(Sender: TObject);
//var
//stufile2:tstringlist;

begin
  //stufile2:=tstringlist.Create;
  try
  if fileexists('c:\edit.txt') then
     begin
     memo2.Lines.LoadFromFile ('c:\edit.txt');
     messagedlg('友情提醒:已经完成装载c:\edit.txt文件中数据, 谢谢!',mtinformation,[mbok],0);
      end
  else
      begin
      messagedlg('友情提醒:对不起!装载c:\edit.txt文件中数据失败,可能文件不存在! ',mtinformation,[mbok],0);
      end;
   //stufile.savetofile('edit.txt');
  finally
  //stufile2.Free ;

  end;
end;




procedure TForm1.Edit3Change(Sender: TObject);
var
i:integer;
soundstr:string;
begin
for i:=1 to length(edit3.text) do
       begin
              soundstr:=midstr(edit3.text ,i ,1);
              if ansipos(soundstr,'0123456789')=0 then
              begin
              messagedlg('友情提醒:你设定的记录数不合法,请重设,谢谢! ',mtinformation,[mbok],0);
              table1.First ;
              edit3.text:='1';
              end;
             
       end;
      table1.First ;
      table1.MoveBy((strtoint(edit3.text)-1));


end;



procedure TForm1.Button2Click(Sender: TObject);
begin
 apdtapidevice1.cancelcall; //拨号前初始化api

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

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

      end;

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

end;


procedure TForm1.Button1Click(Sender: TObject);
begin
 apdtapidevice1.PlayWaveFile(currdir+'\wav\q.wav') ;
end;

end.




⌨️ 快捷键说明

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