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.

1181 lines
38 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_data_share;
interface
uses
SysUtils, Classes, DB, ADODB, bsColorCtrls,Variants,Dialogs, kbmMemTable,
kbmMemCSVStreamFormat,DateUtils,Windows;
type
Tfrm_data_share = class(TDataModule)
t_sys_company: TADOQuery;
t_sys_company1: TDataSource;
t_sys_employee1: TDataSource;
t_sys_employee: TADOQuery;
t_sys_bank1: TDataSource;
t_sys_bank: TADOQuery;
t_code_currency1: TDataSource;
t_code_currency: TADOQuery;
p_id: TADOStoredProc;
t_code_fee1: TDataSource;
t_code_fee: TADOQuery;
t_code_goods1: TDataSource;
t_code_goods: TADOQuery;
t_code_items1: TDataSource;
t_code_items: TADOQuery;
t_code_ctn1: TDataSource;
t_code_ctn: TADOQuery;
t_code_country1: TDataSource;
t_code_country: TADOQuery;
t_code_disport1: TDataSource;
t_code_disport: TADOQuery;
t_code_trade1: TDataSource;
t_code_trade: TADOQuery;
t_code_vessel1: TDataSource;
t_code_vessel: TADOQuery;
t_code_package1: TDataSource;
t_code_package: TADOQuery;
t_sys_code_emp: TADOQuery;
t_sys_code_data: TADOQuery;
t_code_ctn_de: TADOQuery;
t_code_ctn_de1: TDataSource;
t_crm_client1: TDataSource;
t_crm_client: TADOQuery;
t_code_free1: TDataSource;
t_code_free: TADOQuery;
t_sys_department1: TDataSource;
t_sys_department: TADOQuery;
p_no_replace: TADOStoredProc;
p_no_get: TADOStoredProc;
t_code_code1: TDataSource;
t_code_code: TADOQuery;
t_code_ctn_kind1: TDataSource;
t_code_ctn_kind: TADOQuery;
t_code_loaport1: TDataSource;
t_code_loaport: TADOQuery;
t_sys_parameters_value: TADOQuery;
t_code_state: TADOQuery;
t_code_state1: TDataSource;
t_sys_report_head1: TDataSource;
t_sys_report_head: TADOQuery;
t_load_employee1: TDataSource;
t_load_employee: TADOQuery;
t_code_signbill1: TDataSource;
t_code_signbill: TADOQuery;
t_code_price1: TDataSource;
t_code_price: TADOQuery;
t_code_client_parameter1: TDataSource;
t_code_client_parameter: TADOQuery;
t_code_contract1: TDataSource;
t_code_contract: TADOQuery;
t_code_price_ctn1: TDataSource;
t_code_price_ctn: TADOQuery;
t_code_voyage1: TDataSource;
t_code_voyage: TADOQuery;
t_code_truck_client: TADOQuery;
t_code_truck_client1: TDataSource;
t_code_truck_changzhan: TADOQuery;
t_code_truck_changzhan1: TDataSource;
t_code_send_head: TADOQuery;
t_code_send_head1: TDataSource;
t_code_card1: TDataSource;
t_code_card: TADOQuery;
t_code_card_project1: TDataSource;
t_code_card_project: TADOQuery;
t_code_card_project_de1: TDataSource;
t_code_card_project_de: TADOQuery;
t_crm_client_all1: TDataSource;
t_crm_client_all: TADOQuery;
t_crm_client_ship1: TDataSource;
t_crm_client_ship: TADOQuery;
t_crm_client_changzhan1: TDataSource;
t_crm_client_changzhan: TADOQuery;
t_crm_client_truck1: TDataSource;
t_crm_client_truck: TADOQuery;
t_crm_client_baoguan1: TDataSource;
t_crm_client_baoguan: TADOQuery;
t_crm_client_weituo1: TDataSource;
t_crm_client_weituo: TADOQuery;
t_crm_client_daili1: TDataSource;
t_crm_client_daili: TADOQuery;
t_crm_client_huodai1: TDataSource;
t_crm_client_huodai: TADOQuery;
t_crm_client_shiper1: TDataSource;
t_crm_client_shiper: TADOQuery;
t_crm_client_shouhuo1: TDataSource;
t_crm_client_shouhuo: TADOQuery;
t_crm_client_tongzhi1: TDataSource;
t_crm_client_tongzhi: TADOQuery;
t_crm_client_hangkong1: TDataSource;
t_crm_client_hangkong: TADOQuery;
t_crm_client_other1: TDataSource;
t_crm_client_other: TADOQuery;
t_code_state_project1: TDataSource;
t_code_state_project: TADOQuery;
t_code_state_project_de1: TDataSource;
t_code_state_project_de: TADOQuery;
t_code_fee_color1: TDataSource;
t_code_fee_color: TADOQuery;
t_code_source1: TDataSource;
t_code_source: TADOQuery;
t_op_letter_free1: TDataSource;
t_op_letter_free: TADOQuery;
t_op_letter_free_detail1: TDataSource;
t_op_letter_free_detail: TADOQuery;
p_update: TADOStoredProc;
t_code_fee_type1: TDataSource;
t_code_fee_type: TADOQuery;
t_code_port_air1: TDataSource;
t_code_port_air: TADOQuery;
t_crm_client_kuaidi1: TDataSource;
t_crm_client_kuaidi: TADOQuery;
t_code_send_address1: TDataSource;
t_code_send_address: TADOQuery;
t_code_empty1: TDataSource;
t_code_empty: TADOQuery;
v_employee_shenhe: TADOQuery;
v_employee_other: TADOQuery;
t_code_edi_port: TADOQuery;
t_code_edi_port1: TDataSource;
t_code_tiaokuan1: TDataSource;
t_code_tiaokuan: TADOQuery;
t_code_shiyan1: TDataSource;
t_code_shiyan: TADOQuery;
t_code_package_edi: TADOQuery;
t_code_package_edi1: TDataSource;
t_code_shiper_edi: TADOQuery;
t_code_shiper_edi1: TDataSource;
t_code_subcomp: TADOQuery;
t_code_subcomp1: TDataSource;
t_code_source_dl: TADOQuery;
t_code_source_dl1: TDataSource;
t_sys_noset1: TDataSource;
t_sys_noset: TADOQuery;
p_wtno_get: TADOStoredProc;
p_wtno_del: TADOStoredProc;
P_GetMaxWTno: TADOStoredProc;
P_GetMaxDCno: TADOStoredProc;
p_getMaxHblno: TADOStoredProc;
t_crm_client_gndaili: TADOQuery;
t_crm_client_gndaili1: TDataSource;
memreg: TkbmMemTable;
memregfmoduleid: TIntegerField;
memregField: TStringField;
memregreg: TSmallintField;
kbmThreadDataSet1: TkbmThreadDataSet;
kbmCSVStreamFormat1: TkbmCSVStreamFormat;
memreg1: TDataSource;
memregQCode: TStringField;
t_code_railwayctnsource: TADOQuery;
t_code_railwayctnsource1: TDataSource;
t_code_railport: TADOQuery;
t_code_railport1: TDataSource;
t_code_railwaypath: TADOQuery;
t_code_railwaypath1: TDataSource;
t_AgentDc_no: TADOQuery;
t_code_stlmode1: TDataSource;
t_code_stlmode: TADOQuery;
t_code_fee_unit: TADOQuery;
t_code_fee_unit1: TDataSource;
t_crm_client_cangku1: TDataSource;
t_crm_client_cangku: TADOQuery;
t_code_tradetype: TADOQuery;
t_code_tradetype1: TDataSource;
p_Settlement: TADOStoredProc;
v_vessel_voyage: TADOQuery;
v_vessel_voyage1: TDataSource;
t_code_disport_all: TADOQuery;
t_sys_noset_hblno: TADOQuery;
t_sys_noset_hblno1: TDataSource;
t_crm_client_huodai_bi: TADOQuery;
t_crm_client_huodai_bi1: TDataSource;
t_crm_client_ship_bi: TADOQuery;
t_crm_client_ship_bi1: TDataSource;
v_code_port: TADOQuery;
v_code_port1: TDataSource;
t_code_city: TADOQuery;
t_code_city1: TDataSource;
WebServiceURLQry: TADOQuery;
t_crm_client_cd: TADOQuery;
t_crm_client_cd1: TDataSource;
p_edi_id: TADOStoredProc;
procedure t_sys_bankBeforePost(DataSet: TDataSet);
procedure t_code_currencyBeforePost(DataSet: TDataSet);
procedure t_code_feeBeforePost(DataSet: TDataSet);
procedure t_code_goodsBeforePost(DataSet: TDataSet);
procedure t_code_itemsBeforePost(DataSet: TDataSet);
procedure t_code_ctnBeforePost(DataSet: TDataSet);
procedure t_code_countryBeforePost(DataSet: TDataSet);
procedure t_code_tradeBeforePost(DataSet: TDataSet);
procedure t_code_vesselBeforePost(DataSet: TDataSet);
procedure t_code_packageBeforePost(DataSet: TDataSet);
procedure t_code_freeBeforePost(DataSet: TDataSet);
procedure t_code_codeBeforePost(DataSet: TDataSet);
procedure t_code_codeAfterInsert(DataSet: TDataSet);
procedure t_code_ctn_deBeforeInsert(DataSet: TDataSet);
procedure t_code_ctn_dePostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
procedure t_code_ctnPostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
procedure t_code_ctn_kindBeforePost(DataSet: TDataSet);
procedure t_code_ctn_kindPostError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
procedure t_code_disportPostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
procedure t_code_loaportBeforePost(DataSet: TDataSet);
procedure t_code_loaportPostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
procedure t_code_stateBeforePost(DataSet: TDataSet);
procedure t_code_signbillBeforePost(DataSet: TDataSet);
procedure t_code_stateAfterInsert(DataSet: TDataSet);
procedure t_code_priceBeforePost(DataSet: TDataSet);
procedure t_code_priceAfterInsert(DataSet: TDataSet);
procedure t_code_client_parameterBeforePost(DataSet: TDataSet);
procedure t_code_contractBeforePost(DataSet: TDataSet);
procedure t_code_voyageAfterInsert(DataSet: TDataSet);
procedure t_code_voyageBeforePost(DataSet: TDataSet);
procedure t_code_voyageBeforeInsert(DataSet: TDataSet);
procedure t_code_truck_clientBeforePost(DataSet: TDataSet);
procedure t_code_truck_changzhanBeforePost(DataSet: TDataSet);
procedure t_code_send_headBeforePost(DataSet: TDataSet);
procedure t_code_cardBeforePost(DataSet: TDataSet);
procedure t_code_card_projectBeforePost(DataSet: TDataSet);
procedure t_code_card_projectAfterInsert(DataSet: TDataSet);
procedure t_code_card_project_deBeforePost(DataSet: TDataSet);
procedure t_code_card_project_deBeforeDelete(DataSet: TDataSet);
procedure t_code_state_projectAfterInsert(DataSet: TDataSet);
procedure t_code_state_projectBeforeDelete(DataSet: TDataSet);
procedure t_code_state_projectBeforePost(DataSet: TDataSet);
procedure t_code_state_project_deBeforePost(DataSet: TDataSet);
procedure t_code_sourceBeforePost(DataSet: TDataSet);
procedure t_op_letter_freeBeforePost(DataSet: TDataSet);
procedure t_op_letter_free_detailBeforePost(DataSet: TDataSet);
procedure t_op_letter_freeAfterInsert(DataSet: TDataSet);
procedure t_op_letter_freeAfterPost(DataSet: TDataSet);
procedure t_op_letter_freeAfterCancel(DataSet: TDataSet);
procedure t_op_letter_freeAfterDelete(DataSet: TDataSet);
procedure t_op_letter_free_detailBeforeInsert(DataSet: TDataSet);
procedure t_op_letter_free_detailBeforeDelete(DataSet: TDataSet);
procedure t_op_letter_freeBeforeDelete(DataSet: TDataSet);
procedure t_code_fee_typeBeforePost(DataSet: TDataSet);
procedure t_code_port_airBeforePost(DataSet: TDataSet);
procedure t_op_letter_free_detailAfterInsert(DataSet: TDataSet);
procedure t_code_send_addressBeforePost(DataSet: TDataSet);
procedure t_code_send_addressBeforeInsert(DataSet: TDataSet);
procedure t_code_truck_changzhanBeforeInsert(DataSet: TDataSet);
procedure t_code_truck_clientBeforeInsert(DataSet: TDataSet);
procedure t_code_stateBeforeInsert(DataSet: TDataSet);
procedure t_code_send_headBeforeEdit(DataSet: TDataSet);
procedure t_code_countryBeforeEdit(DataSet: TDataSet);
procedure t_code_tradeBeforeEdit(DataSet: TDataSet);
procedure t_code_edi_portBeforePost(DataSet: TDataSet);
procedure t_code_tiaokuanBeforePost(DataSet: TDataSet);
procedure t_code_shiyanBeforePost(DataSet: TDataSet);
procedure t_code_card_project_deNewRecord(DataSet: TDataSet);
procedure t_code_card_project_deBeforeInsert(DataSet: TDataSet);
procedure t_code_source_dlBeforeInsert(DataSet: TDataSet);
procedure t_code_source_dlAfterInsert(DataSet: TDataSet);
procedure t_code_subcompBeforePost(DataSet: TDataSet);
procedure t_code_subcompBeforeDelete(DataSet: TDataSet);
procedure t_code_state_project_deBeforeInsert(DataSet: TDataSet);
procedure t_code_railwayctnsourceBeforePost(DataSet: TDataSet);
procedure t_code_railwaypathBeforePost(DataSet: TDataSet);
procedure t_code_stlmodeBeforePost(DataSet: TDataSet);
procedure t_code_fee_unitBeforePost(DataSet: TDataSet);
procedure t_code_voyageBeforeScroll(DataSet: TDataSet);
procedure t_code_vesselBeforeScroll(DataSet: TDataSet);
procedure t_code_vesselAfterScroll(DataSet: TDataSet);
procedure t_code_voyageAfterPost(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
LoadPort,UnLoadPort,Voy :string;
ETD,ETA,PortDate,BlDate:TDateTime;
function countString(_s1,s2:string):integer;
function countTrimString(_s1,s2:string):integer;
function GettimePotion(n:integer;c:string;s:string):integer;
function GetXMLValue(c:string;s:string):string;
function REHH(str: string): string;
function AnsiStringToWideString(const strAnsi: AnsiString;codepage: Word): WideString;
procedure WriteLog(AValue: string; const AFlag: boolean = false; const YCCNO: integer = 0; const DLFlag: boolean = false);
end;
var
frm_data_share: Tfrm_data_share;
if_all_letter:boolean;
implementation
uses u_main, my_sys_function;
{$R *.dfm}
procedure Tfrm_data_share.t_sys_bankBeforePost(DataSet: TDataSet);
begin
table_before_post(t_sys_bank,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_sys_bank,'<27>ұ<EFBFBD>');
table_before_post(t_sys_bank,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_sys_bank,'<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>');
end;
procedure Tfrm_data_share.t_code_currencyBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_currency,'<27>ұ<EFBFBD>');
table_before_post(t_code_currency,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_code_currency,'<27><><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_feeBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_fee,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_fee,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_code_fee,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_goodsBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_goods,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_goods,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_itemsBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_items,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_items,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_ctnBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_ctn,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_ctn,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_ctn,'<27>ߴ<EFBFBD>');
table_before_post(t_code_ctn,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ');
{
if (t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring<>'20')and
(t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring<>'40')and
(t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring<>'45') and
(t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring<>'10')
then
begin
showmessage('<27><><EFBFBD>ߴ<EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>10<31><30>20<32><30>40<34><30>45<34><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA3A1>');
abort;
end;
}
end;
procedure Tfrm_data_share.t_code_countryBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_country,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_country,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_code_country,'<27><>');
end;
procedure Tfrm_data_share.t_code_tradeBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_trade,'<27><><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD>');
table_before_post(t_code_trade,'<27><><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_vesselBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_vessel,'Ӣ<>Ĵ<EFBFBD><C4B4><EFBFBD>');
table_before_post(t_code_vessel,'<27><><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_packageBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_package,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_package,'<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_freeBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_free,'<27><><EFBFBD>ѷ<EFBFBD>ʽ');
end;
procedure Tfrm_data_share.t_code_codeBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_code,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_code,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_code,'<27><><EFBFBD><EFBFBD>');
if (t_code_code.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean=false)and
(t_code_code.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD>').asboolean=false)and
(t_code_code.fieldbyname('֪ͨ<CDA8><D6AA>').asboolean=false)and
(t_code_code.fieldbyname('<27><><EFBFBD><EFBFBD>').asboolean=false)then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD><CBA1>ջ<EFBFBD><D5BB>ˡ<EFBFBD>֪ͨ<CDA8>˱<EFBFBD><CBB1><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>');
abort;
end;
end;
procedure Tfrm_data_share.t_code_codeAfterInsert(DataSet: TDataSet);
begin
if t_code_code.Filtered=true then
begin
if copy(t_code_code.Filter,1,2)='<27><>'then
t_code_code['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=1;
if copy(t_code_code.Filter,1,2)='<27><>'then
t_code_code['<27>ջ<EFBFBD><D5BB><EFBFBD>']:=1;
if copy(t_code_code.Filter,1,2)='ͨ'then
t_code_code['֪ͨ<CDA8><D6AA>']:=1;
end;
end;
procedure Tfrm_data_share.t_code_ctn_deBeforeInsert(DataSet: TDataSet);
begin
abort;
end;
procedure Tfrm_data_share.t_code_ctn_dePostError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
table_post_error_primary('<27><><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>',E);
end;
procedure Tfrm_data_share.t_code_ctnPostError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
table_post_error_primary('<27><><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>',E);
table_post_error_index('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ',E);
end;
procedure Tfrm_data_share.t_code_ctn_kindBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_ctn_kind,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_ctn_kind,'<27><><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_ctn_kindPostError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
table_post_error_primary('<27><><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>',E);
end;
procedure Tfrm_data_share.t_code_disportPostError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
table_post_error_primary('<27>ۿڴ<DBBF><DAB4><EFBFBD>',E);
table_post_error_index('<27>ۿ<EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD>',E);
end;
procedure Tfrm_data_share.t_code_loaportBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_loaport,'<27>ۿڴ<DBBF><DAB4><EFBFBD>');
table_before_post(t_code_loaport,'Ӣ<><D3A2><EFBFBD><EFBFBD>');
table_before_post(t_code_loaport,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_loaportPostError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
table_post_error_primary('<27>ۿڴ<DBBF><DAB4><EFBFBD>',E);
table_post_error_index('<27>ۿ<EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD>',E);
end;
procedure Tfrm_data_share.t_code_stateBeforePost(DataSet: TDataSet);
begin
if t_code_state.fieldbyname('ҵ<><D2B5>״̬').AsString='ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
begin
showmessage('<27><>ǰҵ<C7B0><D2B5>״̬Ϊϵͳʹ<CDB3><CAB9>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD>');
abort;
end;
table_before_post(t_code_state,'ҵ<><D2B5>״̬');
table_before_post(t_code_state,'<27><>ɫ');
table_before_post(t_code_state,'ҵ<><D2B5>״̬');
table_before_post(t_code_state,'ҵ<><D2B5>״̬');
table_before_post(t_code_state,'ҵ<><D2B5>״̬');
end;
procedure Tfrm_data_share.t_code_signbillBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_signbill,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_signbill,'ǩ<><C7A9><EFBFBD><EFBFBD>ʽ');
end;
procedure Tfrm_data_share.t_code_stateAfterInsert(DataSet: TDataSet);
begin
if Pos('<27><><EFBFBD>ܳ<EFBFBD>',copy(t_code_state.Filter,11,8))>0 then
t_code_state['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ܳ<EFBFBD>'
else t_code_state['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=copy(t_code_state.Filter,11,8);
t_code_state['ҵ<><D2B5><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>']:=1;
end;
procedure Tfrm_data_share.t_code_priceBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_price,'<27>ͻ<EFBFBD><CDBB><EFBFBD>ֵ');
table_before_post(t_code_price,'<27><>ɫ');
table_before_post(t_code_price,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_code_price,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_priceAfterInsert(DataSet: TDataSet);
begin
t_code_price['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_code_price['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
end;
procedure Tfrm_data_share.t_code_client_parameterBeforePost(
DataSet: TDataSet);
begin
if t_code_client_parameter.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asfloat<=0 then
begin
showmessage('<27><><EFBFBD><EFBFBD>С<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><E3A3A1>');
abort;
end;
if t_code_client_parameter.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asfloat<=0 then
begin
showmessage('<27><><EFBFBD><EFBFBD>С<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><E3A3A1>');
abort;
end;
if t_code_client_parameter.fieldbyname('<27><>׼<EFBFBD><D7BC><EFBFBD><EFBFBD>').asfloat<=0 then
begin
showmessage('<27><><EFBFBD><EFBFBD>С<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><E3A3A1>');
abort;
end;
if t_code_client_parameter.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asfloat<=0 then
begin
showmessage('<27><><EFBFBD><EFBFBD>С<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><E3A3A1>');
abort;
end;
t_code_client_parameter['<27><>׼<EFBFBD><D7BC><EFBFBD><EFBFBD>']:=t_code_client_parameter['<27><><EFBFBD><EFBFBD>ֵ']/t_code_client_parameter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
end;
procedure Tfrm_data_share.t_code_contractBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_contract,'<27><>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_voyageAfterInsert(DataSet: TDataSet);
begin
t_code_voyage['VS_ID']:=t_code_vessel['VS_ID'];
t_code_voyage.FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').AsString:=LoadPort;
t_code_voyage.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').AsString:=UNLoadPort;
t_code_voyage.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=Voy;
if yearof(ETD)<>1899 then t_code_voyage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=ETD;
if yearof(ETA)<>1899 then t_code_voyage.FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=ETA;
if yearof(PortDate)<>1899 then t_code_voyage.FieldByName('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>').Value:=PortDate;
if yearof(BlDate)<>1899 then t_code_voyage.FieldByName('<27>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').Value:=BlDate;
end;
procedure Tfrm_data_share.t_code_voyageBeforePost(DataSet: TDataSet);
begin
//table_before_post(t_code_voyage,'<27><><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_voyageBeforeInsert(DataSet: TDataSet);
begin
if t_code_vessel.state=dsinsert then
t_code_vessel.Post;
end;
procedure Tfrm_data_share.t_code_truck_clientBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_truck_client,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_truck_changzhanBeforePost(
DataSet: TDataSet);
begin
table_before_post(t_code_truck_changzhan,'<27><>վ<EFBFBD><D5BE><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_send_headBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_send_head,'HEAD_TO');
end;
procedure Tfrm_data_share.t_code_cardBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_card,'<27><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_card_projectBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_card_project,'<27><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_card_projectAfterInsert(
DataSet: TDataSet);
begin
t_code_card_project['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_code_card_project['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=now;
end;
procedure Tfrm_data_share.t_code_card_project_deBeforePost(
DataSet: TDataSet);
begin
table_before_post(t_code_card_project_de,'<27><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_card_project_deBeforeDelete(
DataSet: TDataSet);
begin
if t_code_card_project.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring<>employee then
begin
showmessage('<27><>ǰ<EFBFBD><C7B0>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+employee+'<27><><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
end;
procedure Tfrm_data_share.t_code_state_projectAfterInsert(
DataSet: TDataSet);
begin
t_code_state_project['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_code_state_project['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=now;
if Pos('<27><><EFBFBD>ܳ<EFBFBD>',copy(t_code_state_project.Filter,11,8))>0 then
t_code_state_project['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ܳ<EFBFBD>'
else t_code_state_project['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=copy(t_code_state_project.Filter,11,8)
end;
procedure Tfrm_data_share.t_code_state_projectBeforeDelete(
DataSet: TDataSet);
begin
if t_code_state_project.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring<>employee then
begin
showmessage('<27><>ǰ״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+t_code_state_project.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring+'<27><><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
end;
procedure Tfrm_data_share.t_code_state_projectBeforePost(
DataSet: TDataSet);
begin
table_before_post(t_code_state_project,'״̬<D7B4><CCAC><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_state_project_deBeforePost(
DataSet: TDataSet);
begin
table_before_post(t_code_state_project_de,'״̬<D7B4><CCAC><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_sourceBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_source,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_source,'ҵ<><D2B5><EFBFBD><EFBFBD>Դ');
end;
procedure Tfrm_data_share.t_op_letter_freeBeforePost(DataSet: TDataSet);
begin
if t_op_letter_free.State=dsinsert then
begin
t_op_letter_free['LF']:=trim(get_id);
end;
table_before_post(t_op_letter_free,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_op_letter_free,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_op_letter_free_detailBeforePost(
DataSet: TDataSet);
var
str:widestring;
begin
table_before_post(t_op_letter_free_detail,'<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_op_letter_free_detail,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
IF t_op_letter_free_detail.State=dsinsert then
begin
str:='alter TABLE t_op_letter_free'+t_op_letter_free.fieldbyname('LF').asstring
+' add '+t_op_letter_free_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring
+' varchar(400) null';
p_update.Parameters.ParamByName('SQLStr').VALUE:=STR;
p_update.ExecProc;
end
else
begin
if t_op_letter_free_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').OldValue<>t_op_letter_free_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring then
begin
str:='alter TABLE t_op_letter_free'+t_op_letter_free.fieldbyname('LF').asstring
+' drop column '+t_op_letter_free_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').OldValue;
p_update.Parameters.ParamByName('SQLStr').VALUE:=STR;
p_update.ExecProc;
str:='alter TABLE t_op_letter_free'+t_op_letter_free.fieldbyname('LF').asstring
+' add '+t_op_letter_free_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring
+' varchar(400) null';
p_update.Parameters.ParamByName('SQLStr').VALUE:=STR;
p_update.ExecProc;
end;
end;
end;
procedure Tfrm_data_share.t_op_letter_freeAfterInsert(DataSet: TDataSet);
begin
t_op_letter_free['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=copy(t_op_letter_free.Filter,11,8);
if_all_letter:=true;
end;
procedure Tfrm_data_share.t_op_letter_freeAfterPost(DataSet: TDataSet);
var
str:widestring;
begin
if if_all_letter then
begin
str:='CREATE TABLE [t_op_letter_free'+t_op_letter_free.fieldbyname('LF').asstring
+'] ( [ID] [int] IDENTITY (1, 1) NOT NULL ,'
+'[LE_ID] INT NULL '
+'CONSTRAINT [PK_t_op_letter_free'+t_op_letter_free.fieldbyname('LF').asstring
+'] PRIMARY KEY CLUSTERED ([ID]) ON [PRIMARY]'
+' ) ON [PRIMARY] ';
p_update.Parameters.ParamByName('SQLStr').VALUE:=STR;
p_update.ExecProc;
end;
if_all_letter:=false;
end;
procedure Tfrm_data_share.t_op_letter_freeAfterCancel(DataSet: TDataSet);
begin
if_all_letter:=false;
end;
procedure Tfrm_data_share.t_op_letter_freeAfterDelete(DataSet: TDataSet);
begin
if_all_letter:=false;
end;
procedure Tfrm_data_share.t_op_letter_free_detailBeforeInsert(
DataSet: TDataSet);
begin
table_post(t_op_letter_free);
end;
procedure Tfrm_data_share.t_op_letter_free_detailBeforeDelete(
DataSet: TDataSet);
var
str:widestring;
begin
str:='alter TABLE t_op_letter_free'+t_op_letter_free.fieldbyname('LF').asstring
+' drop column '+t_op_letter_free_detail.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring;
p_update.Parameters.ParamByName('SQLStr').VALUE:=STR;
p_update.ExecProc;
end;
procedure Tfrm_data_share.t_op_letter_freeBeforeDelete(DataSet: TDataSet);
var
str:widestring;
begin
if not if_all_letter then
begin
p_update.CLOSE;
str:='select * from t_op_letter where LF='+''''+t_op_letter_free.fieldbyname('LF').asstring+'''';
p_update.Parameters.ParamByName('SQLStr').VALUE:=STR;
p_update.OPEN;
IF NOT p_update.IsEmpty THEN
BEGIN
SHOWMESSAGE('<27><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD>Ѿ<EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
ABORT;
END;
str:='drop TABLE t_op_letter_free'+t_op_letter_free.fieldbyname('LF').asstring;
p_update.Parameters.ParamByName('SQLStr').VALUE:=STR;
p_update.ExecProc;
end;
end;
procedure Tfrm_data_share.t_code_fee_typeBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_fee_type,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_fee_type,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_port_airBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_port_air,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_port_air,'Ӣ<><D3A2><EFBFBD><EFBFBD>');
table_before_post(t_code_port_air,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_op_letter_free_detailAfterInsert(
DataSet: TDataSet);
begin
t_op_letter_free_detail['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><>';
end;
procedure Tfrm_data_share.t_code_send_addressBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_send_address,'<27>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_code_send_address,'<27>ռ<EFBFBD><D5BC>˹<EFBFBD>˾');
table_before_post(t_code_send_address,'<27>ռ<EFBFBD><D5BC>˵<EFBFBD>ַ');
table_before_post(t_code_send_address,'Ŀ<>ĵ<EFBFBD>');
table_before_post(t_code_send_address,'<27>ռ<EFBFBD><D5BC>˵绰');
table_before_post(t_code_send_address,'<27>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD>ʱ<EFBFBD>');
end;
procedure Tfrm_data_share.t_code_send_addressBeforeInsert(
DataSet: TDataSet);
begin
if not if_open('164') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
abort;
end;
end;
procedure Tfrm_data_share.t_code_truck_changzhanBeforeInsert(
DataSet: TDataSet);
begin
if not if_open('143') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
abort;
end;
end;
procedure Tfrm_data_share.t_code_truck_clientBeforeInsert(
DataSet: TDataSet);
begin
if not if_open('142') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
abort;
end;
end;
procedure Tfrm_data_share.t_code_stateBeforeInsert(DataSet: TDataSet);
begin
if not if_open('052') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
abort;
end;
end;
procedure Tfrm_data_share.t_code_send_headBeforeEdit(DataSet: TDataSet);
begin
if not if_open('144') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
abort;
end;
end;
procedure Tfrm_data_share.t_code_countryBeforeEdit(DataSet: TDataSet);
begin
if not if_open('010') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
abort;
end;
end;
procedure Tfrm_data_share.t_code_tradeBeforeEdit(DataSet: TDataSet);
begin
if not if_open('012') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
abort;
end;
end;
procedure Tfrm_data_share.t_code_edi_portBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_edi_port,'EDI<44><49><EFBFBD><EFBFBD>');
table_before_post(t_code_edi_port,'<27>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_tiaokuanBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_tiaokuan,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_tiaokuan,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_tiaokuan,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_shiyanBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_shiyan,'ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_card_project_deNewRecord(
DataSet: TDataSet);
begin
DataSet.FieldByName('CP_ID').AsInteger:=t_code_card_project.fieldbyName('CP_ID').AsInteger;
end;
procedure Tfrm_data_share.t_code_card_project_deBeforeInsert(
DataSet: TDataSet);
begin
if t_code_card_project.state in [dsedit,dsinsert] then t_code_card_project.Post;
end;
procedure Tfrm_data_share.t_code_source_dlBeforeInsert(DataSet: TDataSet);
begin
table_before_insert(t_code_source);
end;
procedure Tfrm_data_share.t_code_source_dlAfterInsert(DataSet: TDataSet);
begin
t_code_source_dl.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString:=t_code_source.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString;
end;
procedure Tfrm_data_share.t_code_subcompBeforePost(DataSet: TDataSet);
var
aQuery:TAdoQuery;
begin
if t_code_subcomp.FieldByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').OldValue=null then exit;
if t_code_subcomp.FieldByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').OldValue<>t_code_subcomp.FieldByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').AsString then begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('select count(*) as subcount from t_sys_department where <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+t_code_subcomp.FieldByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').OldValue+'''');
Open;
if fieldbyname('subcount').AsInteger<>0 then begin
MessageDlg('<27>˷ֲ<CBB7><D6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3>޷<EFBFBD><DEB7>޸ģ<DEB8>',mtWarning,[mbOk],0);
abort;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
if t_code_subcomp.FieldByName('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>').AsString='' then begin
MessageDlg('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
abort;
end;
if t_code_subcomp.FieldByName('<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>').AsString='' then begin
MessageDlg('<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
abort;
end;
if t_code_subcomp.FieldByName('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>').AsString='' then begin
MessageDlg('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
abort;
end;
if t_code_subcomp.FieldByName('<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>').AsString='' then begin
MessageDlg('<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
abort;
end;
if t_code_subcomp.FieldByName('<27><><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD>').AsString='' then begin
MessageDlg('<27><><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
abort;
end;
if t_code_subcomp.FieldByName('<27><><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD>').AsString='' then begin
MessageDlg('<27><><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
abort;
end;
if t_code_subcomp.FieldByName('<27><><EFBFBD>ܳ<EFBFBD>').AsString='' then begin
MessageDlg('<27><><EFBFBD>ܳ<EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
abort;
end;
if t_code_subcomp.FieldByName('<27><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>').AsString='' then begin
MessageDlg('<27><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
abort;
end;
end;
procedure Tfrm_data_share.t_code_subcompBeforeDelete(DataSet: TDataSet);
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('select count(*) as subcount from t_sys_department where <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+t_code_subcomp.FieldByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
Open;
if fieldbyname('subcount').AsInteger<>0 then begin
MessageDlg('<27>˷ֲ<CBB7><D6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3>޷<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
abort;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_data_share.t_code_state_project_deBeforeInsert(
DataSet: TDataSet);
begin
if t_code_state_project.State in [dsedit,dsinsert] then t_code_state_project.post;
end;
procedure Tfrm_data_share.t_code_railwayctnsourceBeforePost(
DataSet: TDataSet);
begin
table_before_post(t_code_railwayctnsource,'<27><>Դ');
end;
procedure Tfrm_data_share.t_code_railwaypathBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_railwaypath,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_stlmodeBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_stlmode,'<27><><EFBFBD>ʽ');
end;
procedure Tfrm_data_share.t_code_fee_unitBeforePost(DataSet: TDataSet);
begin
table_before_post(t_code_fee_unit,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_code_fee_unit,'<27><>׼<EFBFBD><D7BC><EFBFBD><EFBFBD>');
end;
procedure Tfrm_data_share.t_code_voyageBeforeScroll(DataSet: TDataSet);
begin
if t_code_vessel.FieldByName('VS_ID').Asinteger>0 then begin
LoadPort:=t_code_voyage.FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').AsString;
UnLoadPort:=t_code_voyage.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').AsString;
Voy:=t_code_voyage.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
ETD:=t_code_voyage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime;
ETA:=t_code_voyage.FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime;
PortDate:=t_code_voyage.FieldByName('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>').AsDateTime;
BlDate:=t_code_voyage.FieldByName('<27>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').AsDateTime;
end;
end;
procedure Tfrm_data_share.t_code_vesselBeforeScroll(DataSet: TDataSet);
begin
frm_data_share.t_code_voyage.BeforeScroll:=nil;
end;
procedure Tfrm_data_share.t_code_vesselAfterScroll(DataSet: TDataSet);
begin
t_code_voyage.BeforeScroll:=t_code_voyageBeforeScroll;
end;
procedure Tfrm_data_share.t_code_voyageAfterPost(DataSet: TDataSet);
var aAdoQuery:TAdoQuery;
begin
{
if Trim(t_code_voyage.FieldByName('<27><><EFBFBD><EFBFBD>').AsString)<>'' then
begin
aAdoQuery:=CreateAdoQuery;
with aAdoQuery do
try
Close;sql.Clear;
sql.Add('Update t_op_seae set <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('where <20><><EFBFBD><EFBFBD>=:vsl and <20><><EFBFBD><EFBFBD>=:voy');
Parameters.ParamByName('vsl').Value:=t_code_voyage.DataSource.DataSet.FieldByName('Ӣ<>Ĵ<EFBFBD><C4B4><EFBFBD>').AsString;
Parameters.ParamByName('voy').Value:=t_code_voyage.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FormatDateTime('YYYY-MM-DD',t_code_voyage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
ExecSQL;
finally
Free;
end;
end;
}
end;
//20150517 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>c<EFBFBD><63>S<EFBFBD><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>n<EFBFBD>γ<EFBFBD><CEB3>ֵ<EFBFBD>λ<EFBFBD><CEBB>
function Tfrm_data_share.GettimePotion(n:integer;c:string;s:string):integer;
var
p,i:integer;
begin
result:=0;
p:=0;
for i:=1 to length(s) do
begin
if copy(s,i,length(c))=c then
p:=p+1;
if p=n then
begin
result:=i;
break;
end;
end;
end;
//20150517 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>S<EFBFBD>ڵ<EFBFBD>XML<4D>ڵ<EFBFBD>ֵ <20><><EFBFBD>޷<EFBFBD><DEB7>ؿ<EFBFBD>
function Tfrm_data_share.GetXMLValue(c:string;s:string):string;
var
p1,p2:integer;
_c1,_c2,_c3,_r:string;
begin
_c1:='<'+c+ ' />';
_c2:='<'+c+ '>';
_c3:='</'+c+ '>';
if (Pos(_c1,s)>0) then begin
result:=''; //ֵΪ<D6B5><CEAA>
end else if (Pos(_c2,s)>0) then
begin
p1:=pos(_c2,s)+length(_c2);
p2:=pos(_c3,s)-p1;
result:=copy(s,p1,p2);
//WriteLog(inttostr(P1)+'_'+inttostr(P2)+'__'+s);
end else result:='';
end;
function Tfrm_data_share.AnsiStringToWideString(const strAnsi: AnsiString;codepage:word): WideString;
var
Len: integer;
begin
Result := '';
if strAnsi = '' then Exit;
Len := MultiByteToWideChar(CodePage, MB_PRECOMPOSED, PChar(@strAnsi[1]), -1, nil, 0);
SetLength(Result, Len - 1);
if Len > 1 then
MultiByteToWideChar(CodePage, MB_PRECOMPOSED, PChar(@strAnsi[1]), -1, PWideChar(@Result[1]), Len - 1);
end;
procedure Tfrm_data_share.WriteLog(AValue: string; const AFlag: boolean = false; const YCCNO: integer = 0; const DLFlag: boolean = false);
var
FLog: TextFile;
LogFlag: boolean;
begin
//<2F><><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><C3B4>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>
try
if not DirectoryExists(ExtractFilePath(ParamStr(0)) + 'LOG\') then
if not ForceDirectories(ExtractFilePath(ParamStr(0)) + 'LOG\') then CreateDir(ExtractFilePath(ParamStr(0)) + 'LOG\');
AssignFile(FLog, ExtractFilePath(ParamStr(0)) + 'LOG\' + formatdatetime('yymmddhh', now()) + '.ini');
if not FileExists(ExtractFilePath(ParamStr(0)) + 'LOG\' + formatdatetime('yymmddhh', now()) + '.ini') then begin
rewrite(Flog);
end else Append(Flog);
if AFlag then WriteLn(Flog, formatdatetime('hh:nn:ss', now()) + ': (YCCNO=' + inttostr(YCCNO) + ')(AFlag=1) ' + AValue)
else WriteLn(Flog, formatdatetime('hh:nn:ss', now()) + ': (YCCNO=' + inttostr(YCCNO) + ')(AFlag=0) ' + AValue);
finally
CloseFile(Flog);
end;
end;
//20150517 <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ؽڵ<D8BD>_s1<73><31>XML<4D>ַ<EFBFBD><D6B7><EFBFBD>s2<73><32><EFBFBD><EFBFBD><EFBFBD>ֵĴ<D6B5><C4B4><EFBFBD>
function Tfrm_data_share.countString(_s1,s2:string):integer;
var s1:string;
begin
result:=0;
s1:='<'+_s1+'>';
while pos(s1,s2)>0 do
begin
s2:=copy(s2,pos(s1,s2)+1,length(s2)); //<2F><><EFBFBD><EFBFBD>s2<73><32><EFBFBD>󳤶<EFBFBD>Ϊ9999<39><39><EFBFBD>ַ<EFBFBD>
result:=result+1 ;
end;
s1:='<'+_s1+' />';
while pos(s1,s2)>0 do
begin
s2:=copy(s2,pos(s1,s2)+1,length(s2)); //<2F><><EFBFBD><EFBFBD>s2<73><32><EFBFBD>󳤶<EFBFBD>Ϊ9999<39><39><EFBFBD>ַ<EFBFBD>
result:=result+1 ;
end;
end;
function Tfrm_data_share.REHH(str: string): string;
var _r:string;
begin
_r:=StringReplace (str, '\\\\', #13#10, [rfReplaceAll]);
result:=_r;
end;
function Tfrm_data_share.countTrimString(_s1,s2:string):integer;
var s1:string;
begin
result:=0;
s1:='<'+_s1+'>';
while pos(s1,s2)>0 do
begin
s2:=copy(s2,pos(s1,s2)+1,length(s2)); //<2F><><EFBFBD><EFBFBD>s2<73><32><EFBFBD>󳤶<EFBFBD>Ϊ9999<39><39><EFBFBD>ַ<EFBFBD>
result:=result+1 ;
end;
end;
end.