📄 unit_managersmssend.pas
字号:
procedure TFrm_ManagerSMSSend.TabSheet4Show(Sender: TObject);
begin
SpeedButtonFGJT.Enabled:=TRUE;
Label2.Visible:=false;
ComboBoxJT.Visible:=false;
SpeedButtonJT_OK.Visible:=false;
end;
procedure TFrm_ManagerSMSSend.TabSheet5Show(Sender: TObject);
begin
{
ComboBox2.Items.Clear;
WITH dm_main.QueryZZC DO
Begin
Close;
SQL.Clear;
SQL.Add('SELECT distinct jtyhmc,jtyhdm FROM JTYH WHERE jtlb=''J''');
if JBDM=3 THEN
SQL.Add(' AND GH='+''''+GH+'''');
if (JBDM=2) OR (JBDM=1) THEN
SQL.Add(' AND JX='+IntToStr(JX));
Open;
While not Eof do
begin
ComboBox2.Items.Add(FieldByName('jtyhmc').AsString);
Next;
end;
END;
ComboBox2.ItemIndex:=0;
}
end;
procedure TFrm_ManagerSMSSend.SpeedButton3Click(Sender: TObject);
begin
if (Trim(EditDHHM.Text)<>'') and (length(trim(editdhhm.text))=11) Then
Begin
ListBox1.Items.Add(EditDhhm.Text);
Label8.Caption:='总用户数:'+IntToStr(ListBox1.Items.Count);
listbox1.Checked [listbox1.Items.Count-1]:=true;
BitBtn1.Enabled:=True;
EditDHHM.Text:='';
End
else
begin
if Trim(EditDHHM.Text) = '' then
begin
Application.MessageBox('请输入电话号码!', '系统提示', MB_OK + MB_ICONWARNING);
EditDHHM.SetFocus;
Exit;
end;
if length(trim(editdhhm.text)) <> 11 then
begin
Application.MessageBox('请输入电话号码位数不对,请重新输入!', '系统提示', MB_OK + MB_ICONWARNING);
EditDHHM.SetFocus;
Exit;
end;
end;
end;
procedure TFrm_ManagerSMSSend.SpeedButton2Click(Sender: TObject);
var
sqlstr: string;
begin
ListBox1.Clear; //2001-6-28 CQB
BitBtn1.Enabled:=true;
if JBDM=3 then
sqlstr:=' and gh='+''''+GH+''''
else
if (JBDM=2) or (JBDM=1) then
sqlstr:=' and jx='+IntToStr(JX)
else
sqlstr:=' and (0=0) ';
sqlstr:=' select * from t_f_groupinfo where (0=0) '+sqlstr;
with dm_main.QueryZZC do
begin
Close;
SQL.Clear;
SQL.Add(sqlstr);
Open;
first;
while not eof do
begin
ListBox1.Items.Add(FieldbyName('jtyhmc').AsString);
next;
end;
end;
multigroup:=true;
Label8.Caption:='总用户数:'+IntToStr(ListBox1.Items.Count);
end;
procedure TFrm_ManagerSMSSend.SpeedButton4Click(Sender: TObject);
var
sqlstr:string;
begin
if (ComboBox1.Text='') or (Edit1.Text='') then
begin
Application.MessageBox('对不起,你的输入条件不完整,请重新输入!','提示',MB_OK+MB_ICONINFORMATION);
exit;
end;
case ComboBox1.ItemIndex of
0://电话号码
begin
sqlstr:=' select * from t_h_smssend where SID='+''''+Edit1.Text+'''';
end;
1://发送时间
begin
{ try
dt:=strtodatetime(edit1.Text );
except
showmessage(edit1.text+' 不是正确的时间格式,YYYY-MM-DD');
exit;
end;
}
sqlstr:=' select * from t_h_smssend where to_char(SEND_TIME,''YYYYMMDD'')='''+Edit1.Text+'''';
end;
2://发信工号
begin
sqlstr:=' select * from t_h_smssend where WK_NO='''+Edit1.Text+'''';
// if (JBDM=1) or (JBDM=2) then
// sqlstr:=sqlstr+' and gh in (select gh from ry where off_no_home='+IntToStr(JX)+')';
end;
3://发信人
begin
sqlstr:=' select * from t_h_smssend where name like ''%'+Edit1.Text+'%''';
end;
end;
If JBDM=3 Then
SQLSTR:=SQLSTR+' And WK_NO='''+GH+'''';
with QYFS do
begin
Active:=false;
SQL.Clear;
SQL.Add(sqlstr);
Active:=true;
end;
end;
procedure TFrm_ManagerSMSSend.ComboBox1Change(Sender: TObject);
begin
if ComboBox1.ItemIndex=1 then
Application.MessageBox('请输入要查询的日期,日期的格式为:年月日,数字紧接着!','提示',MB_OK+MB_ICONINFORMATION);
if (ComboBox1.ItemIndex=2) and (JBDM=3) then
begin
Edit1.Text:=gh;
Edit1.Enabled:=false;
end
else
Edit1.Enabled:=true;
end;
procedure TFrm_ManagerSMSSend.SpeedButton7Click(Sender: TObject);
begin
CLOSE;
end;
procedure TFrm_ManagerSMSSend.SpeedButton8Click(Sender: TObject);
begin
CLOSE;
end;
procedure TFrm_ManagerSMSSend.SpeedButton5Click(Sender: TObject);
begin
if Application.MessageBox('真的要取消该短消息的发送吗?','注意',MB_OKCANCEL+MB_ICONINFORMATION)=id_ok then
begin
Table1.Delete;
Table1.Refresh;
end;
end;
procedure TFrm_ManagerSMSSend.SpeedButton9Click(Sender: TObject);
begin
OpenDialog1.Execute;
EDIT3.Text:=OpenDialog1.FileName;
end;
procedure TFrm_ManagerSMSSend.BitBtn4Click(Sender: TObject);
VAR
PNO:STRING;
CO:INTEGER;
begin
if Trim(Edit3.Text)='' then
begin
Application.MessageBox('对不起!您没有选择要发送短信息的文件!'#13#13'请先选择要发送的文件,或者在输入框中输入具体的要发送短信息的文件!(需要详细路径和文件名)','提示',MB_ICONINFORMATION+MB_OK);
Exit ;
End ;
AssignFile(INPUT,EDIT3.Text);
Reset(INPUT);
CO:=0;
WHILE NOT EOF(INPUT) DO
BEGIN
READLN(INPUT,PNO);
TRY STRTOINT64(PNO) EXCEPT
Application.MessageBox('对不起!您的文件格式错误!','提示',MB_ICONINFORMATION+MB_OK);
BREAK;
END;
ListBox1.Items.Add(PNO);
CO:=CO+1;
END;
CLOSEFILE(INPUT);
Memo2.Lines.Append('本次读取文件:'+EDIT3.Text);
Memo2.Lines.Append('本次读取号码:'+INTTOSTR(CO)+'个');
Memo2.Lines.Append('**********************');
BitBtn1.Enabled:=TRUE;
Label8.Caption:='总用户数:'+IntToStr(ListBox1.Items.Count);
end;
procedure TFrm_ManagerSMSSend.CheckListBox1DblClick(Sender: TObject);
var
index:integer;
begin
If ListBox1.Items.Count>0 Then
Begin
index:=GetFirstSelection(ListBox1);
ListBox1.Items.Delete(index);
Label8.Caption:='总用户数:'+IntToStr(ListBox1.Items.Count);
End;
If ListBox1.Items.Count>0 Then
BitBtn1.Enabled := True
else
BitBtn1.Enabled := False;
end;
procedure TFrm_ManagerSMSSend.Memo1KeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);
//var
// InputString , OutString : String;
begin
{
if key=vk_return then
begin
if UpperCase(Trim(Memo1.Text))='Q' then //需要输入群呼贺辞
begin
dm_main.QueryZZC.Close;
dm_main.QueryZZC.SQL.Clear;
dm_main.QueryZZC.SQL.Add(' select * from qhhc ');
dm_main.QueryZZC.Open;
dm_main.QueryZZC.First;
OutString:='';
while not dm_main.QueryZZC.Eof do
begin
OutString:=OutString+dm_main.QueryZZC.FieldByName('qhseq').AsString+' ---> '+dm_main.QueryZZC.FieldByName('qhhcnr').AsString+#13;
dm_main.QueryZZC.Next;
end;
ShowMessage(OutString);
if not InputQuery('请选择贺词代码','代码为:',InputString) then Exit;
try
StrToInt64(InputString);
except
ShowMessage('对不起,你必须输入贺词的代码!');
Exit;
end;
dm_main.QueryZZC.Close;
dm_main.QueryZZC.SQL.Clear;
dm_main.QueryZZC.SQL.Add(' select * from qhhc where qhseq='+InputString);
dm_main.QueryZZC.Open;
Memo1.Text:=dm_main.QueryZZC.fieldbyname('qhhcnr').AsString;
end;
end;
}
end;
procedure TFrm_ManagerSMSSend.PageControl2Change(Sender: TObject);
begin
ListBox1.Clear; //2001-6-28 CQB
Label8.Caption:='总用户数:0'
end;
procedure TFrm_ManagerSMSSend.BitBtn5Click(Sender: TObject);
begin
Application.CreateForm(TFrm_SelectInfo, Frm_SelectInfo);
Frm_SelectInfo.ShowModal;
If Frm_SelectInfo.PubStr<>'' Then
Memo1.Text:=Frm_SelectInfo.PubStr;
end;
procedure TFrm_ManagerSMSSend.EditDHHMKeyPress(Sender: TObject;
var Key: Char);
begin
if not (key in ['0'..'9',chr(vk_back),chr(vk_return)] )then key:=#0;
end;
procedure TFrm_ManagerSMSSend.FlatButton2Click(Sender: TObject);
const b:boolean=false;
var i:integer;
begin
if b=true then
begin
for i:=0 to listbox1.Items.Count-1 do
listbox1.Checked[i]:=true;
b:=false;
flatbutton2.Caption :='全不选'
end
else
begin
for i:=0 to listbox1.Items.Count-1 do
listbox1.Checked [i]:=false;
b:=true;
flatbutton2.caption:='全部选';
end;
ListBox1ClickCheck(nil);
end;
procedure TFrm_ManagerSMSSend.Edit1KeyPress(Sender: TObject;
var Key: Char);
begin
if (ComboBox1.ItemIndex=0 )
and not (key in ['0'..'9',chr(vk_back),chr(vk_return)])
then key:=#0;
end;
procedure TFrm_ManagerSMSSend.ListBox1ClickCheck(Sender: TObject);
var
i, j : integer;
begin
j := 0;
if ListBox1.Items.Count>0 then
begin
for i := 0 to ListBox1.Items.count -1 do
if listbox1.Checked[i] then inc(j);
end;
if j <> 0 then
BitBtn1.Enabled := True
else
BitBtn1.Enabled := False;
end;
procedure TFrm_ManagerSMSSend.FlatButton1Click(Sender: TObject);
begin
Memo1.Clear;
Memo1.SetFocus;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -