You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

184 lines
5.2 KiB
Plaintext

unit u_send_msg;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BusinessSkinForm, bsSkinCtrls, StdCtrls, RxLookup, DB, ADODB,
kbmMemTable, DBCtrls, Mask, Grids, DBGrids;
type
Tfrm_send_msg = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinGroupBox1: TbsSkinGroupBox;
bsSkinGroupBox2: TbsSkinGroupBox;
Label1: TLabel;
Label2: TLabel;
RxDBLookupCombo5: TRxDBLookupCombo;
RxDBLookupCombo3: TRxDBLookupCombo;
bsSkinGroupBox3: TbsSkinGroupBox;
checkboxMSN: TbsSkinCheckRadioBox;
checkboxMAIL: TbsSkinCheckRadioBox;
checkboxMSG: TbsSkinCheckRadioBox;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton44: TbsSkinButton;
bsSkinButton45: TbsSkinButton;
t_crm_client_link: TADOQuery;
t_crm_client_link1: TDataSource;
memmsg: TkbmMemTable;
memmsg1: TDataSource;
DBMemo1: TDBMemo;
DBEdit1: TDBEdit;
memmsgField: TStringField;
memmsgField2: TStringField;
memmsgField3: TStringField;
memmsgField4: TStringField;
bsSkinButton1: TbsSkinButton;
t_msg_mold: TADOQuery;
procedure RxDBLookupCombo3Change(Sender: TObject);
procedure bsSkinButton45Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo5Change(Sender: TObject);
procedure bsSkinButton44Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure t_msg_moldAfterInsert(DataSet: TDataSet);
private
{ Private declarations }
public
transtype:smallint;
{ Public declarations }
end;
var
frm_send_msg: Tfrm_send_msg;
implementation
uses u_main, u_data_share,my_sys_function, u_msg_mold;
{$R *.dfm}
procedure Tfrm_send_msg.RxDBLookupCombo3Change(Sender: TObject);
begin
if checkboxMSN.Checked then begin
memmsg.FieldByName('·¢ËͺÅÂë').AsString:=t_crm_client_link.fieldbyname('MSN').AsString;
exit;
end;
if checkboxMAIL.Checked then begin
memmsg.FieldByName('·¢ËͺÅÂë').AsString:=t_crm_client_link.fieldbyname('ÓÊÏä').AsString;
exit;
end;
if checkboxMSG.Checked then begin
memmsg.FieldByName('·¢ËͺÅÂë').AsString:=t_crm_client_link.fieldbyname('ÊÖ»ú').AsString;
exit;
end;
end;
procedure Tfrm_send_msg.bsSkinButton45Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_send_msg.FormShow(Sender: TObject);
begin
DBEdit1.SetFocus;
end;
procedure Tfrm_send_msg.DBEdit1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
bsSkinButton44.OnClick(Sender);
end;
procedure Tfrm_send_msg.RxDBLookupCombo5Change(Sender: TObject);
begin
if not t_crm_client_link.IsEmpty then begin
t_crm_client_link.first;
memmsg.FieldByName('ÊÕ¼þÈË').AsString:=t_crm_client_link['ÐÕÃû'];
if checkboxMSN.Checked then begin
memmsg.FieldByName('·¢ËͺÅÂë').AsString:=t_crm_client_link.fieldbyname('MSN').AsString;
exit;
end;
if checkboxMAIL.Checked then begin
memmsg.FieldByName('·¢ËͺÅÂë').AsString:=t_crm_client_link.fieldbyname('ÓÊÏä').AsString;
exit;
end;
if checkboxMSG.Checked then begin
memmsg.FieldByName('·¢ËͺÅÂë').AsString:=t_crm_client_link.fieldbyname('ÊÖ»ú').AsString;
exit;
end;
end else begin
memmsg.FieldByName('ÊÕ¼þÈË').AsString:='';
memmsg.FieldByName('·¢ËͺÅÂë').AsString:='';
end;
end;
procedure Tfrm_send_msg.bsSkinButton44Click(Sender: TObject);
begin
//////////cmd,msgtitle,msg,revname
{
try
if checkboxMSN.Checked then
senddllmsg(pchar('msn'),pchar(RxDBLookupCombo5.Value),pchar(dbmemo1.Text),pchar(DBEdit1.Text)) ;
if checkboxMAIL.Checked then
senddllmsg(pchar('email'),pchar(RxDBLookupCombo5.Value),pchar(dbmemo1.Text),pchar(DBEdit1.Text)) ;
if checkboxMSG.Checked then
senddllmsg(pchar('TEL'),pchar(RxDBLookupCombo5.Value),pchar(dbmemo1.Text),pchar(DBEdit1.Text)) ;
finally
close ;
end ;
}
try
if checkboxMSN.Checked then
if Assigned(msgclient) then
msgclient.sendmsg('ÒµÎñ״̬ÌáÐÑ','ÒµÎñ״̬ÌáÐÑ',dbmemo1.Text,DBEdit1.Text,'MSN','');
if checkboxMAIL.Checked then
if Assigned(msgclient) then
msgclient.sendmsg('ÒµÎñ״̬ÌáÐÑ','ÒµÎñ״̬ÌáÐÑ',dbmemo1.Text,DBEdit1.Text,'EMAIL','');
if checkboxMSG.Checked then
if Assigned(msgclient) then
msgclient.sendmsg('ÒµÎñ״̬ÌáÐÑ','ÒµÎñ״̬ÌáÐÑ',dbmemo1.Text,DBEdit1.Text,'TEL','');
finally
close ;
end ;
end;
procedure Tfrm_send_msg.bsSkinButton1Click(Sender: TObject);
begin
if not if_open('310') then
begin
showmessage('¶Ô²»ÆðÄãûÓдËÄ£¿éµÄ²Ù×÷ȨÏÞ£¡');
exit;
end;
if t_msg_mold.IsEmpty then t_msg_mold.Insert;
frm_msg_mold:=Tfrm_msg_mold.create(self);
try
frm_msg_mold.transtype:=transtype;
frm_msg_mold.t_msg_mold1.DataSet:=t_msg_mold;
frm_msg_mold.ShowModal;
finally
FreeAndNil(frm_msg_mold);
end;
end;
procedure Tfrm_send_msg.t_msg_moldAfterInsert(DataSet: TDataSet);
begin
if transtype=1 then
dataset.FieldByName('ÏûÏ¢ÀàÐÍ').AsString:='º£Ô˳ö¿Ú'
else if transtype=2 then
dataset.FieldByName('ÏûÏ¢ÀàÐÍ').AsString:='º£Ô˽ø¿Ú'
else if transtype=3 then
dataset.FieldByName('ÏûÏ¢ÀàÐÍ').AsString:='¿ÕÔ˳ö¿Ú'
else if transtype=4 then
dataset.FieldByName('ÏûÏ¢ÀàÐÍ').AsString:='¿ÕÔ˽ø¿Ú';
end;
end.