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.

1959 lines
66 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_Simpleprint;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
dxExEdtr, ppDB, ppProd, ppClass, ppReport, bsDialogs, bsSkinShellCtrls,
ppDsgnDB, ppRelatv, ppDBPipe, DB, ADODB, ppComm, ppEndUsr,
BusinessSkinForm, StdCtrls, Mask, bsSkinBoxCtrls, bsdbctrls, bsSkinCtrls,
dxTL, dxDBCtrl, dxDBGrid, dxCntner, dxDBTLCl, dxGrClms, DBCtrls, XPMenu,
Menus, TXComp, ExtDlgs, ImgList, IdFTP,IdFTPCommon, frxChBox, frxOLE,
frxDCtrl, frxCross, frxClass, frxADOComponents, frxRich, frxExportCSV,
frxExportImage, frxExportMail, frxGZip, frxCrypt, frxDesgn, frxExportODF,
frxExportPDF, frxExportXML, frxExportXLS, frxExportHTML, frxExportText,
frxExportRTF, frxDBSet, Grids, DBGrids, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase,
IdMessageClient, IdSMTPBase, IdSMTP, IdMessage,IdAttachmentFile,IdText,
ExtCtrls,SoapHTTPClient,u_op_seae_DsWebService,InvokeRegistry;
type
Tfrm_SimplePrint = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
t_sys_report: TADOQuery;
t_sys_report1: TDataSource;
bsSkinInputDialog1: TbsSkinInputDialog;
bsSkinPanel1: TbsSkinPanel;
Label1: TLabel;
DBEdit1: TDBEdit;
Label2: TLabel;
DBEdit2: TDBEdit;
Button5: TButton;
PopupMenu1: TPopupMenu;
XPMenu1: TXPMenu;
N1: TMenuItem;
N2: TMenuItem;
EXCEL1: TMenuItem;
N3: TMenuItem;
WORD1: TMenuItem;
N4: TMenuItem;
PDF1: TMenuItem;
N5: TMenuItem;
RTF1: TMenuItem;
ImageList: TImageList;
OpenDialog1: TOpenDialog;
t_sys_report_employee: TADOQuery;
t_sys_report_lei: TADOQuery;
t_sys_reportfile: TADOQuery;
t_sys_reportfile1: TDataSource;
frxBMPExport1: TfrxBMPExport;
frxJPEGExport1: TfrxJPEGExport;
frxTIFFExport1: TfrxTIFFExport;
frxRTFExport1: TfrxRTFExport;
frxSimpleTextExport1: TfrxSimpleTextExport;
frxHTMLExport1: TfrxHTMLExport;
frxXLSExport1: TfrxXLSExport;
frxPDFExport1: TfrxPDFExport;
frxODSExport1: TfrxODSExport;
frxODTExport1: TfrxODTExport;
frxDesigner1: TfrxDesigner;
frxCrypt1: TfrxCrypt;
frxGZipCompressor1: TfrxGZipCompressor;
frxMailExport1: TfrxMailExport;
frxGIFExport1: TfrxGIFExport;
frxCSVExport1: TfrxCSVExport;
frxRichObject1: TfrxRichObject;
frxReport1: TfrxReport;
frxADOComponents1: TfrxADOComponents;
frxCrossObject1: TfrxCrossObject;
frxDialogControls1: TfrxDialogControls;
frxOLEObject1: TfrxOLEObject;
frxCheckBoxObject1: TfrxCheckBoxObject;
one_table_1: TfrxDBDataset;
one_table_2: TfrxDBDataset;
one_table_3: TfrxDBDataset;
one_table_4: TfrxDBDataset;
all_table_4: TfrxDBDataset;
all_table_3: TfrxDBDataset;
all_table_2: TfrxDBDataset;
all_table_1: TfrxDBDataset;
all_table_7: TfrxDBDataset;
all_table_5: TfrxDBDataset;
all_table_6: TfrxDBDataset;
print_head: TfrxDBDataset;
load_employee: TfrxDBDataset;
t_sys_cust: TADOQuery;
t_sys_cust1: TDataSource;
load_cust: TfrxDBDataset;
SaveDialog1: TSaveDialog;
ds_sys_reporthead1: TDataSource;
t_sys_reporthead: TADOQuery;
all_table_8: TfrxDBDataset;
all_table_9: TfrxDBDataset;
PopupMenu2: TPopupMenu;
MenuItem1: TMenuItem;
MenuItem2: TMenuItem;
MenuItem3: TMenuItem;
MenuItem4: TMenuItem;
MenuItem5: TMenuItem;
MenuItem6: TMenuItem;
MenuItem7: TMenuItem;
MenuItem8: TMenuItem;
MenuItem9: TMenuItem;
frxHTMLExport2: TfrxHTMLExport;
SMTP1: TIdSMTP;
IdMsg: TIdMessage;
frxPDFExport2: TfrxPDFExport;
frxRTFExport2: TfrxRTFExport;
frxJPEGExport2: TfrxJPEGExport;
frxXLSExport2: TfrxXLSExport;
pnl1: TPanel;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridCheckColumn;
bsSkinPanel3: TbsSkinPanel;
bsSkinDBEdit1: TbsSkinDBEdit;
bsSkinPanel2: TbsSkinPanel;
bsSkinButton12: TbsSkinButton;
bsSkinPanel4: TbsSkinPanel;
bsSkinButton6: TbsSkinButton;
bsSkinButton8: TbsSkinButton;
bsSkinButton7: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinButton13: TbsSkinButton;
pnl2: TPanel;
bsSkinPanel5: TbsSkinPanel;
bsSkinNotebook1: TbsSkinNotebook;
Label44: TLabel;
DBMemo14: TDBMemo;
Edit1: TEdit;
Edit2: TEdit;
bsSkinPanel6: TbsSkinPanel;
lbl1: TLabel;
mmo1: TMemo;
Qry1: TADOQuery;
procedure bsSkinButton8Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure bsSkinButton7Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure EXCEL1Click(Sender: TObject);
procedure WORD1Click(Sender: TObject);
procedure PDF1Click(Sender: TObject);
procedure RTF1Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure t_sys_reportAfterPost(DataSet: TDataSet);
procedure bsSkinButton12Click(Sender: TObject);
procedure t_sys_reportAfterOpen(DataSet: TDataSet);
procedure t_sys_reportBeforeClose(DataSet: TDataSet);
procedure t_sys_reportfileAfterInsert(DataSet: TDataSet);
procedure t_sys_reportfileAfterPost(DataSet: TDataSet);
function frxDesigner1SaveReport(Report: TfrxReport;
SaveAs: Boolean): Boolean;
function frxReport1UserFunction(const MethodName: String;
var Params: Variant): Variant;
procedure FormCreate(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure MenuItem7Click(Sender: TObject);
procedure bsSkinButton13Click(Sender: TObject);
procedure MenuItem9Click(Sender: TObject);
procedure MenuItem3Click(Sender: TObject);
procedure MenuItem5Click(Sender: TObject);
procedure MenuItem1Click(Sender: TObject);
procedure getwebservice_ds;
private
mHttpRIO_ds:THTTPRIO;
mServiceSoap_Ds:DsWebServiceSoap;
function GetFileName(ExtName:string):string; overload;
function GetFileName(filename:string;ExtName:string):string; overload;
procedure SendMSG(msg:String);
public
MBLNO:String;
Email,SenderName:String;
procedure SendEmail(HtmlList:TStringList);
procedure SendRHEmail(FileName:String);
procedure SendSIEmail(FileName:String);
procedure SendSOEmail(FileName:String);
procedure SendBLCRepeatEmail(FileName:String);
procedure DirectSendEmail(Caption:string) ;
end;
var
frm_SimplePrint: Tfrm_SimplePrint;
implementation
uses u_main, u_data_share,
my_sys_function, u_code_send_head, u_sys_frprint,u_op_letter, u_op_seae,
u_sys_progress;
{$R *.dfm}
procedure Tfrm_SimplePrint.bsSkinButton8Click(Sender: TObject);
var
template : TStream;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
exit;
end;
if t_sys_reportfile.fieldbyname('report').IsNull then begin
showmessage('û<><C3BB>ҪԤ<D2AA><D4A4><EFBFBD>ĸ<EFBFBD>ʽ<EFBFBD><CABD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
frxReport1.Print;
except
showmessage('<27><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
if frm_sys_frprint.caption='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤' then
begin
if not t_sys_report_employee.Locate('CH_ID',t_sys_report.fieldbyname('CH_ID').asinteger,[])then
begin
t_sys_report_employee.insert;
t_sys_report_employee['CH_ID']:=t_sys_report['CH_ID'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_report['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=employee;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end
else
begin
t_sys_report_employee.edit;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end;
end;
end;
procedure Tfrm_SimplePrint.bsSkinButton2Click(Sender: TObject);
var
book1:Tbookmark;
str:string;
begin
try
t_sys_report.DisableControls;
book1:=t_sys_report.GetBookmark;
str:=t_sys_report.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
t_sys_report.First;
while not t_sys_report.eof do
begin
if t_sys_report.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring=str then
begin
t_sys_report.edit;
t_sys_report['<27>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>']:=1;
t_sys_report.post;
end
else
begin
t_sys_report.edit;
t_sys_report['<27>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>']:=0;
t_sys_report.post;
end;
t_sys_report.next;
end;
finally
t_sys_report.GotoBookmark(book1);
t_sys_report.EnableControls;
end;
end;
procedure Tfrm_SimplePrint.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_SimplePrint.bsSkinButton3Click(Sender: TObject);
begin
if t_sys_report.IsEmpty then begin
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select top 0 * from t_sys_report ');
t_sys_reportfile.Open;
end else begin
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
end;
t_sys_reportfile.Insert;
t_sys_reportfile['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=bsSkinInputDialog1.InputBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>',t_sys_reportfile.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
t_sys_reportfile['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤';//frm_SimplePrint.Caption;
t_sys_reportfile.post;
{
if frm_sys_frprint.caption='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤' then
begin
if not t_sys_report_employee.Locate('CH_ID',t_sys_reportfile.fieldbyname('CH_ID').asinteger,[])then
begin
t_sys_report_employee.insert;
t_sys_report_employee['CH_ID']:=t_sys_reportfile['CH_ID'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_reportfile['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=employee;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end
else
begin
t_sys_report_employee.edit;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end;
end;
}
frxReport1.DesignReport;
end;
procedure Tfrm_SimplePrint.bsSkinButton4Click(Sender: TObject);
var
template : TStream;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<><C3BB>Ҫ<EFBFBD><D2AA><EFBFBD>Ƶĸ<C6B5>ʽ<EFBFBD><CABD>');
exit;
end;
try
if not t_sys_reportfile.fieldbyname('report').IsNull then begin
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
end;
frxReport1.DesignReport;
except
showmessage('<27><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
if frm_sys_frprint.caption='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤' then
begin
if not t_sys_report_employee.Locate('CH_ID',t_sys_reportfile.fieldbyname('CH_ID').asinteger,[])then
begin
t_sys_report_employee.insert;
t_sys_report_employee['CH_ID']:=t_sys_reportfile['CH_ID'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_reportfile['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=employee;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end
else
begin
t_sys_report_employee.edit;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end;
end;
end;
procedure Tfrm_SimplePrint.bsSkinButton9Click(Sender: TObject);
begin
if t_sys_report.isempty then
begin
showmessage('û<><C3BB>Ҫɾ<D2AA><C9BE><EFBFBD>ĸ<EFBFBD>ʽ<EFBFBD><CABD>');
exit;
end;
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)=IDOK then
t_sys_report.delete;
end;
procedure Tfrm_SimplePrint.bsSkinButton1Click(Sender: TObject);
begin
if t_sys_report.isempty then
begin
showmessage('û<><C3BB>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶĸ<C6B5>ʽ<EFBFBD><CABD>');
exit;
end;
t_sys_report.edit;
t_sys_report['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=bsSkinInputDialog1.InputBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>',t_sys_report.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
t_sys_report.post;
end;
procedure Tfrm_SimplePrint.bsSkinButton6Click(Sender: TObject);
var
template : TStream;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
exit;
if t_sys_reportfile.fieldbyname('report').IsNull then begin
showmessage('û<><C3BB>ҪԤ<D2AA><D4A4><EFBFBD>ĸ<EFBFBD>ʽ<EFBFBD><CABD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.ShowReport;
except
showmessage('<27><>ӡԤ<D3A1><D4A4>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
if frm_sys_frprint.caption='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤' then
begin
if not t_sys_report_employee.Locate('CH_ID',t_sys_reportfile.fieldbyname('CH_ID').asinteger,[])then
begin
t_sys_report_employee.insert;
t_sys_report_employee['CH_ID']:=t_sys_reportfile['CH_ID'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_reportfile['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=employee;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end
else
begin
t_sys_report_employee.edit;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end;
end;
end;
procedure Tfrm_SimplePrint.FormShow(Sender: TObject);
begin
if not if_open('170') then
begin
bsSkinButton3.Enabled:=false;
bsSkinButton4.Enabled:=false;
bsSkinButton9.Enabled:=false;
bsSkinButton1.Enabled:=false;
bsSkinButton2.Enabled:=false;
bsSkinButton10.Enabled:=false;
bsSkinButton11.Enabled:=false;
end;
// frm_data_share.t_sys_report_head.Requery();
// frm_data_share.t_load_employee.Requery();
if not t_sys_reporthead.IsEmpty then
begin
t_sys_reporthead.edit;
t_sys_reporthead['̨ͷTO']:='';
t_sys_reporthead['̨ͷATTN']:='';
t_sys_reporthead.post;
end;
if frm_sys_frprint.caption='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤' then
bsSkinPanel2.Visible:=true;
// rd.XHD_help:=t_sys_report_lei.fieldbyname('<27><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>').asstring;
if (frm_simpleprint.Caption='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ')then
begin
bsSkinNotebook1.PageIndex:=0;
//DataSource1.Enabled:=false;
edit1.Text:=print_head.DataSource.DataSet.fieldbyname('̨ͷ1').asstring;
edit2.Text:='"'+SenderName+'"<'+Email+'>';
frm_op_letter.t_op_letter_rh.Edit;
DBMemo14.DataSource:=frm_op_letter.t_op_letter_rh1;
//dbedt1.DataSource:=frm_op_letter.t_op_letter_rh1;
end;
if (frm_simpleprint.Caption='<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>') then
begin
bsSkinNotebook1.PageIndex:=1;
//DataSource1.Enabled:=false;
edit1.Text:=print_head.DataSource.DataSet.fieldbyname('̨ͷ1').asstring;
edit2.Text:='"'+SenderName+'"<'+Email+'>';
{
DBMemo14.Enabled:=False;
bsSkinButton1.Visible:=True;
bsSkinButton4.Visible:=True;
bsSkinButton3.Visible:=True;
bsSkinButton9.Visible:=True;
bsSkinButton7.Visible:=True; }
end else begin
{
DBMemo14.Enabled:=true;
bsSkinButton1.Visible:=False;
bsSkinButton4.Visible:=False;
bsSkinButton3.Visible:=False;
bsSkinButton9.Visible:=False;
bsSkinButton7.Visible:=False; }
end;
end;
procedure Tfrm_SimplePrint.bsSkinButton7Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton7.ClientToScreen(Point(0,bsSkinButton7.Height));
PopupMenu1.Popup(Pnt.x,Pnt.y);
if frm_sys_frprint.caption='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤' then
begin
if not t_sys_report_employee.Locate('CH_ID',t_sys_report.fieldbyname('CH_ID').asinteger,[])then
begin
t_sys_report_employee.insert;
t_sys_report_employee['CH_ID']:=t_sys_report['CH_ID'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_report['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=employee;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end
else
begin
t_sys_report_employee.edit;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end;
end;
end;
procedure Tfrm_SimplePrint.N1Click(Sender: TObject);
var
template : TStream;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
frxReport1.Export(frxJPEGExport1);
except
showmessage('<27><>Ϊ<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
end;
procedure Tfrm_SimplePrint.EXCEL1Click(Sender: TObject);
var
template : TStream;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
frxReport1.Export(frxXLSExport1);
except
showmessage('<27><>Ϊ<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
end;
procedure Tfrm_SimplePrint.WORD1Click(Sender: TObject);
var
template : TStream;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
frxReport1.Export(frxHTMLExport1);
except
showmessage('<27><>Ϊ<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
end;
procedure Tfrm_SimplePrint.PDF1Click(Sender: TObject);
var
template : TStream;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
frxReport1.Export(frxPDFExport1);
except
showmessage('<27><>Ϊ<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
end;
procedure Tfrm_SimplePrint.RTF1Click(Sender: TObject);
var
template : TStream;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
frxReport1.Export(frxRTFExport1);
except
showmessage('<27><>Ϊ<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
end;
procedure Tfrm_SimplePrint.bsSkinButton10Click(Sender: TObject);
var
template : TStream;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
exit;
end;
if t_sys_reportfile.fieldbyname('report').IsNull then begin
showmessage('û<><C3BB>ҪԤ<D2AA><D4A4><EFBFBD>ĸ<EFBFBD>ʽ<EFBFBD><CABD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
if SaveDialog1.Execute then
frxReport1.savetofile(SaveDialog1.filename);
except
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽʧ<CABD>ܣ<EFBFBD>');
end;
// GetNewData('t_sys_report','CH_ID','',t_sys_reportfile);
{
try
IdFTP1:=TIdFTP.Create(application);
with idftp1 do
begin
Username:='dongsheng';
Password:='zouwenkun';
Host:='218.57.11.18';
Connect;
end;
idftp1.Disconnect;
update_jiandu;
try
if not assigned(frm_sys_print_down) then
frm_sys_print_down:=tfrm_sys_print_down.Create (self);
frm_sys_print_down.Caption:=frm_sys_print.Caption;
frm_sys_print_down.ShowModal;
finally
frm_sys_print_down.free;
frm_sys_print_down:=NIL;
end;
except
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><D8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
end;
idftp1.free;
}
end;
procedure Tfrm_SimplePrint.t_sys_reportAfterPost(DataSet: TDataSet);
begin
if frm_sys_frprint.caption='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤' then
begin
if not t_sys_report_employee.Locate('CH_ID',t_sys_report.fieldbyname('CH_ID').asinteger,[])then
begin
t_sys_report_employee.insert;
t_sys_report_employee['CH_ID']:=t_sys_report['CH_ID'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_report['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=employee;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end
else
begin
t_sys_report_employee.edit;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end;
end;
end;
procedure Tfrm_SimplePrint.bsSkinButton12Click(Sender: TObject);
var
str:widestring;
begin
if bsSkinButton12.caption='<27><><EFBFBD>и<EFBFBD>ʽ'then
begin
bsSkinButton12.caption:='<27><><EFBFBD>ڸ<EFBFBD>ʽ';
t_sys_reportfile.close;
t_sys_report.close;
t_sys_report.sql.clear;
t_sys_report.sql.add('select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>,CH_ID from t_sys_report where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_sys_report.Parameters[0].value:=frm_sys_frprint.caption;
t_sys_report.open;
t_sys_reportfile.Open;
end
else
begin
if not t_sys_report_employee.IsEmpty then
begin
t_sys_report_employee.first;
while not t_sys_report_employee.eof do
begin
if t_sys_report_employee.fieldbyname('<27><><EFBFBD><EFBFBD>').AsDateTime>=date-30 then
begin
if str='' then
str:=t_sys_report_employee.fieldbyname('CH_ID').asstring
else
str:=str+','+t_sys_report_employee.fieldbyname('CH_ID').asstring;
end;
t_sys_report_employee.next;
end;
str:=' and CH_ID in ('+str+')';
t_sys_reportfile.close;
t_sys_report.close;
t_sys_report.sql.clear;
t_sys_report.sql.add('select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>,CH_ID from t_sys_report where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '+str+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_sys_report.Parameters[0].value:=frm_sys_frprint.caption;
t_sys_report.open;
t_sys_reportfile.Open;
end
else
begin
t_sys_reportfile.close;
t_sys_report.close;
t_sys_report.sql.clear;
t_sys_report.sql.add('select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>,CH_ID from t_sys_report where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_sys_report.Parameters[0].value:=frm_sys_frprint.caption;
t_sys_report.open;
t_sys_reportfile.Open;
end;
bsSkinButton12.caption:='<27><><EFBFBD>и<EFBFBD>ʽ';
end;
end;
procedure Tfrm_SimplePrint.t_sys_reportAfterOpen(DataSet: TDataSet);
begin
// t_sys_reportfile.Open;
end;
procedure Tfrm_SimplePrint.t_sys_reportBeforeClose(DataSet: TDataSet);
begin
// t_sys_reportfile.Close;
end;
procedure Tfrm_SimplePrint.t_sys_reportfileAfterInsert(DataSet: TDataSet);
begin
t_sys_reportfile['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_sys_frprint.Caption;
t_sys_reportfile['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_sys_frprint.Caption;
t_sys_reportfile['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='12311';
t_sys_reportfile['<27>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>']:=false;
end;
procedure Tfrm_SimplePrint.t_sys_reportfileAfterPost(DataSet: TDataSet);
var
str:widestring;
begin
if frm_sys_frprint.caption='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤' then
begin
if not t_sys_report_employee.Locate('CH_ID',t_sys_reportfile.fieldbyname('CH_ID').asinteger,[])then
begin
t_sys_report_employee.insert;
t_sys_report_employee['CH_ID']:=t_sys_reportfile['CH_ID'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_reportfile['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=employee;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end
else
begin
t_sys_report_employee.edit;
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
t_sys_report_employee.post;
end;
if bsSkinButton12.caption='<27><><EFBFBD>и<EFBFBD>ʽ'then
begin
if not t_sys_report_employee.IsEmpty then
begin
t_sys_report_employee.first;
while not t_sys_report_employee.eof do
begin
if t_sys_report_employee.fieldbyname('<27><><EFBFBD><EFBFBD>').AsDateTime>=date-30 then
begin
if str='' then
str:=t_sys_report_employee.fieldbyname('CH_ID').asstring
else
str:=str+','+t_sys_report_employee.fieldbyname('CH_ID').asstring;
end;
t_sys_report_employee.next;
end;
str:=' and CH_ID in ('+str+')';
t_sys_report.close;
t_sys_report.sql.clear;
t_sys_report.sql.add('select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>,CH_ID from t_sys_report where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '+str+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_sys_report.Parameters[0].value:=frm_sys_frprint.caption;
t_sys_report.open;
end
else
begin
t_sys_report.close;
t_sys_report.sql.clear;
t_sys_report.sql.add('select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>,CH_ID from t_sys_report where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_sys_report.Parameters[0].value:=frm_sys_frprint.caption;
t_sys_report.open;
end;
end
else
begin
t_sys_report.close;
t_sys_report.sql.clear;
t_sys_report.sql.add('select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>,CH_ID from t_sys_report where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_sys_report.Parameters[0].value:=frm_sys_frprint.caption;
t_sys_report.open;
end;
end else
t_sys_report.Requery;
t_sys_report.Locate('CH_ID',t_sys_reportfile['CH_ID'],[]);
end;
function Tfrm_SimplePrint.frxDesigner1SaveReport(Report: TfrxReport;
SaveAs: Boolean): Boolean;
var template : TStream;
begin
if saveas then begin
try
if SaveDialog1.Execute then
frxReport1.savetofile(SaveDialog1.filename);
except
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽʧ<CABD>ܣ<EFBFBD>');
end;
end else begin
template := TMemoryStream.Create;
template.Position := 0;
frxReport1.SaveToStream(template);
t_sys_reportfile.Edit;
try
t_sys_reportfile.DisableControls;
(t_sys_reportfile.FieldByName('Report') as TBlobField).LoadFromStream(template);
t_sys_reportfile.Post;
finally
t_sys_reportfile.EnableControls;
template.Free;
end;
result:=true;
end;
end;
function Tfrm_SimplePrint.frxReport1UserFunction(const MethodName: String;
var Params: Variant): Variant;
begin
//
if uppercase(MethodName)='MONEYCN' then
Result := MoneyCn(Params[0],Params[1]);
if uppercase(MethodName)='ENGDATEFMT' then
Result := EngDateFmt(Params[0],Params[1],Params[2],Params[3],Params[4],Params[5],Params[6]);
if uppercase(MethodName)='GETCUSTBALDATE' then
Result :=formatdatetime('YYYY-MM-DD',getstlDate(Params[0],Params[1],Params[2]));
if uppercase(MethodName)='GETCUSTBALDAY' then
Result :=inttostr(getstlDay(Params[0],Params[1],Params[2]));
if uppercase(MethodName)='MONEYEN' then
Result := EWords(Params[0],0);
end;
procedure Tfrm_SimplePrint.FormCreate(Sender: TObject);
begin
frxReport1.AddFunction('function MoneyCn(num:real;lx:boolean=false):widestring;','<27>Զ<EFBFBD><D4B6><EFBFBD>');
frxReport1.AddFunction('function MoneyEn(num:real;):widestring;','<27>Զ<EFBFBD><D4B6><EFBFBD>');
frxReport1.AddFunction('function EngDateFmt(ADateTime:TDateTime;JX,DX:boolean;MDY:Boolean=true;MD:Boolean=false;DIAN:Boolean=false;MY:Boolean=false):string;','<27>Զ<EFBFBD><D4B6><EFBFBD>');
frxReport1.AddFunction('function GETCUSTBALDATE(ADateTime:TDateTime;Cust,Sale:String):TDateTime;','<27>Զ<EFBFBD><D4B6><EFBFBD>');
frxReport1.AddFunction('function GETCUSTBALDAY(ADateTime:TDateTime;Cust,Sale:String):integer;','<27>Զ<EFBFBD><D4B6><EFBFBD>');
end;
procedure Tfrm_SimplePrint.Button5Click(Sender: TObject);
begin
try
frm_code_send_head:=tfrm_code_send_head.Create (self);
code_send_head_num:=5;
frm_code_send_head.DataSource2:=ds_sys_reporthead1;
frm_code_send_head.ShowModal;
finally
frm_code_send_head.Free;
frm_code_send_head:=nil;
end;
end;
procedure Tfrm_SimplePrint.MenuItem7Click(Sender: TObject);
var
txtFile: TextFile;//<2F><>Ϊhtml<6D><6C><EFBFBD><EFBFBD>
template : TStream;
filename,temp:string;
//str_memo:Tmemo;
HtmlList:TStringList;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>');
exit;
end;
try {
str_memo:=Tmemo.create(application);
str_memo.visible:=false;
str_memo.Parent:=frm_sys_frprint; }
htmlList:=TStringList.create();
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
filename:=GetFileName('.file');
frxHTMLExport2.FileName:=filename;
frxReport1.Export(frxHTMLExport2);
AssignFile(txtFile,filename);
Reset(txtFile); //<2F><>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
try
while not EOF(txtFile) do
begin
Readln(txtFile,temp);
HtmlList.Add(temp)
end;
finally
CloseFile(txtFile); //<2F>ر<EFBFBD><D8B1>ļ<EFBFBD>
DeleteFile(filename);
SendEmail(HtmlList) ;
end;
except
showmessage('<27><>Ϊ<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
finally
end;
end;
procedure Tfrm_SimplePrint.bsSkinButton13Click(Sender: TObject);
var p:TPoint;
begin
if frm_simpleprint.Caption='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ' then
begin
//ShowMessage(frm_op_letter.t_op_letter_rh.fieldbyname('<27><>ע').asstring);
if frm_op_letter.t_op_letter_rh.state in [dsinsert,dsedit] then
frm_op_letter.t_op_letter_rh.Post;
end;
if frm_simpleprint.Caption='<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>' then
begin
//<2F><EFBFBD><E1B5A5><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD> <20><>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EBB8A8><EFBFBD>ֶ<EFBFBD>3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>η<EFBFBD><CEB7><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>Ϣ <20><>д<EFBFBD><D0B4><EFBFBD>ʼ<EFBFBD><CABC>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>
frm_op_seae.t_op_seae.edit;
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>']:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>').asstring
+' '+mmo1.Lines.Text;
frm_op_seae.t_op_seae.post;
//ShowMessage(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>').asstring);
end;
frm_SimplePrint.MenuItem9Click(Sender);
end;
procedure Tfrm_SimplePrint.SendEmail(HtmlList:TStringList);
var
str:widestring;
str_file:widestring;
IdHtml: TIdText;
_i:integer;
begin
IdMsg.Clear;
try
if HtmlList.count>0 then begin
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
SMTP1.username:='admin@dongshengsoft.com';
SMTP1.Password :='ds!@#)(*';
SMTP1.Host :='smtpcom.263xmail.com';
SMTP1.Port :=25;
try
SMTP1.Connect;
except
on e : Exception do
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+E.Message);
end;
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
try
with IdMsg do
begin
body.Clear;
// ContentType:='us-ascii';
// CharSet:='GB2312';
IdHtml := TIdText.Create(MessageParts);
IdHtml.ContentType := 'text/html;charset=gb2312';
IdHtml.ContentTransfer := '7bit';
for _i:=0 to HtmlList.count-1 do begin
IdHtml.Body.Add(HtmlList[_i]);
end;
From.address :='admin@dongshengsoft.com';
// From.address :='crazymanqd@126.com';
Recipients.EMailAddresses :=DBEdit1.text;
Subject:=employee +'<27><>'+frm_simpleprint.Caption;
t_sys_reporthead.SaveToFile(ExtractFilePath(Application.ExeName)+employee+'.file');
TIdAttachmentFile.Create(MessageParts,ExtractFilePath(Application.ExeName)+employee+'.file');
//TIdAttachment.Create(MessageParts,ExtractFilePath(Application.ExeName)+edit5.text+'.DS');
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
SMTP1.Send(IdMsg);
//MessageDlg('<27><><EFBFBD><EFBFBD>շ<EFBFBD><D5B7>ͳɹ<CDB3>',mtConfirmation,[mbOK],0)
finally
SMTP1.Disconnect;
deletefile(ExtractFilePath(Application.ExeName)+employee+'.file');
end;
end;
except
frm_op_seae.SendedEmail:=false;
MessageDlg('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC>˻<EFBFBD><CBBB><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><E4B2BB><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><E7BBB0>ϵ:0532-83889257!',mtError,[mbOK],0);
end;
end;
procedure Tfrm_SimplePrint.MenuItem9Click(Sender: TObject);
var
template : TStream; //<2F><>Ϊpdf<64><66><EFBFBD><EFBFBD>
FileName:String;
begin
try
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress := tfrm_sys_progress.Create(application);
frm_sys_progress.bsSkinGauge1.ProgressText := '<27><><EFBFBD>ڻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ򡣡<C8BA><F2A1A3A1><EFBFBD>';
frm_sys_progress.bsSkinGauge1.MaxValue := 5;
frm_sys_progress.bsSkinGauge1.MinValue := 0;
frm_sys_progress.Show;
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
frxPDFExport2.FileName:=GetFileName('.PDF');
frxReport1.Export(frxPDFExport2);
if frm_SimplePrint.Caption='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ' then
SendRHEmail(frxPDFExport2.FileName);
if frm_SimplePrint.Caption='<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>' then
SendBLCRepeatEmail(frxPDFExport2.FileName);
except
showmessage('<27><>Ϊ<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
finally
frm_sys_progress.Close;
frm_sys_progress.Free;
frm_sys_progress := nil;
end;
end;
procedure Tfrm_SimplePrint.DirectSendEmail(Caption:string) ;
var
template : TStream; //<2F><>Ϊpdf<64><66><EFBFBD><EFBFBD>
FileName:String;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
if Caption='<27><><EFBFBD><EFBFBD>' then
frxPDFExport2.FileName:=GetFileName('SPXNO<4E><4F>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring+'_'+Caption,'.PDF');
if Caption='<27>ᵥȷ<E1B5A5><C8B7>' then
frxPDFExport2.FileName:=GetFileName('_'+Caption+'.PDF');
//one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring
frxReport1.Export(frxPDFExport2);
if Caption='<27><><EFBFBD><EFBFBD>' then
SendSOEmail(frxPDFExport2.FileName);
if Caption='<27>ᵥȷ<E1B5A5><C8B7>' then
SendSIEmail(frxPDFExport2.FileName);
except
showmessage('<27><>Ϊ<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
end;
procedure Tfrm_SimplePrint.SendRHEmail(FileName: String);
var
str:widestring;
str_file:widestring;
IdHtml,IdFoot: TIdText;
_i:integer;
begin
IdMsg.Clear;
try
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
SMTP1.username:='admin@dongshengsoft.com';
SMTP1.Password :='ds!@#)(*';
SMTP1.Host :='smtpcom.263xmail.com';
SMTP1.Port :=25;
try
SMTP1.Connect;
except
on e : Exception do
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+E.Message);
end;
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
try
with IdMsg do
begin
//body.Clear;
IdMsg.From.address :=one_table_4.DataSource.DataSet.fieldbyname('ReceiverEmail').asstring;
// From.address :='crazymanqd@126.com';
Recipients.EMailAddresses :=Email;
//Subject:=MBLNO +'<27><>'+frm_Simpleprint.caption;
//body.Add(Subject);
if (frm_Simpleprint.caption='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ') then begin
Subject:='<27><><EFBFBD><EFBFBD>֪ͨ:'+one_table_4.DataSource.DataSet.fieldbyname('ReceiverCompany').asstring+'--'+MBLNO
+'--'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
+'--'+one_table_1.DataSource.DataSet.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring
+'--'+one_table_1.DataSource.DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring;
IdHtml := TIdText.Create(MessageParts);
IdHtml.ContentType := 'text/html';
//IdHtml.ContentTransfer := '7bit';
IdHtml.Body.Add('<html>');
IdHtml.Body.Add(' <head>');
//IdHtml.Body.Add(' <title style="color:black; font-size:18pt;">' + Subject + '</title>');
IdHtml.Body.Add(' </head>');
IdHtml.Body.Add(' <Body>');
IdHtml.Body.Add(' <span style="color:black; font-size:10pt;font-family:''<27><><EFBFBD><EFBFBD>'';">' + Subject + '&nbsp;(ժҪ)</span>');
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;">');
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;font-family:''<27><><EFBFBD><EFBFBD>'';">');
IdHtml.Body.Add(' <br />TO<54><4F>'+one_table_4.DataSource.DataSet.fieldbyname('sendercompany').asstring);
IdHtml.Body.Add(' <br />FROM<4F><4D>'+one_table_4.DataSource.DataSet.fieldbyname('ReceiverCompany').asstring+'/'
+one_table_4.DataSource.DataSet.fieldbyname('ReceiverName').asstring
+'&nbsp;&nbsp;<3B>绰'+one_table_4.DataSource.DataSet.fieldbyname('Mobile').asstring
+'&nbsp;&nbsp;<3B><><EFBFBD><EFBFBD>'+one_table_4.DataSource.DataSet.fieldbyname('ReceiverEmail').asstring
);
IdHtml.Body.Add(' </div>');
//IdHtml.Body.Add(' <div style="color:black; font-size:9pt;"><3E><EFBFBD>ţ<EFBFBD>'+MBLNO);
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;"><br /><3E><><EFBFBD><EFBFBD>/<2F><><EFBFBD>Σ<EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><EFBFBD>ţ<EFBFBD>'+MBLNO);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD>˸ۣ<CBB8>'+one_table_1.DataSource.DataSet.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br />ж<><D0B6><EFBFBD>ۣ<EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br />Ŀ<>ĵأ<C4B5>'+one_table_1.DataSource.DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'&nbsp;'+one_table_1.DataSource.DataSet.fieldbyname('<27><>װ').asstring+'&nbsp;&nbsp;&nbsp;&nbsp;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'&nbsp;KGS&nbsp;&nbsp;&nbsp;&nbsp;<3B><><EFBFBD>룺'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'&nbsp;CBM');
IdHtml.Body.Add(' <br /><3E>ظ<EFBFBD>ʱ<EFBFBD>䣺'+one_table_1.DataSource.DataSet.fieldbyname('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E>ص<EFBFBD>ʱ<EFBFBD>䣺'+one_table_1.DataSource.DataSet.fieldbyname('<27>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><>&nbsp;&nbsp;վ<><D5BE>'+one_table_1.DataSource.DataSet.fieldbyname('<27><>վ').asstring);
IdHtml.Body.Add(' <br /><3E><>վ<EFBFBD><D5BE>ַ<EFBFBD><D6B7>'+one_table_3.DataSource.DataSet.fieldbyname('<27><>վ<EFBFBD><D5BE>ַ').asstring);
//IdHtml.Body.Add(' <br /><3E><>վ<EFBFBD><D5BE>ַ<EFBFBD><D6B7>'+StringReplace (one_table_3.DataSource.DataSet.fieldbyname('<27><>վ<EFBFBD><D5BE>ַ').asstring, '\n', '<br />', [rfReplaceAll]));
IdHtml.Body.Add(' <br /><3E><>վ<EFBFBD><D5BE>ϵ<EFBFBD>ˣ<EFBFBD>'+one_table_3.DataSource.DataSet.fieldbyname('<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>').asstring
+'&nbsp;&nbsp;&nbsp;&nbsp;<3B><EFBFBD><E7BBB0>'+one_table_3.DataSource.DataSet.fieldbyname('<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD>绰').asstring
+'&nbsp;&nbsp;&nbsp;&nbsp;<3B><><EFBFBD>棺'+one_table_3.DataSource.DataSet.fieldbyname('<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><>ע<EFBFBD><D7A2>'+StringReplace (one_table_3.DataSource.DataSet.fieldbyname('<27><>ע').asstring, #13#10, '<br />', [rfReplaceAll]));
IdHtml.Body.Add(' <br />ShippingBoxNO.<2E><>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring);
IdHtml.Body.Add('<br /><br /> **********<2A><><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><a href=http://www.shippingbox.cc style="color:blue;">ShippingBox<6F><78><EFBFBD><EFBFBD>ƽ̨</a><3E>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD> *************');
IdHtml.Body.Add('<br /><3E><><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><E1B9A9>ǰ<EFBFBD><C7B0><EFBFBD>ﲿ<EFBFBD><EFB2BF>ժҪ<D5AA><D2AA>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD><CBAB>Լ<EFBFBD><D4BC>Ϊ׼<CEAA><D7BC>');
IdHtml.Body.Add('<br /> <img src="http://123.57.17.72:8027/images/public/logo01.png" />');
IdHtml.Body.Add('<br /> <a href=http://www.shippingbox.cc style="color:blue;">www.shippingbox.cc</a>');
IdHtml.Body.Add(' </div> </body>');
IdHtml.Body.Add('</html>');
IdFoot := TIdText.Create(MessageParts);
IdFoot.ContentType := 'text/html';
//IdHtml.ContentTransfer := '7bit';
IdFoot.Body.Add('');
end;
TIdAttachmentFile.Create(MessageParts,FileName);
//TIdAttachment.Create(MessageParts,ExtractFilePath(Application.ExeName)+edit5.text+'.DS');
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
SMTP1.Send(IdMsg);
//MessageDlg('<27><><EFBFBD><EFBFBD>շ<EFBFBD><D5B7>ͳɹ<CDB3>',mtConfirmation,[mbOK],0)
finally
SMTP1.Disconnect;
deletefile(FileName);
end;
//showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
frm_op_seae.SendedEmail:=True;
close;
except
MessageDlg('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC>˻<EFBFBD><CBBB><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><E4B2BB><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><E7BBB0>ϵ:0532-83889257!',mtError,[mbOK],0);
frm_op_seae.SendedEmail:=False;
end;
end;
procedure Tfrm_SimplePrint.SendSIEmail(FileName: String);
var //<2F>ᵥȷ<E1B5A5><C8B7>
str:widestring;
str_file:widestring;
IdHtml,IdFoot: TIdText;
_i:integer;
begin
IdMsg.Clear;
try
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
SMTP1.username:='admin@dongshengsoft.com';
SMTP1.Password :='ds!@#)(*';
SMTP1.Host :='smtpcom.263xmail.com';
SMTP1.Port :=25;
try
SMTP1.Connect;
except
on e : Exception do
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+E.Message);
end;
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
try
with IdMsg do
begin
//body.Clear;
IdMsg.From.address :=one_table_4.DataSource.DataSet.fieldbyname('senderEmail').asstring;
// From.address :='crazymanqd@126.com';
Recipients.EMailAddresses :=Email;
//Subject:=MBLNO +'<27><>'+frm_Simpleprint.caption;
//body.Add(Subject);
Subject:='<27>ᵥȷ<E1B5A5><C8B7>:From'+one_table_4.DataSource.DataSet.fieldbyname('SenderCompany').asstring+'--'
+'--'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+'--'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
+'--'+one_table_1.DataSource.DataSet.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring
+'--'+one_table_1.DataSource.DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring;
IdHtml := TIdText.Create(MessageParts);
IdHtml.ContentType := 'text/html';
//IdHtml.ContentTransfer := '7bit';
IdHtml.Body.Add('<html>');
IdHtml.Body.Add(' <head>');
//IdHtml.Body.Add(' <title style="color:black; font-size:18pt;">' + Subject + '</title>');
IdHtml.Body.Add(' </head>');
IdHtml.Body.Add(' <Body>');
IdHtml.Body.Add(' <span style="color:black; font-size:10pt;font-family:''<27><><EFBFBD><EFBFBD>'';">' + Subject + '&nbsp;(ժҪ)</span>');
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;">');
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;font-family:''<27><><EFBFBD><EFBFBD>'';">');
IdHtml.Body.Add(' <br />TO<54><4F>'+one_table_4.DataSource.DataSet.fieldbyname('ReceiverCompany').asstring);
IdHtml.Body.Add(' <br />FROM<4F><4D>'+one_table_4.DataSource.DataSet.fieldbyname('sendercompany').asstring+'/'
+one_table_4.DataSource.DataSet.fieldbyname('senderName').asstring
+'&nbsp;&nbsp;<3B>绰'+one_table_4.DataSource.DataSet.fieldbyname('senderMobile').asstring
+'&nbsp;&nbsp;<3B><><EFBFBD><EFBFBD>'+one_table_4.DataSource.DataSet.fieldbyname('senderEmail').asstring
);
IdHtml.Body.Add(' </div>');
{ Body.Append("<br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" + Opseae.CNTR);
if (Opseae.ETD != "")
Body.Append("<br /><3E><><EFBFBD>ڣ<EFBFBD>" + Opseae.ETD);
if (Opseae.CNTR != "")
Body.Append("<br />Ŀ<>ĵأ<C4B5>" + Opseae.DESTINATION);
if (Opseae.BOOKINGDESCRIPTION != "")
Body.Append("<br /><3E><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>" + Opseae.BOOKINGDESCRIPTION);}
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;"><br />');
IdHtml.Body.Add(' <br />&nbsp;<3B><EFBFBD>ţ<EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br />&nbsp;Ŀ<>ĵأ<C4B5>'+one_table_1.DataSource.DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring);
// IdHtml.Body.Add(' <br /><3E><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>˵<EFBFBD><CBB5>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><br />ShippingBoxNO.<2E><>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring);
IdHtml.Body.Add('<br /><br /> **********<2A><><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><a href=http://www.shippingbox.cc style="color:blue;">ShippingBox<6F><78><EFBFBD><EFBFBD>ƽ̨</a><3E>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD> *************');
IdHtml.Body.Add('<br /><3E><><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><E1B9A9>ǰ<EFBFBD><C7B0><EFBFBD>ﲿ<EFBFBD><EFB2BF>ժҪ<D5AA><D2AA>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD><CBAB>Լ<EFBFBD><D4BC>Ϊ׼<CEAA><D7BC>');
IdHtml.Body.Add('<br /> <img src="http://123.57.17.72:8027/images/public/logo01.png" />');
IdHtml.Body.Add('<br /> <a href=http://www.shippingbox.cc style="color:blue;">www.shippingbox.cc</a>');
IdHtml.Body.Add(' </div> </body>');
IdHtml.Body.Add('</html>');
IdFoot := TIdText.Create(MessageParts);
IdFoot.ContentType := 'text/html';
//IdHtml.ContentTransfer := '7bit';
IdFoot.Body.Add('');
TIdAttachmentFile.Create(MessageParts,FileName);
//TIdAttachment.Create(MessageParts,ExtractFilePath(Application.ExeName)+edit5.text+'.DS');
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
SMTP1.Send(IdMsg);
//MessageDlg('<27><><EFBFBD><EFBFBD>շ<EFBFBD><D5B7>ͳɹ<CDB3>',mtConfirmation,[mbOK],0)
finally
SMTP1.Disconnect;
deletefile(FileName);
end;
//showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
frm_op_seae.SendedEmail:=True;
close;
except
MessageDlg('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC>˻<EFBFBD><CBBB><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><E4B2BB><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><E7BBB0>ϵ:0532-83889257!',mtError,[mbOK],0);
frm_op_seae.SendedEmail:=False;
end;
end;
procedure Tfrm_SimplePrint.SendSOEmail(FileName: String);
var
str:widestring;
str_file:widestring;
IdHtml,IdFoot: TIdText;
_i:integer;
begin
IdMsg.Clear;
try
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
SMTP1.username:='admin@dongshengsoft.com';
SMTP1.Password :='ds!@#)(*';
SMTP1.Host :='smtpcom.263xmail.com';
SMTP1.Port :=25;
try
SMTP1.Connect;
except
on e : Exception do
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+E.Message);
end;
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
try
with IdMsg do
begin
//body.Clear;
IdMsg.
From.address :=one_table_4.DataSource.DataSet.fieldbyname('senderEmail').asstring;
// From.address :='crazymanqd@126.com';
Recipients.EMailAddresses :=one_table_4.DataSource.DataSet.fieldbyname('Email').asstring;
//Subject:=MBLNO +'<27><>'+frm_Simpleprint.caption;
//body.Add(Subject);
Subject:='<27><><EFBFBD><EFBFBD>:From'+one_table_4.DataSource.DataSet.fieldbyname('senderCompany').asstring
+'--'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
+'--'+one_table_1.DataSource.DataSet.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring
+'--'+one_table_1.DataSource.DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring;
IdHtml := TIdText.Create(MessageParts);
IdHtml.ContentType := 'text/html';
//IdHtml.ContentTransfer := '7bit';
IdHtml.Body.Add('<html>');
IdHtml.Body.Add(' <head>');
//IdHtml.Body.Add(' <title style="color:black; font-size:18pt;">' + Subject + '</title>');
IdHtml.Body.Add(' </head>');
IdHtml.Body.Add(' <Body>');
IdHtml.Body.Add(' <span style="color:black; font-size:10pt;font-family:''<27><><EFBFBD><EFBFBD>'';">' + Subject + '&nbsp;(ժҪ)</span>');
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;">');
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;font-family:''<27><><EFBFBD><EFBFBD>'';">');
IdHtml.Body.Add(' <br />TO<54><4F>'+one_table_4.DataSource.DataSet.fieldbyname('ReceiverCompany').asstring);
IdHtml.Body.Add(' <br />FROM<4F><4D>'+one_table_4.DataSource.DataSet.fieldbyname('sendercompany').asstring+'/'
+one_table_4.DataSource.DataSet.fieldbyname('senderName').asstring
+'&nbsp;&nbsp;<3B>绰'+one_table_4.DataSource.DataSet.fieldbyname('senderMobile').asstring
+'&nbsp;&nbsp;<3B><><EFBFBD><EFBFBD>'+one_table_4.DataSource.DataSet.fieldbyname('senderEmail').asstring
);
IdHtml.Body.Add(' </div>');
//IdHtml.Body.Add(' <div style="color:black; font-size:9pt;"><3E><EFBFBD>ţ<EFBFBD>'+MBLNO);
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;">');
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD>˸ۣ<CBB8>'+one_table_1.DataSource.DataSet.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br />ж<><D0B6><EFBFBD>ۣ<EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br />Ŀ<>ĵأ<C4B5>'+one_table_1.DataSource.DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>˵<EFBFBD><CBB5>').asstring);
IdHtml.Body.Add(' <br />ShippingBoxNO.<2E><>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring);
IdHtml.Body.Add('<br /><br /> **********<2A><><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><a href=http://www.shippingbox.cc style="color:blue;">ShippingBox<6F><78><EFBFBD><EFBFBD>ƽ̨</a><3E>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD> *************');
IdHtml.Body.Add('<br /><3E><><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><E1B9A9>ǰ<EFBFBD><C7B0><EFBFBD>ﲿ<EFBFBD><EFB2BF>ժҪ<D5AA><D2AA>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD><CBAB>Լ<EFBFBD><D4BC>Ϊ׼<CEAA><D7BC>');
IdHtml.Body.Add('<br /> <img src="http://123.57.17.72:8027/images/public/logo01.png" />');
IdHtml.Body.Add('<br /> <a href=http://www.shippingbox.cc style="color:blue;">www.shippingbox.cc</a>');
IdHtml.Body.Add(' </div> </body>');
IdHtml.Body.Add('</html>');
IdFoot := TIdText.Create(MessageParts);
IdFoot.ContentType := 'text/html';
//IdHtml.ContentTransfer := '7bit';
IdFoot.Body.Add('');
TIdAttachmentFile.Create(MessageParts,FileName);
//TIdAttachment.Create(MessageParts,ExtractFilePath(Application.ExeName)+edit5.text+'.DS');
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
SMTP1.Send(IdMsg);
//MessageDlg('<27><><EFBFBD><EFBFBD>շ<EFBFBD><D5B7>ͳɹ<CDB3>',mtConfirmation,[mbOK],0)
finally
SMTP1.Disconnect;
deletefile(FileName);
end;
//showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
frm_op_seae.SendedEmail:=True;
close;
except
MessageDlg('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC>˻<EFBFBD><CBBB><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><E4B2BB><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><E7BBB0>ϵ:0532-83889257!',mtError,[mbOK],0);
frm_op_seae.SendedEmail:=False;
end;
end;
function Tfrm_SimplePrint.GetFileName(ExtName:string):string;
var
DT:Tdatetime;
h,m,s,ms:word;
begin
if MBLNO='' then begin
DT:= now;
DecodeTime(DT,h,m,s,ms);//<2F>ֽ<EFBFBD>Сʱ<D0A1><CAB1><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD><EBA3AC><EFBFBD>
result:=ExtractFilePath(Application.ExeName)+inttostr(h)+inttostr(m)+inttostr(s)+inttostr(ms)+ExtName;
end
else begin
result:=MBLNO+ExtName;
end;
end;
function Tfrm_SimplePrint.GetFileName(filename, ExtName: string): string;
begin
result:=filename+'_'+ExtName;
end;
procedure Tfrm_SimplePrint.MenuItem3Click(Sender: TObject);
var
template : TStream; //<2F><>ΪExcel<65><6C><EFBFBD><EFBFBD>
FileName:String;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
frxXLSExport2.FileName:=GetFileName('.xls');
frxReport1.Export(frxXLSExport2);
//SendEmail(frxXLSExport2.FileName);
except
showmessage('<27><>Ϊ<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
end;
procedure Tfrm_SimplePrint.MenuItem5Click(Sender: TObject);
var
template : TStream; //<2F><>ΪWord<72><64><EFBFBD><EFBFBD>
FileName:String;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
frxRTFExport2.FileName:=GetFileName('.doc');
frxReport1.Export(frxRTFExport2);
//SendEmail(frxRTFExport2.FileName);
except
showmessage('<27><>Ϊ<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
end;
procedure Tfrm_SimplePrint.MenuItem1Click(Sender: TObject);
var
template : TStream; //<2F><>ΪWord<72><64><EFBFBD><EFBFBD>
FileName:String;
begin
if t_sys_report.isempty then
exit;
t_sys_reportfile.Close;
t_sys_reportfile.SQL.Clear;
t_sys_reportfile.SQL.Add('select * from t_sys_report where CH_ID='+inttostr(t_sys_report['CH_ID']));
t_sys_reportfile.Open;
if t_sys_reportfile.isempty then
begin
showmessage('û<>д<EFBFBD>ӡ<EFBFBD><D3A1>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>Ϊ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>');
exit;
end;
try
try
template := t_sys_reportfile.CreateBlobStream(t_sys_reportfile.FieldByName('report'), bmRead);
template.Position := 0;
frxReport1.LoadFromStream(template);
finally
template.Free;
end;
frxReport1.PrepareReport;
frxJPEGExport2.FileName:=GetFileName('');
frxReport1.Export(frxJPEGExport2);
//SendEmail(frxJPEGExport2.FileName+'.1.jpg');
except
showmessage('<27><>Ϊ<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end;
end;
procedure Tfrm_SimplePrint.SendBLCRepeatEmail(FileName: String);
var
str:widestring;
str_file:widestring;
IdHtml,IdFoot: TIdText;
_i,p1,p2:integer;
newemail:string;
begin
IdMsg.Clear;
try
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
SMTP1.username:='admin@dongshengsoft.com';
SMTP1.Password :='ds!@#)(*';
SMTP1.Host :='smtpcom.263xmail.com';
SMTP1.Port :=25;
try
SMTP1.Connect;
except
on e : Exception do
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+E.Message);
end;
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
try
with IdMsg do
begin
//body.Clear;
IdMsg.
From.address :=one_table_4.DataSource.DataSet.fieldbyname('ReceiverEmail').asstring;
p1:=Pos('<',Edit2.Text);
p2:=Pos('>',Edit2.Text);
if p1>-1 then begin
newemail:=Copy(Edit2.Text,p1+1,p2-p1-1);
end else newemail:=Edit2.Text;
//Recipients.EMailAddresses :=Email;
Recipients.EMailAddresses :=newemail;
Subject:='<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>:'+one_table_4.DataSource.DataSet.fieldbyname('ReceiverCompany').asstring+'--'+MBLNO
+'--'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
+'--'+one_table_1.DataSource.DataSet.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring
+'--'+one_table_1.DataSource.DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring;
IdHtml := TIdText.Create(MessageParts);
IdHtml.ContentType := 'text/html';
//IdHtml.ContentTransfer := '7bit';
IdHtml.Body.Add('<html>');
IdHtml.Body.Add(' <head>');
//IdHtml.Body.Add(' <title style="color:black; font-size:18pt;">' + Subject + '</title>');
IdHtml.Body.Add(' </head>');
IdHtml.Body.Add(' <Body>');
IdHtml.Body.Add(' <span style="color:black; font-size:10pt;font-family:''<27><><EFBFBD><EFBFBD>'';">' + Subject + '&nbsp;(ժҪ)</span>');
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;">');
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;font-family:''<27><><EFBFBD><EFBFBD>'';">');
IdHtml.Body.Add(' <br />TO<54><4F>'+one_table_4.DataSource.DataSet.fieldbyname('sendercompany').asstring);
IdHtml.Body.Add(' <br />FROM<4F><4D>'+one_table_4.DataSource.DataSet.fieldbyname('ReceiverCompany').asstring+'/'
+one_table_4.DataSource.DataSet.fieldbyname('ReceiverName').asstring
+'&nbsp;&nbsp;<3B>绰'+one_table_4.DataSource.DataSet.fieldbyname('Mobile').asstring
+'&nbsp;&nbsp;<3B><><EFBFBD><EFBFBD>'+one_table_4.DataSource.DataSet.fieldbyname('ReceiverEmail').asstring
);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD><CBB6><EFBFBD><E1B5A5>Ϣ<EFBFBD><CFA2>');
IdHtml.Body.Add(' </div>');
//IdHtml.Body.Add(' <div style="color:black; font-size:9pt;"><3E><EFBFBD>ţ<EFBFBD>'+MBLNO);
IdHtml.Body.Add(' <div style="color:black; font-size:9pt;"><br /><br /><3E><><EFBFBD><EFBFBD>/<2F><><EFBFBD>Σ<EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><EFBFBD>ţ<EFBFBD>'+MBLNO);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD>˸ۣ<CBB8>'+one_table_1.DataSource.DataSet.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br />ж<><D0B6><EFBFBD>ۣ<EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br />Ŀ<>ĵأ<C4B5>'+one_table_1.DataSource.DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring);
IdHtml.Body.Add(' <br /><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'&nbsp;'+one_table_1.DataSource.DataSet.fieldbyname('<27><>װ').asstring+'&nbsp;&nbsp;&nbsp;&nbsp;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'&nbsp;KGS&nbsp;&nbsp;&nbsp;&nbsp;<3B><><EFBFBD>룺'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'&nbsp;CBM');
IdHtml.Body.Add(' <br /><3E>ظ<EFBFBD>ʱ<EFBFBD>䣺'+one_table_1.DataSource.DataSet.fieldbyname('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E>ص<EFBFBD>ʱ<EFBFBD>䣺'+one_table_1.DataSource.DataSet.fieldbyname('<27>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring);
IdHtml.Body.Add(' <br /><3E><>ע<EFBFBD><D7A2>'+mmo1.Lines.Text);
IdHtml.Body.Add(' <br />ShippingBoxNO.<2E><>'+one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring);
IdHtml.Body.Add('<br /><br /> **********<2A><><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><a href=http://www.shippingbox.cc style="color:blue;">ShippingBox<6F><78><EFBFBD><EFBFBD>ƽ̨</a><3E>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD> *************');
IdHtml.Body.Add('<br /><3E><><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><E1B9A9>ǰ<EFBFBD><C7B0><EFBFBD>ﲿ<EFBFBD><EFB2BF>ժҪ<D5AA><D2AA>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD><CBAB>Լ<EFBFBD><D4BC>Ϊ׼<CEAA><D7BC>');
IdHtml.Body.Add('<br /> <img src="http://123.57.17.72:8027/images/public/logo01.png" />');
IdHtml.Body.Add('<br /> <a href=http://www.shippingbox.cc style="color:blue;">www.shippingbox.cc</a>');
IdHtml.Body.Add(' </div> </body>');
IdHtml.Body.Add('</html>');
IdFoot := TIdText.Create(MessageParts);
IdFoot.ContentType := 'text/html';
//IdHtml.ContentTransfer := '7bit';
IdFoot.Body.Add('');
TIdAttachmentFile.Create(MessageParts,FileName);
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
SMTP1.Send(IdMsg);
//MessageDlg('<27><><EFBFBD><EFBFBD>շ<EFBFBD><D5B7>ͳɹ<CDB3>',mtConfirmation,[mbOK],0)
finally
SMTP1.Disconnect;
deletefile(FileName);
end;
//showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
frm_op_seae.SendedEmail:=True;
//<2F><><EFBFBD>ͳɹ<CDB3><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>Ϣ
SendMSG(Trim(mmo1.Lines.Text));
//<2F><>¼<EFBFBD><C2BC>־
Booking_add(frm_op_seae.t_op_seae, frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString
, sendername,print_head.DataSource.DataSet.fieldbyname('̨ͷ1').asstring
, one_table_1.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring
, '<27><><EFBFBD><EFBFBD> <20><EFBFBD><E1B5A5><EFBFBD><EFBFBD>');
close;
except
MessageDlg('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC>˻<EFBFBD><CBBB><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><E4B2BB><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><E7BBB0>ϵ:0532-83889257!',mtError,[mbOK],0);
frm_op_seae.SendedEmail:=False;
end;
end;
procedure Tfrm_SimplePrint.SendMSG(msg:String);
var _s,BSNO,XML:string;
begin
getwebservice_ds;
BSNO:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').AsString;
_s:='<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
_s:=_s+'<BookingMSG xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1">';
_s:=_s+'<MSGList> ';
_s:=_s+' <MSGInfo> ';
_s:=_s+' <SENDERID>'+frm_data_share.t_load_employee.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring+'</SENDERID> ';
_s:=_s+' <BSTYPE><3E><>ͨ<EFBFBD><CDA8>Ϣ</BSTYPE> ';
_s:=_s+' <BSNO>'+BSNO+'</BSNO> ';
_s:=_s+' <FieldName><3E><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD></FieldName> ';
_s:=_s+' <FieldValue>'+msg+'</FieldValue> ';
_s:=_s+' </MSGInfo> ';
_s:=_s+'</MSGList> ';
_s:=_s+'</BookingMSG> ';
if Length(msg)>0 then
XML:=mServiceSoap_Ds.SendMSG(_s);
if (pos('<USERNAME>',XML)>0) then begin
//<2F>˴<EFBFBD><CBB4><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><E1B5A5><EFBFBD><EFBFBD> <20><>־
end else begin
end;
end;
procedure Tfrm_SimplePrint.getwebservice_ds;
var URL:String;
begin
try
URL:=get_WebseviceURL;
mHttpRIO_ds:=THTTPRIO.Create(nil);
mHttpRIO_ds.WSDLLocation:=URL+'?WSDL';
mHttpRIO_ds.URL:=URL;
mHttpRIO_ds.Port:='DsWebServiceSoap';
mHttpRIO_ds.Service:='DsWebService';
mHttpRIO_ds.HTTPWebNode.UseUTF8InHeader:=true;
InvRegistry.RegisterInvokeOptions(TypeInfo(DsWebServiceSoap),ioDocument );//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
mServiceSoap_Ds:=mHttpRIO_ds as DsWebServiceSoap;
except
on E:Exception do
begin
ShowMessage(e.Message);
exit;
end;
end;
end;
end.