📄 bas_customer_d.pas
字号:
unit Bas_Customer_D;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Detail, StdCtrls, Db, AdODB, ExtCtrls, Mask, ExtEdit;
Type
TFrm_Bas_Customer_D = Class(TFrm_Base_Detail)
Label4: TLabel;
Label5: TLabel;
Label8: TLabel;
Label10: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label21: TLabel;
Edt_Customerbank: TEdit;
Edt_Customerowner: TEdit;
Edt_CustomerremArk: TEdit;
Edt_Customerceo: TEdit;
Edt_Customertaxrate_Percent: TEdit;
Edt_Customercontact: TEdit;
Edt_Customertaxno: TEdit;
Edt_Customerbankaccno: TEdit;
Edt_Customeremail: TEdit;
Edt_CustomerAddress: TEdit;
Edt_CustomerName: TEdit;
Edt_CustomerCode: TEdit;
Edt_Customertel: TEdit;
Label1: TLabel;
Edt_CustomershortName: TEdit;
Label2: TLabel;
Edt_Customerfax: TEdit;
Edt_CustomerClass1: TEdit;
Edt_CustomerClass2: TEdit;
Edt_CustomerClass3: TEdit;
Edt_CustomerClass4: TEdit;
Edt_CustomerClass5: TEdit;
lbl_ParamName1: TLabel;
lbl_ParamName2: TLabel;
lbl_ParamName3: TLabel;
lbl_ParamName4: TLabel;
lbl_ParamName5: TLabel;
Label3: TLabel;
Label7: TLabel;
Cmbbx_CustomercreditCtrl: TComboBox;
Label11: TLabel;
Edt_Customercredit: TEdit;
cmbbx_DisableShip: TComboBox;
Label6: TLabel;
Label9: TLabel;
edt_AreaCode: TEdit;
edt_AreaName: TEdit;
Label20: TLabel;
cmb_Ctrl: TComboBox;
Label22: TLabel;
edt_ShipModeCode: TEdit;
edt_ShipModeName: TEdit;
Label23: TLabel;
edt_CurrencyCode: TEdit;
edt_CurrencyName: TEdit;
Label24: TLabel;
edt_PayTermCode: TEdit;
edt_PayTermName: TEdit;
Label25: TLabel;
edt_SaleTypeCode: TEdit;
edt_SaleTypeName: TEdit;
Label26: TLabel;
edt_DeptCode: TEdit;
edt_DeptName: TEdit;
Label27: TLabel;
edt_EmployeeCode: TEdit;
edt_EmployeeName: TEdit;
Label28: TLabel;
cmb_Cancelmode: TComboBox;
Label29: TLabel;
Extedt_InvoiceArKmCodeName: TExtEdit;
Label30: TLabel;
Label31: TLabel;
ExtEdt_GenerallyInvoiceArKmCode: TExtEdit;
Lbl_KmName1: TLabel;
Label33: TLabel;
ExtEdt_SepcialInvoiceArKmCode: TExtEdit;
Lbl_KmName2: TLabel;
Edt_InvoiceArKmName: TExtEdit;
Edt_GInvoiceArKmName: TExtEdit;
Edt_SInvoiceArKmName: TExtEdit;
Label32: TLabel;
Label34: TLabel;
ExtEDT_SaleCoStkMCode: TExtEdit;
ExtEdt_SaleCoStkMName: TExtEdit;
Label35: TLabel;
Label36: TLabel;
ExtEdt_OtherSaleCoStkmCode: TExtEdit;
ExtEdt_OtherSaleCoStkmName: TExtEdit;
procedure Edt_CustomerCodeExit(Sender: TObject);
procedure Edt_CustomerNameExit(Sender: TObject);
procedure Edt_CustomercreditExit(Sender: TObject);
procedure Edt_Customertaxrate_PercentExit(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Cmbbx_CustomercreditCtrlExit(Sender: TObject);
procedure Edt_CustomerremArkExit(Sender: TObject);
procedure edt_AreaCodeKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure edt_AreaCodeExit(Sender: TObject);
procedure edt_ShipModeCodeKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure edt_PayTermCodeKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure edt_SaleTypeCodeKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure edt_PayTermCodeExit(Sender: TObject);
procedure edt_SaleTypeCodeExit(Sender: TObject);
procedure edt_ShipModeCodeExit(Sender: TObject);
procedure edt_CurrencyCodeExit(Sender: TObject);
procedure edt_EmployeeCodeExit(Sender: TObject);
procedure edt_DeptCodeExit(Sender: TObject);
procedure Extedt_InvoiceArKmCodeNameExit(Sender: TObject);
procedure ExtEdt_GenerallyInvoiceArKmCodeExit(Sender: TObject);
procedure ExtEdt_SepcialInvoiceArKmCodeExit(Sender: TObject);
procedure ExtEDT_SaleCoStkMCodeExit(Sender: TObject);
procedure ExtEdt_OtherSaleCoStkmCodeExit(Sender: TObject);
private
{ Private declarations }
procedure initSysParamName;
function checknumber(tmp_Checkstring:string):boolean;
procedure InitControls; Override;
procedure SaveData; Override;
public
{ Public declarations }
end;
var
Frm_Bas_Customer_D: TFrm_Bas_Customer_D;
implementation
uses Sys_Global;
{$R *.DFM}
procedure TFrm_Bas_Customer_D.InitControls;
begin
inherited;
with AdoQry_Maintain do
begin
Edt_CustomerCode.Text:=fieldbyname('customerCode').AsString;
Edt_CustomerName.Text:=fieldbyname('customerName').AsString;
Edt_CustomershortName.Text:=fieldbyname('customershortName').AsString;
edt_AreaCode.Text:=fieldbyname('AreaCode').asstring;
edt_AreaName.text:=fieldbyname('AreaName').asstring;
edt_ShipModeCode.Text:=fieldbyname('customerShipModeCode').asstring;
edt_ShipModeName.text:=fieldbyname('ShipModeName').asstring;
edt_CurrencyCode.Text:=fieldbyname('customercurrencyCode').asstring;
edt_CurrencyName.text:=fieldbyname('currencyName').asstring;
edt_PayTermCode.Text:=fieldbyname('customerPayTermCode').asstring;
edt_PayTermName.text:=fieldbyname('PayTermName').asstring;
edt_SaleTypeCode.Text:=fieldbyname('customerSaleTypeCode').asstring;
edt_SaleTypeName.text:=fieldbyname('SaleTypeName').asstring;
edt_DeptCode.Text:=fieldbyname('customerSaleDeptCode').asstring;
edt_DeptName.text:=fieldbyname('DeptName').asstring;
edt_EmployeeCode.Text:=fieldbyname('customerSaleEmployeeCode').asstring;
edt_EmployeeName.text:=fieldbyname('EmployeeName').asstring;
cmb_Ctrl.ItemIndex:=fieldbyname('SalePricecontrl').asinteger;
Edt_Customercredit.text:=fieldbyname('customercredit').AsString;
Edt_CustomerAddress.text:=fieldbyname('customerAddress').AsString;
Edt_Customeremail.text:=fieldbyname('Customeremail').AsString;
Edt_Customertel.text:=fieldbyname('Customertel').AsString;
Edt_Customertaxno.text:=fieldbyname('Customertaxno').asstring;
Edt_Customerfax.text:=fieldbyname('Customerfax').AsString;
Edt_Customerbank.text:=fieldbyname('Customerbank').AsString;
Edt_Customerbankaccno.text:=fieldbyname('Customerbankaccno').AsString;
Edt_Customertaxrate_Percent.text:=fieldbyname('Customertaxrate_Percent').AsString;
Edt_Customerceo.text:=fieldbyname('Customerceo').AsString;
Edt_Customercontact.text:=fieldbyname('Customercontact').AsString;
Edt_Customerowner.text:=fieldbyname('Customerowner').AsString;
Edt_CustomerremArk.text:=fieldbyname('CustomerremArk').AsString;
Extedt_InvoiceArKmCodeName.Text:=fieldbyname('InvoiceArKmCode').asstring;
Edt_InvoiceArKmName.Text := fieldbyname('KmName').AsString;
ExtEdt_GenerallyInvoiceArKmCode.Text:=fieldbyname('GenerallyInvoiceArKmCode').AsString;
ExtEdt_GenerallyInvoiceArKmCode.DispLabel.Caption:=fieldbyname('GenerallyInvoiceArKmName').AsString;
Edt_GInvoiceArKmName.Text := fieldbyname('GenerallyInvoiceArKmName').AsString;
ExtEdt_SepcialInvoiceArKmCode.Text:=fieldbyname('SepcialInvoiceArKmCode').AsString;
ExtEdt_SepcialInvoiceArKmCode.DispLabel.Caption:=fieldbyname('SepcialInvoiceArKmName').AsString;
ExtEDT_SaleCoStkMCode.Text:=fieldbyname('SaleCoStkmCode').asstring;
ExtEDT_SaleCoStkMName.Text:=fieldbyname('SaleCoStkmName').asstring;
Edt_SInvoiceArKmName.Text := fieldbyname('SepcialInvoiceArKmName').AsString;
ExtEdt_OtherSaleCoStkmCode.Text:=fieldbyname('OtherSaleCoStkmCode').asstring;
ExtEdt_OtherSaleCoStkmName.Text:=fieldbyname('OtherSaleCoStkmName').asstring;
If fieldbyname('DisableShip').asinteger=1 then
cmbbx_DisableShip.ItemIndex:=1
else
cmbbx_DisableShip.ItemIndex:=0;
cmb_Cancelmode.ItemIndex:=fieldbyname('SalInvoiceCancelmode').asinteger-1;
cmb_Cancelmode.ItemIndex:=iifinteger(cmb_Cancelmode.Itemindex=-1,0,cmb_Cancelmode.Itemindex) ;
If fieldbyname('customercreditCtrl').asinteger=1 then
Cmbbx_CustomercreditCtrl.ItemIndex:=1
else
Cmbbx_CustomercreditCtrl.ItemIndex:=0;
end;
if Add then
begin
edt_CustomerCode.Enabled:=True;
edt_CustomerCode.SetFocus;
end
else
begin
edt_CustomerCode.Enabled:=False;
edt_CustomerName.SetFocus;
end;
with AdoQry_Tmp do
begin
Close;
SQL.Text:='select isnull(SysParamValueN,0) from SysParam where SysParamCode=''CutomerTaxNoLen''';
Open;
try
Edt_Customertaxno.MaxLength:=Fields[0].asinteger;
except;
Edt_Customertaxno.MaxLength:=0;
end;
end;
initSysParamName;
end;
procedure TFrm_Bas_Customer_D.SaveData;
var
sInvoiceArKmCode:string;
sInvoiceArKmCode1:string;
SSaleCoStkMCode,UpSSaleCoStkMCode:String;
begin
Inherited;
if Trim(Extedt_InvoiceArKmCodeName.Text)='' then
begin
sInvoiceArKmCode:=' InvoiceArKmCode=null';
sInvoiceArKmCode1:=' Null';
end
else
begin
sInvoiceArKmCode:=' InvoiceArKmCode='+Quotedstr(Trim(Extedt_InvoiceArKmCodeName.text));
sInvoiceArKmCode1:=Quotedstr(Trim(Extedt_InvoiceArKmCodeName.text));
end;
if Trim(ExtEdt_SaleCoStkMCode.Text)='' then
begin
UpSSaleCoStkMCode:=' SaleCoStkMCode=null';
SSaleCoStkMCode:=' Null';
end
else
begin
UpSSaleCoStkMCode:=' SaleCoStkmCode='+Quotedstr(Trim(ExtEdt_SaleCoStkmCode.Text));
SSaleCoStkMCode:=Quotedstr(Trim(Extedt_SaleCoStkmCode.text));
end;
if (Add) then
begin
with AdoQry_Tmp do
begin
Close;
SQL.clear;
sql.Add('Insert customer(customerCode,'+
'customerName,'+
'customershortName,'+
'AreaCode,'+
' customerShipModeCode, '+
' customercurrencyCode, '+
' customerPayTermCode, '+
' customerSaleTypeCode, '+
' customerSaleDeptCode, '+
' customerSaleEmployeeCode, '+
'SalePricecontrl,'+
'customercreditCtrl,'+
'customercredit,'+
'customerAddress,'+
'customeremail,'+
'customertel,'+
'customerfax,'+
'customerbank,'+
'customerbankaccno,'+
'customertaxrate_Percent,'+
'customertaxno,'+
'customercontact,'+
'customerowner,'+
'customerceo,'+
'customercreatetime,'+
'customermodifytime,'+
'DisableShip,'+
'SalInvoiceCancelmode,'+
'InvoiceArKmCode,'+
'GenerallyInvoiceArKmCode,'+
'SepcialInvoiceArKmCode,'+
'SaleCoStkMCode,'+
'OtherSaleCoStkmCode,'+
'customerremArk,'+
'customerClass1,'+
'customerClass2,'+
'customerClass3,'+
'customerClass4,'+
'customerClass5) '+
'ValueS ('''+Edt_CustomerCode.text+''','+
''''+Edt_CustomerName.text+''','+
''''+Edt_CustomershortName.text+''','
+quotedstr(Trim(edt_AreaCode.text))+','
+quotedstr(Trim(edt_ShipModeCode.text))+','
+quotedstr(Trim(edt_CurrencyCode.text))+','
+quotedstr(Trim(edt_PayTermCode.text))+','
+quotedstr(Trim(edt_SaleTypeCode.text))+','
+quotedstr(Trim(edt_DeptCode.text))+','
+quotedstr(Trim(edt_EmployeeCode.text))+','
+inttostr(cmb_Ctrl.Itemindex)+','+
inttostr(Cmbbx_CustomercreditCtrl.Itemindex)+','+
Edt_Customercredit.text+','+
''''+Edt_CustomerAddress.text+''','+
''''+Edt_Customeremail.text+''','+
''''+Edt_Customertel.text+''','+
''''+Edt_Customerfax.text+''','+
''''+Edt_Customerbank.text+''','+
''''+Edt_Customerbankaccno.text+''','+
Edt_Customertaxrate_Percent.text+','+
''''+Edt_Customertaxno.text+''','+
''''+Edt_Customercontact.text+''','+
''''+Edt_Customerowner.text+''','+
''''+Edt_Customerceo.text+''','+
''''+formatdatetime('yyyy.mm.dd hh:mm:ss',now)+''','+
''''+formatdatetime('yyyy.mm.dd hh:mm:ss',now)+''','+
inttostr(cmbbx_DisableShip.Itemindex)+','+
inttostr(cmb_Cancelmode.Itemindex+1)+','+
sInvoiceArKmCode1+','
+'Case When LTrim(RTrim('''+Trim(ExtEdt_GenerallyInvoiceArKmCode.Text)+'''))='''' Then Null Else '''+Trim(ExtEdt_GenerallyInvoiceArKmCode.Text)+''' end ,'
+'Case When LTrim(RTrim('''+Trim(ExtEdt_SepcialInvoiceArKmCode.Text)+'''))='''' Then Null Else '''+Trim(ExtEdt_SepcialInvoiceArKmCode.Text)+''' end ,'
+SSaleCoStkMCode+','
+'Case When LTrim(RTrim('''+Trim(ExtEdt_OtherSaleCoStkmCode.Text)+'''))='''' Then Null Else '''+Trim(ExtEdt_OtherSaleCoStkmCode.Text)+''' end ,'
+''''+Edt_CustomerremArk.text+''','+
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -