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

📄 uform_main.pas

📁 电话防伪系统
💻 PAS
📖 第 1 页 / 共 2 页
字号:
      tw_playsentence(i-1,temp);

   end;
   if thisring[i].timeout =240 then
   begin
      thisRing[i].funs :=11;
   end;

end;

//[[[[[[[[[[[[[[[[5]]]]]]]]]]]]]]]]]]]
procedure Tform_main.telser5(i:integer);
var
   temp:pchar;
begin
   //telephone server function5    2001-12-25p
   //等待号码音放完,然后放产品确认音

   if tw_playsentencerest(i-1)=0 then
   begin
      thisRing[i].funs :=6;
      thisring[i].timeout :=0;

      statusbar2.Panels[i-1].Text :=inttostr(i) + '#线放产品确认音';
      temp:=pchar(ExtractFilePath(ParamStr(0)) + 'sound\12sou.tw');
      tw_flushdtmf(i-1);
      tw_startplayfile(i-1,temp,0,0);
   end;
   if thisring[i].timeout =240 then
   begin
      thisRing[i].funs :=11;
   end;
end;

//[[[[[[[[[[[[[[[[6]]]]]]]]]]]]]]]]]]]
procedure Tform_main.telser6(i:integer);
var
   p:integer;
   temp:pchar;
begin
   //telephone server function6    2001-12-25p
   // 等待产品确认音,然后房产拼音

   if tw_playfilerest(i-1)=0 then
   begin

      p:=strtoint(thisRing[i].code[1] + thisRing[i].code[2]);
      temp:=pchar(ExtractFilePath(ParamStr(0)) + 'sound\' + inttostr(p+1) +'pro.tw');
      if fileexists(ExtractFilePath(ParamStr(0)) + 'sound\' + inttostr(p+1) +'pro.tw')=false then
      begin
         thisRing[i].funs :=11;
         exit;
      end;

      thisRing[i].funs :=7;
      thisring[i].timeout :=0;

      statusbar2.Panels[i-1].Text :=inttostr(i) + '#线放产品名称音';


      tw_flushdtmf(i-1);
      tw_startplayfile(i-1,temp,0,0);
   end;

   if thisring[i].timeout =240 then
   begin
      thisRing[i].funs :=11;
   end;
end;

//[[[[[[[[[[[[[[[[7]]]]]]]]]]]]]]]]]]]
procedure Tform_main.telser7(i:integer);
var
   temp:pchar;
begin
   //telephone server function7    2001-12-25p
   //产品名称是否放完 ,然后放提示确认音

   if tw_playfilerest(i-1)=0 then
   begin
      thisRing[i].funs :=8;
      thisring[i].timeout :=0;

      statusbar2.Panels[i-1].Text :=inttostr(i) + '#线放提示确认音';
      temp:=pchar(ExtractFilePath(ParamStr(0)) + 'sound\13sou.tw');
      tw_flushdtmf(i-1);
      tw_startplayfile(i-1,temp,0,0);
   end;

   if thisring[i].timeout =240 then
   begin
      thisRing[i].funs :=11;
   end;
end;

//[[[[[[[[[[[[[[[[8]]]]]]]]]]]]]]]]]]]
procedure Tform_main.telser8(i:integer);
begin
   //telephone server function8  2001-12-25p
   //等待提示确认音放完活用户输入,然后进行处理



   if tw_playfilerest(i-1)=0 then
   begin
      thisRing[i].funs :=9;
      thisring[i].timeout :=0;
      tw_flushdtmf(i-1);
      statusbar2.Panels[i-1].Text :=inttostr(i) + '#线等待用户输入确认信息';
   end;


   if thisring[i].timeout =240 then
   begin
      thisRing[i].funs :=11;
   end;
end;

//[[[[[[[[[[[[[[[[9]]]]]]]]]]]]]]]]]]]
procedure Tform_main.telser9(i:integer);
var
   temp:pchar;
   temp2:pchar;
begin
   //telephone server function9    2001-12-25p
   //

   tw_getdtmfstr(i-1,temp2);


   if length(temp2)>0 then
   begin

      if temp2='1' then
      begin
         tel_recordset.SQL.Clear ;
         tel_recordset.SQL.Add('select * from [CODE] where [CODE_CODE]=''' + thisring[i].code + '''' );
         tel_recordset.Open ;

         if tel_recordset.RecordCount =0 then
         begin
            thisRing[i].funs :=12;
            thisring[i].timeout :=0;
            dconnect.Execute('insert into [HIS]([HIS_CODE_KIND],[HIS_TEXT],[HIS_DT]) values(1,''' + thisring[i].code +''',#' + datetimetostr(thisring[i].thistime ) + '#)');

            statusbar2.Panels[i-1].Text :=inttostr(i) + '#线放错误音';
            temp:=pchar(ExtractFilePath(ParamStr(0)) + 'sound\16sou.tw');
            tw_flushdtmf(i-1);
            tw_startplayfile(i-1,temp,0,0);

            
            {tel_recordset2.SQL.Clear ;
            tel_recordset2.SQL.Add('select * from [HIS]');
            tel_recordset2.Open ;

            tel_recordset2.Insert ;
            tel_recordset2.Fields[1].AsInteger := 1;
            tel_recordset2.Fields[2].AsString :=thisring[i].code;
            tel_recordset2.Fields[3].AsDateTime :=thisring[i].thistime ;
            tel_recordset2.Post ;
            tel_recordset2.Close;}
         end;

         if tel_recordset.RecordCount>0 then
         begin
            if tel_recordset.Fields [4].AsBoolean =true then
            begin
               //已查询
               thisRing[i].funs :=12;
               thisring[i].timeout :=0;
               dconnect.Execute('insert into [HIS]([HIS_CODE_KIND],[HIS_TEXT],[HIS_DT]) values(2,''' + thisring[i].code +''',#' + datetimetostr(thisring[i].thistime ) + '#)');

               statusbar2.Panels[i-1].Text :=inttostr(i) + '#线放已查音';
               temp:=pchar(ExtractFilePath(ParamStr(0)) + 'sound\15sou.tw');
               tw_flushdtmf(i-1);
               tw_startplayfile(i-1,temp,0,0);


            end
            else
            begin
               //正确音
               thisRing[i].funs :=12;
               thisring[i].timeout :=0;
               dconnect.Execute('update [CODE] set [CODE_CHECK]=true,[CODE_CHECK_DD]=#' + datetimetostr(thisring[i].thistime ) + '# where [CODE_CODE]=''' + thisring[i].code + '''');
               dconnect.Execute('insert into [HIS]([HIS_CODE_KIND],[HIS_TEXT],[HIS_DT]) values(4,''' + thisring[i].code +''',#' + datetimetostr(thisring[i].thistime ) + '#)');

               statusbar2.Panels[i-1].Text :=inttostr(i) + '#线放正确音';
               temp:=pchar(ExtractFilePath(ParamStr(0)) + 'sound\14sou.tw');
               tw_flushdtmf(i-1);
               tw_startplayfile(i-1,temp,0,0); 


            end;
         end;

         tel_recordset.Close ;
      end;
      if temp2='2' then
      begin
         //重新输入
         statusbar2.Panels[i-1].Text :=inttostr(i) + '#线电话接入,正在播放欢迎音';
         thisRing[i].funs :=2;
         thisring[i].timeout :=0;

         tw_flushdtmf(i-1);
         temp:=pchar(ExtractFilePath(ParamStr(0)) + 'sound\0sou.tw');
         tw_startplayfile(i-1,temp,0,0);
      end;

      if ((temp2<>'1') and (temp2<>'2')) then
      begin
         //输入错误
         thisRing[i].funs :=10;
         thisring[i].timeout :=0;

         statusbar2.Panels[i-1].Text :=inttostr(i) + '#线播放输入错误音';
         temp:=pchar(ExtractFilePath(ParamStr(0)) + 'sound\17sou.tw');
         tw_flushdtmf(i-1);
         tw_startplayfile(i-1,temp,0,0);
      end;

   end;

   if thisring[i].timeout =240 then
   begin
      thisRing[i].funs :=11;
   end;
end;

//[[[[[[[[[[[[[[[[10]]]]]]]]]]]]]]]]]]]
procedure Tform_main.telser10(i:integer);
var
   temp:pchar;
begin
   //telephone server function10    2001-12-25p
   //等待错误音放完

   if tw_playfilerest(i-1)=0 then
   begin
      thisRing[i].funs :=2;
      thisring[i].timeout :=0;

      tw_flushdtmf(i-1);
      temp:=pchar(ExtractFilePath(ParamStr(0)) + 'sound\0sou.tw');
      tw_startplayfile(i-1,temp,0,0);
   end;

   if thisring[i].timeout =240 then
   begin
      thisRing[i].funs :=11;
   end;
end;


//[[[[[[[[[[[[[[[[11]]]]]]]]]]]]]]]]]]]
procedure Tform_main.telser11(i:integer);
begin
   //telephone server function11    2001-12-25p
   //error or user off hook the telphone
   thisRing[i].funs :=1;

   tel_recordset.SQL.Clear ;
   tel_recordset.SQL.Add('select * from [HIS]');
   tel_recordset.Open ;

   tel_recordset.Insert ;
   tel_recordset.Fields[1].AsInteger := 1;
   tel_recordset.Fields[2].AsString :=' ';
   tel_recordset.Fields[3].AsDateTime :=thisring[i].thistime ;
   tel_recordset.Post ;
   tel_recordset.Close;
end;

//[[[[[[[[[[[[[[[[12]]]]]]]]]]]]]]]]]]]
procedure Tform_main.telser12(i:integer);
begin
   //telephone server function12    2001-12-25p
   //wait the the user finish the press key
   if tw_playfilerest(i-1)=0 then
   begin
      thisRing[i].funs :=1;
      thisring[i].timeout :=0;
      tw_hangupctrl(i-1);
   end;

   if thisring[i].timeout =240 then
   begin
      thisRing[i].funs :=11;
   end;
end;
//....................................................................................................................................
//------------------------------------------------------------------------------------------------------------------------------------

procedure Tform_main.N11Click(Sender: TObject);
begin
   //start or stop #1  2001-12-18
   stop[1]:= not stop[1];
   if stop[1]=true then
   begin
      n11.Caption :='&1#线关闭服务';
      thisring[1].funs :=1;
   end
   else
   begin
      n11.Caption :='&1#线开启服务';
      tw_hangupctrl(0);
   end;
end;

procedure Tform_main.N21Click(Sender: TObject);
begin
   //stop or star #2 2001-12-18
   stop[2]:= not stop[2];
   if stop[2]=true then
   begin
      n21.Caption :='&2#线关闭服务';
      thisring[2].funs :=1;
   end
   else
   begin
      n21.Caption :='&2#线开启服务';
      tw_hangupctrl(1);
   end;
end;

procedure Tform_main.N2Click(Sender: TObject);
begin
   form_code_del.ShowModal ;
end;

procedure Tform_main.fghf1Click(Sender: TObject);
begin
   form_bt_print.ShowModal ;
end;

procedure Tform_main.N3Click(Sender: TObject);
begin
   form_bt_output.ShowModal ;
end;

procedure Tform_main.S1Click(Sender: TObject);
begin
   form_his_show.ShowModal ;
end;

procedure Tform_main.N5Click(Sender: TObject);
begin
   form_help.ShowModal ;
end;

procedure Tform_main.N8Click(Sender: TObject);
begin
   form_aboutme.ShowModal ;
end;

procedure Tform_main.C1Click(Sender: TObject);
begin
   form_his_del.ShowModal ;
end;

procedure Tform_main.R1Click(Sender: TObject);
var
   temp1:boolean;
   temp2:boolean;
begin
   temp1:=stop[1];
   stop[1]:=false;
   tw_hangupctrl(0);

   temp2:=stop[2];
   stop[2]:=false;
   tw_hangupctrl(1);

   form_record.ShowModal ;

   stop[1]:=temp1;
   thisring[1].funs :=1;
   stop[2]:=temp2;
   thisring[2].funs :=1;
end;

procedure Tform_main.C2Click(Sender: TObject);
var
   temp1:boolean;
   temp2:boolean;
begin
   temp1:=stop[1];
   stop[1]:=false;
   tw_hangupctrl(0);

   temp2:=stop[2];
   stop[2]:=false;
   tw_hangupctrl(1);
   //show the form _ record_ pro 2001-12-25p
   form_record_pro.ShowModal ;

   
   stop[1]:=temp1;
   thisring[1].funs :=1;
   stop[2]:=temp2;
   thisring[2].funs :=1;
end;

procedure Tform_main.wwwBeeShipcom1Click(Sender: TObject);
begin
   ShellExecute(Self.Handle,'Open',PChar('http://www.beeship.com'),nil,nil,1);
end;

procedure Tform_main.Email1Click(Sender: TObject);
begin
   ShellExecute(Self.Handle,'Open',PChar('mailto:PianoPan@Beeship.com?Subject=关于电话伺服系统1.0'),nil,nil,1);
end;

end.

⌨️ 快捷键说明

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