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

📄 unit11.pas

📁 学校短信息系统 采用华域科技的SzgmtSms 通讯模块
💻 PAS
📖 第 1 页 / 共 2 页
字号:
mainform.adocommand3.Execute;
j:=SendSms(mainform.msg_com,mobile1,str1,length(str1));
if j<>0 then mainform.memo1.Lines.Add(mobile1+' send error! with error code:'+inttostr(j));
mainform.ADOQuery2.Next;
end;
end
else if (t1_name='am_out') then
begin
mainform.adocommand3.CommandText:='insert into student_absent_status select name,class,grade,'+quotedstr('wd')+' as status,'+quotedstr(datetostr(date)+'am')+' as operate_time from student_info where card_id not in (select card_id from daily where time>=:t1 and time<:t2)';
mainform.adocommand3.Parameters.ParamByName('t1').Value:=datetostr(date)+' '+timetostr(am_in);
mainform.adocommand3.Parameters.ParamByName('t2').Value:=datetostr(date)+' '+timetostr(am_out);
mainform.adocommand3.Execute;
mainform.adocommand3.CommandText:='insert into message select mobile1,card_id as mobile from student_info where name in (select name from student_absent_status where status='+quotedstr('wd')+' and operate_time='+quotedstr(datetostr(date)+'am')+')';
mainform.adocommand3.Execute;
mainform.ADOQuery2.Close;
mainform.ADOQuery2.sql.clear;
mainform.ADOQuery2.sql.text:='select * from message';
mainform.ADOQuery2.open;
while not mainform.ADOQuery2.Eof do
begin
//id:=mainform.ADOQuery2.fieldbyname('id').AsInteger;
mobile1:=pchar(mainform.ADOQuery2.fieldbyname('mobile').AsString);
card_id1:=mainform.ADOQuery2.fieldbyname('card_id').AsString;
mainform.adocommand3.CommandType:=cmdtext;
mainform.adocommand3.CommandText:='delete * from message where card_id=:id'; //here MS access is not like MS SQL
mainform.adocommand3.Parameters.ParamByName('id').Value:=card_id1;
mainform.adocommand3.Execute;
j:=SendSms(mainform.msg_com,mobile1,str2,length(str2));
if j<>0 then mainform.memo1.Lines.Add(mobile1+' send error! with error code:'+inttostr(j));
mainform.ADOQuery2.Next;
end;
end
else if (t1_name='pm_in') then
begin
mainform.adocommand3.CommandText:='insert into student_absent_status select name,class,grade,'+quotedstr('cd')+' as status,'+quotedstr(datetostr(date)+'pm')+' as operate_time from student_info where card_id not in (select card_id from daily where time>=:t1 and time<:t2)';
mainform.memo1.Lines.Add(mainform.adocommand3.CommandText);
mainform.adocommand3.Parameters.ParamByName('t1').Value:=datetostr(date)+' '+timetostr(am_out);
mainform.adocommand3.Parameters.ParamByName('t2').Value:=datetostr(date)+' '+timetostr(pm_in);
mainform.adocommand3.Execute;
mainform.memo1.Lines.Add('mainform.adocommand3.execute');
mainform.adocommand3.CommandText:='insert into message select mobile1,card_id as mobile from student_info where name in (select name from student_absent_status where status='+quotedstr('cd')+' and operate_time='+quotedstr(datetostr(date)+'pm')+')';
mainform.memo1.Lines.Add(mainform.adocommand3.CommandText);
mainform.adocommand3.Execute;
mainform.memo1.Lines.Add('mainform.adocommand3.Execute');
mainform.ADOQuery2.Close;
mainform.ADOQuery2.sql.clear;
mainform.ADOQuery2.sql.text:='select * from message';
mainform.memo1.Lines.Add('select * from message');
mainform.ADOQuery2.open;
mainform.memo1.Lines.Add('mainform.ADOQuery2.open');
while not mainform.ADOQuery2.Eof do
begin
mainform.memo1.Lines.Add('while begin!');
//id:=mainform.ADOQuery2.fieldbyname('id').AsInteger;
//mainform.memo1.Lines.Add(inttostr(id));
mobile1:=pchar(mainform.ADOQuery2.fieldbyname('mobile').AsString);
card_id1:=mainform.ADOQuery2.fieldbyname('card_id').AsString;
mainform.adocommand3.CommandText:='delete * from message where card_id=:id'; //here MS access is not like MS SQL
mainform.memo1.Lines.Add(mainform.adocommand3.CommandText);
mainform.adocommand3.Parameters.ParamByName('id').Value:=card_id1;
mainform.adocommand3.Execute;
mainform.memo1.Lines.Add('mainform.adocommand3.Execute');
j:=SendSms(mainform.msg_com,mobile1,str1,length(str1));
if j<>0 then mainform.memo1.Lines.Add(mobile1+' send error! with error code:'+inttostr(j));
mainform.ADOQuery2.Next;
end;
end
else if (t1_name='pm_out') then
begin
mainform.adocommand3.CommandText:='insert into student_absent_status select name,class,grade,'+quotedstr('wd')+' as status,'+quotedstr(datetostr(date)+'pm')+' as operate_time from student_info where card_id not in (select card_id from daily where time>=:t1 and time<:t2)';
mainform.adocommand3.Parameters.ParamByName('t1').Value:=datetostr(date)+' '+timetostr(pm_in);
mainform.adocommand3.Parameters.ParamByName('t2').Value:=datetostr(date)+' '+timetostr(pm_out);
mainform.adocommand3.Execute;
mainform.adocommand3.CommandText:='insert into message select mobile1,card_id as mobile from student_info where name in (select name from student_absent_status where status='+quotedstr('wd')+' and operate_time='+quotedstr(datetostr(date)+'pm')+')';
mainform.adocommand3.Execute;
mainform.ADOQuery2.Close;
mainform.ADOQuery2.sql.clear;
mainform.ADOQuery2.sql.text:='select * from message';
mainform.memo1.Lines.Add('select * from message');
mainform.ADOQuery2.open;
mainform.memo1.Lines.Add('mainform.ADOQuery2.open');
while not mainform.ADOQuery2.Eof do
begin
mainform.memo1.Lines.Add('--------------------------------------------');
//id:=mainform.ADOQuery2.fieldbyname('id').AsInteger;
mobile1:=pchar(mainform.ADOQuery2.fieldbyname('mobile').AsString);
card_id1:=mainform.ADOQuery2.fieldbyname('card_id').AsString;
mainform.memo1.Lines.Add(mobile1+card_id1);
mainform.adocommand3.CommandType:=cmdtext;
mainform.adocommand3.CommandText:='delete * from message where card_id=:id'; //here MS access is not like MS SQL
mainform.adocommand3.Parameters.ParamByName('id').Value:=card_id1;
mainform.memo1.Lines.Add(mainform.adocommand3.CommandText);
mainform.adocommand3.Execute;
mainform.memo1.Lines.Add('mainform.adocommand3.Execute');
j:=SendSms(mainform.msg_com,mobile1,str2,length(str2));
if j<>0 then mainform.memo1.Lines.Add(mobile1+' send error! with error code:'+inttostr(j));
mainform.ADOQuery2.Next;
end;
end
else if (t1_name='ws_in') then
begin
mainform.adocommand3.CommandText:='insert into student_absent_status select name,class,grade,'+quotedstr('cd')+' as status,'+quotedstr(datetostr(date)+'ws')+' as operate_time from student_info where card_id not in (select card_id from daily where time>=:t1 and time<:t2)';
mainform.adocommand3.Parameters.ParamByName('t1').Value:=datetostr(date)+' '+timetostr(pm_out);
mainform.adocommand3.Parameters.ParamByName('t2').Value:=datetostr(date)+' '+timetostr(ws_in);
mainform.adocommand3.Execute;
mainform.adocommand3.CommandText:='insert into message select mobile1,card_id as mobile from student_info where name in (select name from student_absent_status where status='+quotedstr('cd')+' and operate_time='+quotedstr(datetostr(date)+'ws')+')';
mainform.adocommand3.Execute;
mainform.ADOQuery2.Close;
mainform.ADOQuery2.sql.clear;
mainform.ADOQuery2.sql.text:='select * from message';
mainform.ADOQuery2.open;
while not mainform.ADOQuery2.Eof do
begin
//id:=mainform.ADOQuery2.fieldbyname('id').AsInteger;
mobile1:=pchar(mainform.ADOQuery2.fieldbyname('mobile').AsString);
card_id1:=mainform.ADOQuery2.fieldbyname('card_id').AsString;
mainform.adocommand3.CommandType:=cmdtext;
mainform.adocommand3.CommandText:='delete * from message where card_id=:id'; //here MS access is not like MS SQL
mainform.adocommand3.Parameters.ParamByName('id').Value:=card_id1;
mainform.adocommand3.Execute;
j:=SendSms(mainform.msg_com,mobile1,str1,length(str1));
if j<>0 then mainform.memo1.Lines.Add(mobile1+' send error! with error code:'+inttostr(j));
mainform.ADOQuery2.Next;
end;
end
else if (t1_name='ws_out') then
begin
mainform.adocommand3.CommandText:='insert into student_absent_status select name,class,grade,'+quotedstr('wd')+' as status,'+quotedstr(datetostr(date)+'ws')+' as operate_time from student_info where card_id not in (select card_id from daily where time>=:t1 and time<:t2)';
mainform.adocommand3.Parameters.ParamByName('t1').Value:=datetostr(date)+' '+timetostr(ws_in);
mainform.adocommand3.Parameters.ParamByName('t2').Value:=datetostr(date)+' '+timetostr(ws_out);
mainform.adocommand3.Execute;
mainform.adocommand3.CommandText:='insert into message select mobile1,card_id as mobile from student_info where name in (select name from student_absent_status where status='+quotedstr('wd')+' and operate_time='+quotedstr(datetostr(date)+'ws')+')';
mainform.adocommand3.Execute;
mainform.ADOQuery2.Close;
mainform.ADOQuery2.sql.clear;
mainform.ADOQuery2.sql.text:='select * from message';
mainform.ADOQuery2.open;
while not mainform.ADOQuery2.Eof do
begin
//id:=mainform.ADOQuery2.fieldbyname('id').AsInteger;
mobile1:=pchar(mainform.ADOQuery2.fieldbyname('mobile').AsString);
card_id1:=mainform.ADOQuery2.fieldbyname('card_id').AsString;
mainform.adocommand3.CommandType:=cmdtext;
mainform.adocommand3.CommandText:='delete * from message where card_id=:id'; //here MS access is not like MS SQL
mainform.adocommand3.Parameters.ParamByName('id').Value:=card_id1;
mainform.adocommand3.Execute;
j:=SendSms(mainform.msg_com,mobile1,str2,length(str2));
if j<>0 then mainform.memo1.Lines.Add(mobile1+' send error! with error code:'+inttostr(j));
mainform.ADOQuery2.Next;
end;
end;
sleep(1000*59);
t1_name:='';
until 0=1;
end;

end.

⌨️ 快捷键说明

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