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.

1600 lines
48 KiB
Plaintext

11 months ago
{$INCLUDE t_main.inc}
unit u_crm_client;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid,
dxDBTLCl, dxGrClms, StdCtrls, DBCtrls, wwdblook, Mask, RxLookup,
bsdbctrls, BusinessSkinForm, DB, ADODB, ComCtrls, bsSkinTabs, ExtCtrls,
wwdbedit, Wwdotdot, Wwdbcomb, wwdbdatetimepicker, DBCtrlsEh, Grids,
Wwdbigrd, Wwdbgrid, bsSkinGrids, bsDBGrids, bsSkinBoxCtrls, Menus,
cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxEdit, cxDBData, cxGridLevel, cxClasses, cxControls, cxGridCustomView,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid,
cxNavigator, cxDBNavigator;
type
Tfrm_crm_client = class(TForm)
bsSkinPanel2: TbsSkinPanel;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinPanel1: TbsSkinPanel;
t_crm_client1: TDataSource;
t_crm_client: TADOQuery;
v_all_client: TADOQuery;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
dxDBGrid1Column3: TdxDBGridMaskColumn;
bsSkinPanel3: TbsSkinPanel;
t_crm_client_limited: TADOQuery;
t_crm_client_limited1: TDataSource;
bsSkinButton8: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinGroupBox1: TbsSkinGroupBox;
Label14: TLabel;
wwDBComboBox1: TwwDBComboBox;
Label15: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Label16: TLabel;
Label17: TLabel;
Edit3: TEdit;
Label18: TLabel;
RxDBLookupCombo2: TRxDBLookupCombo;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
bsSkinTabSheet2: TbsSkinTabSheet;
Label4: TLabel;
Label12: TLabel;
Label5: TLabel;
Label2: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label10: TLabel;
Label11: TLabel;
Label3: TLabel;
Label13: TLabel;
DBEdit4: TDBEdit;
DBEdit1: TDBEdit;
DBEdit5: TDBEdit;
DBEdit2: TDBEdit;
DBEdit6: TDBEdit;
DBEdit7: TDBEdit;
DBEdit8: TDBEdit;
DBEdit10: TDBEdit;
DBEdit9: TDBEdit;
RxDBLookupCombo14: TRxDBLookupCombo;
RxDBLookupCombo1: TRxDBLookupCombo;
bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox3: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox4: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox11: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox9: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox8: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox7: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox6: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox5: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox12: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox10: TbsSkinDBCheckRadioBox;
bsSkinPageControl2: TbsSkinPageControl;
bsSkinTabSheet3: TbsSkinTabSheet;
Label9: TLabel;
DBMemo2: TDBMemo;
bsSkinTabSheet4: TbsSkinTabSheet;
bsSkinPanel4: TbsSkinPanel;
dxDBGrid2: TdxDBGrid;
dxDBGrid2Column1: TdxDBGridMaskColumn;
bsSkinPanel5: TbsSkinPanel;
bsSkinButton10: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
dxDBGrid3: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
bsSkinDBCheckRadioBox13: TbsSkinDBCheckRadioBox;
t_crm_client_linkman: TADOQuery;
t_crm_client_linkman1: TDataSource;
bsSkinPanel6: TbsSkinPanel;
Label36: TLabel;
Label37: TLabel;
Label38: TLabel;
Label40: TLabel;
Label39: TLabel;
Label41: TLabel;
Label42: TLabel;
Label43: TLabel;
Label44: TLabel;
Label47: TLabel;
Label48: TLabel;
Label49: TLabel;
Label50: TLabel;
Label52: TLabel;
Label51: TLabel;
Label53: TLabel;
dxDBGrid4: TdxDBGrid;
dxDBGridMaskColumn2: TdxDBGridMaskColumn;
dxDBGrid2Column2: TdxDBGridMaskColumn;
dxDBGrid4Column4: TdxDBGridColumn;
dxDBGrid2Column3: TdxDBGridMaskColumn;
bsSkinButton7: TbsSkinButton;
bsSkinButton12: TbsSkinButton;
bsSkinButton13: TbsSkinButton;
bsSkinButton14: TbsSkinButton;
DBEdit35: TDBEdit;
wwDBComboBox2: TwwDBComboBox;
DBEdit37: TDBEdit;
DBEdit39: TDBEdit;
DBEdit38: TDBEdit;
DBEdit36: TDBEdit;
DBEdit40: TDBEdit;
DBEdit41: TDBEdit;
DBEdit42: TDBEdit;
DBEdit43: TDBEdit;
DBEdit44: TDBEdit;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBDateTimePicker2: TwwDBDateTimePicker;
wwDBDateTimePicker4: TwwDBDateTimePicker;
wwDBDateTimePicker3: TwwDBDateTimePicker;
DBMemo3: TDBMemo;
bsSkinButton15: TbsSkinButton;
bsSkinPanel7: TbsSkinPanel;
bsSkinDBCheckRadioBox14: TbsSkinDBCheckRadioBox;
ds_crm_client_sales1: TDataSource;
crmsalse_sheet: TbsSkinTabSheet;
bsSkinPanel8: TbsSkinPanel;
bsSkinButton18: TbsSkinButton;
bsSkinButton19: TbsSkinButton;
bsSkinButton20: TbsSkinButton;
bsSkinButton21: TbsSkinButton;
bsSkinButton16: TbsSkinButton;
bsSkinButton17: TbsSkinButton;
t_crm_client_sales: TADOQuery;
Label27: TLabel;
DBEdit3: TDBEdit;
Label28: TLabel;
DBEdit11: TDBEdit;
DBEdit12: TDBEdit;
Label29: TLabel;
bsSkinPageControl3: TbsSkinPageControl;
bs1: TbsSkinTabSheet;
DBMemo1: TDBMemo;
bs2: TbsSkinTabSheet;
Label20: TLabel;
DBEdit13: TDBEdit;
Label30: TLabel;
DBEdit14: TDBEdit;
DBEdit15: TDBEdit;
Label31: TLabel;
Label32: TLabel;
DBEdit16: TDBEdit;
Label33: TLabel;
Label34: TLabel;
Label35: TLabel;
DBMemo4: TDBMemo;
DBEdit17: TDBEdit;
DBEdit18: TDBEdit;
DBEdit19: TDBEdit;
Label45: TLabel;
Label46: TLabel;
DBEdit20: TDBEdit;
Label54: TLabel;
Edit4: TEdit;
Label55: TLabel;
Edit5: TEdit;
bsSkinButton22: TbsSkinButton;
bsSkinPanel9: TbsSkinPanel;
bsSkinGroupBox3: TbsSkinGroupBox;
Label24: TLabel;
Label25: TLabel;
Label26: TLabel;
wwDBDateTimePicker6: TwwDBDateTimePicker;
wwDBDateTimePicker7: TwwDBDateTimePicker;
wwDBLookupCombo2: TwwDBLookupCombo;
bsSkinGroupBox2: TbsSkinGroupBox;
Label21: TLabel;
Label73: TLabel;
lbl1: TLabel;
Label22: TLabel;
wwDBComboBox13: TwwDBComboBox;
wwDBComboBox12: TwwDBComboBox;
bsSkinDBCheckRadioBox16: TbsSkinDBCheckRadioBox;
DBEdit55: TDBEdit;
bsSkinGroupBox12: TbsSkinGroupBox;
Label77: TLabel;
Label23: TLabel;
DBEdit59: TDBEdit;
bsSkinGroupBox13: TbsSkinGroupBox;
Label79: TLabel;
Label86: TLabel;
lblmonth: TLabel;
lbldate: TLabel;
Label91: TLabel;
wwDBComboBox14: TwwDBComboBox;
wwDBComboBox15: TwwDBComboBox;
DBEdit61: TDBEdit;
dxDBGrid5: TdxDBGrid;
dxDBGrid5ID: TdxDBGridMaskColumn;
dxDBGrid5Column2: TdxDBGridMaskColumn;
dxDBGrid5Column3: TdxDBGridMaskColumn;
dxDBGrid5Column4: TdxDBGridMaskColumn;
dxDBGrid5Column5: TdxDBGridMaskColumn;
dxDBGrid5Column6: TdxDBGridMaskColumn;
dxDBGrid5Column7: TdxDBGridMaskColumn;
dxDBGrid5Column8: TdxDBGridMaskColumn;
dxDBGrid5Column9: TdxDBGridCurrencyColumn;
dxDBGrid5Column10: TdxDBGridDateColumn;
dxDBGrid5Column11: TdxDBGridMaskColumn;
dxDBGrid5Column12: TdxDBGridMaskColumn;
dxDBGrid5Column13: TdxDBGridMaskColumn;
dxDBGrid5Column14: TdxDBGridMaskColumn;
dxDBGrid52: TdxDBGridMaskColumn;
dxDBGrid5Column16: TdxDBGridMaskColumn;
dxDBGrid5Column17: TdxDBGridMaskColumn;
dxDBGrid5Column18: TdxDBGridCheckColumn;
dxDBGrid5Column19: TdxDBGridMaskColumn;
dxDBGrid5Column20: TdxDBGridDateColumn;
dxDBGrid5Column21: TdxDBGridDateColumn;
btab4: TbsSkinTabSheet;
DBMemo5: TDBMemo;
Label56: TLabel;
DBMemo6: TDBMemo;
Label57: TLabel;
DBEdit23: TDBEdit;
Label58: TLabel;
Label60: TLabel;
DBEdit22: TDBEdit;
Label61: TLabel;
DBEdit24: TDBEdit;
Label62: TLabel;
DBEdit25: TDBEdit;
bsSkinDBCheckRadioBox15: TbsSkinDBCheckRadioBox;
dxDBGrid1Column4: TdxDBGridColumn;
Label19: TLabel;
wwDBDateTimePicker5: TwwDBDateTimePicker;
Label63: TLabel;
DBEdit26: TDBEdit;
bsSkinDBCheckRadioBox17: TbsSkinDBCheckRadioBox;
bsSkinTabSheet5: TbsSkinTabSheet;
bsSkinGroupBox4: TbsSkinGroupBox;
Label64: TLabel;
Label65: TLabel;
Label66: TLabel;
Label67: TLabel;
Label68: TLabel;
Label69: TLabel;
DBEdit27: TDBEdit;
DBEdit28: TDBEdit;
DBEdit29: TDBEdit;
DBEdit30: TDBEdit;
DBEdit50: TDBEdit;
DBEdit51: TDBEdit;
bsSkinGroupBox5: TbsSkinGroupBox;
Label59: TLabel;
DBEdit21: TDBEdit;
Label70: TLabel;
wwDBComboBox3: TwwDBComboBox;
bsSkinButton23: TbsSkinButton;
bsSkinDBCheckRadioBox18: TbsSkinDBCheckRadioBox;
dxDBGrid1Column5: TdxDBGridColumn;
dxDBGrid1Column6: TdxDBGridColumn;
Label71: TLabel;
DBComboBoxEh1: TDBComboBoxEh;
Label72: TLabel;
DBEdit31: TDBEdit;
bsSkinButton24: TbsSkinButton;
bsSkinButton25: TbsSkinButton;
bsSkinDBCheckRadioBox19: TbsSkinDBCheckRadioBox;
Label1: TLabel;
bsSkinDBComboBox1: TbsSkinDBComboBox;
bsSkinButton26: TbsSkinButton;
bsSkinGroupBox6: TbsSkinGroupBox;
Label74: TLabel;
DBEdit32: TDBEdit;
Label75: TLabel;
PopupMenu1: TPopupMenu;
N16: TMenuItem;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
dxDBGrid1Column9: TdxDBGridColumn;
dxDBGrid1Column10: TdxDBGridColumn;
dxDBGrid1Column11: TdxDBGridColumn;
dxDBGrid1Column12: TdxDBGridColumn;
dxDBGrid1Column13: TdxDBGridColumn;
dxDBGrid1Column14: TdxDBGridColumn;
dxDBGrid1Column15: TdxDBGridColumn;
dxDBGrid1Column16: TdxDBGridColumn;
dxDBGrid1Column17: TdxDBGridColumn;
dxDBGrid1Column18: TdxDBGridColumn;
dxDBGrid1Column19: TdxDBGridColumn;
dxDBGrid1Column20: TdxDBGridColumn;
dxDBGrid1Column21: TdxDBGridColumn;
Label76: TLabel;
DBEdit33: TDBEdit;
DBEdit46: TDBEdit;
Label82: TLabel;
DBEdit45: TDBEdit;
bsSkinDBCheckRadioBox20: TbsSkinDBCheckRadioBox;
bsSkinGroupBox7: TbsSkinGroupBox;
Label78: TLabel;
wwDBComboBox4: TwwDBComboBox;
Label80: TLabel;
wwDBComboBox5: TwwDBComboBox;
Label81: TLabel;
DBEdit34: TDBEdit;
cxGrid1DBTableView1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid1: TcxGrid;
t_crm_client_Invoice: TADOQuery;
t_crm_client_Invoice1: TDataSource;
cxGrid1DBTableView1DBColumn1: TcxGridDBColumn;
cxDBNavigator1: TcxDBNavigator;
cxGrid1DBTableView1DBColumn2: TcxGridDBColumn;
cxGrid1DBTableView1DBColumn3: TcxGridDBColumn;
cxGrid1DBTableView1DBColumn4: TcxGridDBColumn;
cxGrid1DBTableView1DBColumn5: TcxGridDBColumn;
bsSkinDBCheckRadioBox21: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox22: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox23: TbsSkinDBCheckRadioBox;
bsSkinDBCheckRadioBox24: TbsSkinDBCheckRadioBox;
Label84: TLabel;
Label85: TLabel;
ComboBox1: TComboBox;
wwDBDateTimePicker8: TwwDBDateTimePicker;
Label83: TLabel;
wwDBDateTimePicker9: TwwDBDateTimePicker;
Label87: TLabel;
wwDBDateTimePicker10: TwwDBDateTimePicker;
bsSkinTabSheet6: TbsSkinTabSheet;
t_crm_client_yard: TADOQuery;
t_crm_client_yard1: TDataSource;
wwDBGrid1: TwwDBGrid;
t_crm_client_yardID: TAutoIncField;
t_crm_client_yardDSDesigner: TStringField;
t_crm_client_yardDSDesigner2: TStringField;
t_crm_client_yardDSDesigner3: TBooleanField;
t_crm_client_yardDSDesigner4: TDateTimeField;
t_crm_client_yardDSDesigner5: TStringField;
wwDBLookupCombo3: TwwDBLookupCombo;
Label88: TLabel;
DBEdit47: TDBEdit;
Label89: TLabel;
DBEdit48: TDBEdit;
DBEdit49: TDBEdit;
Label90: TLabel;
DBNumberEditEh1: TDBNumberEditEh;
Label92: TLabel;
DBEdit52: TDBEdit;
Label93: TLabel;
DBEdit53: TDBEdit;
Label94: TLabel;
DBEdit54: TDBEdit;
Label95: TLabel;
DBEdit56: TDBEdit;
Label96: TLabel;
DBEdit57: TDBEdit;
Label97: TLabel;
t_sys_country_qycode: TADOQuery;
t_sys_country_qycodeDSDesigner: TStringField;
t_sys_country_code: TADOQuery;
t_sys_country_codeDSDesigner: TStringField;
wwDBLookupCombo21: TwwDBLookupCombo;
Label98: TLabel;
wwDBLookupCombo1: TwwDBLookupCombo;
Label99: TLabel;
DBEdit58: TDBEdit;
bsSkinDBCheckRadioBox25: TbsSkinDBCheckRadioBox;
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure client_filtered(str:string);
procedure bsSkinCheckRadioBox2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure t_crm_clientAfterInsert(DataSet: TDataSet);
procedure t_crm_clientBeforePost(DataSet: TDataSet);
procedure DBEdit4KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit5KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit6KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit7KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit8KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit10KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit9KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo14KeyPress(Sender: TObject; var Key: Char);
procedure bsSkinDBCheckRadioBox1KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinDBCheckRadioBox2KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinDBCheckRadioBox3KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinDBCheckRadioBox4KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinDBCheckRadioBox11KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinDBCheckRadioBox9KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinDBCheckRadioBox8KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinDBCheckRadioBox7KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinDBCheckRadioBox6KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinDBCheckRadioBox5KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinDBCheckRadioBox12KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinDBCheckRadioBox10KeyPress(Sender: TObject;
var Key: Char);
procedure t_crm_clientDeleteError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
procedure t_crm_clientPostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
procedure t_crm_clientAfterScroll(DataSet: TDataSet);
procedure dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure t_crm_clientBeforeDelete(DataSet: TDataSet);
procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinPanel2Resize(Sender: TObject);
procedure t_crm_client_limitedAfterInsert(DataSet: TDataSet);
procedure t_crm_client_limitedBeforeInsert(DataSet: TDataSet);
procedure bsSkinDBCheckRadioBox13KeyPress(Sender: TObject;
var Key: Char);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure wwDBComboBox1KeyPress(Sender: TObject; var Key: Char);
procedure t_crm_clientAfterPost(DataSet: TDataSet);
procedure t_crm_clientBeforeCancel(DataSet: TDataSet);
procedure t_crm_clientBeforeEdit(DataSet: TDataSet);
procedure t_crm_clientBeforeInsert(DataSet: TDataSet);
procedure bsSkinButton7Click(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure bsSkinButton13Click(Sender: TObject);
procedure bsSkinButton14Click(Sender: TObject);
procedure bsSkinButton15Click(Sender: TObject);
procedure wwDBDateTimePicker5KeyPress(Sender: TObject; var Key: Char);
procedure t_crm_client_salesAfterInsert(DataSet: TDataSet);
procedure bsSkinButton17Click(Sender: TObject);
procedure bsSkinButton16Click(Sender: TObject);
procedure bsSkinButton18Click(Sender: TObject);
procedure bsSkinButton19Click(Sender: TObject);
procedure bsSkinButton20Click(Sender: TObject);
procedure bsSkinButton21Click(Sender: TObject);
procedure t_crm_client_salesBeforePost(DataSet: TDataSet);
procedure t_crm_client_salesBeforeDelete(DataSet: TDataSet);
procedure t_crm_client_salesBeforeEdit(DataSet: TDataSet);
procedure t_crm_client_salesBeforeInsert(DataSet: TDataSet);
procedure bsSkinButton22Click(Sender: TObject);
procedure wwDBComboBox13Change(Sender: TObject);
procedure wwDBComboBox15Change(Sender: TObject);
procedure bsSkinButton23Click(Sender: TObject);
procedure bsSkinButton24Click(Sender: TObject);
procedure bsSkinButton25Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure t_crm_client_linkmanNewRecord(DataSet: TDataSet);
procedure bsSkinButton26Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure t_crm_client_salesAfterPost(DataSet: TDataSet);
procedure ComboBox1KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker8KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker9KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker10KeyPress(Sender: TObject; var Key: Char);
procedure t_crm_client_yardNewRecord(DataSet: TDataSet);
procedure wwDBLookupCombo21Enter(Sender: TObject);
procedure wwDBLookupCombo21Exit(Sender: TObject);
procedure wwDBLookupCombo1Enter(Sender: TObject);
procedure DBEdit57Exit(Sender: TObject);
procedure wwDBLookupCombo1Exit(Sender: TObject);
procedure wwDBLookupCombo1MouseEnter(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_crm_client: Tfrm_crm_client;
frm_crm_client_num:integer;
implementation
uses u_main, my_sys_function, u_data_share, my_sys_chat;
{$R *.dfm}
procedure Tfrm_crm_client.client_filtered(str:string);
begin
t_crm_client.Filtered:=false;
t_crm_client.Filter:=str+'=1';
t_crm_client.Filtered:=true;
end;
procedure Tfrm_crm_client.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_crm_client.bsSkinButton1Click(Sender: TObject);
begin
t_crm_client.Insert;
end;
procedure Tfrm_crm_client.bsSkinButton2Click(Sender: TObject);
var
LengthQ,PosQ,i:Integer;
s:string;
begin
//Ϊ<><CEAA>ֹ<EFBFBD>Ķ<EFBFBD>̫<EFBFBD><EFBFBD><E0A3AC><EFBFBD><EFBFBD><EFB2BB><EFBFBD>ַ<EFBFBD><D6B7>ж<EFBFBD>
//<2F><><EFBFBD><EFBFBD>USCI,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ18λ<38><CEBB>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>ע<EFBFBD><D7A2>У<EFBFBD><D0A3><EFBFBD>ո񣩣<D5B8><F1A3A9A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>OC,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ9λ<39><CEBB>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>ע<EFBFBD><D7A2>У<EFBFBD><D0A3><EFBFBD>ո񣩣<D5B8><F1A3A9A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
t_crm_client.Active:=True;
t_crm_client.Edit;
if trim(wwDBLookupCombo1.DisplayValue)<>'' then
begin
LengthQ :=Length(t_crm_client.fieldbyname('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString);
PosQ:=Pos('+',t_crm_client.fieldbyname('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString);
if PosQ>0 then
begin
s:=Copy(t_crm_client.fieldbyname('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString,PosQ+1,LengthQ-POSQ+1);
for i:=1 to Length(s) do
begin
if not ( s[i] in ['0'..'9','A'..'Z']) then
begin
ShowMessage('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>ֺʹ<D6BA>д<EFBFBD><D0B4>ĸ');
DBEdit57.SetFocus;
Exit;
end;
end;
end
else
begin
ShowMessage('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>Ӧ<EFBFBD><D3A6><EFBFBD>Ǵ<EFBFBD><C7B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+<2B><>ҵ<EFBFBD><D2B5><EFBFBD>룡');
DBEdit5.SetFocus;
Exit;
end;
if Copy(t_crm_client.FieldByName('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString,0,PosQ-1)<>wwDBLookupCombo1.DisplayValue then
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD><EFBFBD><EFBFBD>');
DBEdit57.SetFocus;
Exit;
end;
if Trim(t_crm_client.FieldByName('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='USCI' then
begin
if Length(s)<>18 then
begin
ShowMessage('USCI<43><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ18λ<38><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+IntToStr(Length(s))+'λ,<2C><><EFBFBD><EFBFBD><EFBFBD>飡');
DBEdit57.SetFocus;
Exit;
end;
end;
if Trim(t_crm_client.FieldByName('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='OC' then
begin
if Length(s)<>9 then
begin
ShowMessage('OC<4F><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ9λ<39><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+IntToStr(Length(s))+'λ,<2C><><EFBFBD><EFBFBD><EFBFBD>飡');
DBEdit57.SetFocus;
Exit;
end;
end;
end;
if trim(wwDBLookupCombo1.DisplayValue)<>'' then
begin
if PosQ=0 then t_crm_client.FieldByName('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString:=wwDBLookupCombo1.DisplayValue+'+'+DBEdit57.text;
end;
table_post(t_crm_client);
end;
procedure Tfrm_crm_client.bsSkinButton4Click(Sender: TObject);
begin
table_delete(t_crm_client);
end;
procedure Tfrm_crm_client.bsSkinButton3Click(Sender: TObject);
begin
table_cancel(t_crm_client);
end;
procedure Tfrm_crm_client.bsSkinCheckRadioBox2Click(Sender: TObject);
begin
t_crm_client.Filtered:=false;
end;
procedure Tfrm_crm_client.FormShow(Sender: TObject);
begin
{
if (wwDBComboBox15.text='<27>̶<EFBFBD>')and(bsSkinGroupBox13.Visible) then
DBEdit61.Visible:=true
else
DBEdit61.Visible:=false ;
lblmonth.Visible:=DBEdit61.Visible ;
lbldate.Visible:=DBEdit61.Visible ;
}
{
if not strtobool(get_parameters_value(4,'false')) then
begin
bsSkinTabSheet2.TabVisible:=false;
end
else
begin
}
t_sys_country_code.Open;
bsSkinTabSheet2.TabVisible:=true;
t_crm_client_limited.open;
{$IFDEF KHJSXX}
{$ELSE}
crmsalse_sheet.tabvisible:=false;
{$ENDIF}
// end;
end;
procedure Tfrm_crm_client.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
with frm_data_share do
begin
t_crm_client.requery;
t_crm_client_all.requery;
t_crm_client_ship.requery;
t_crm_client_changzhan.requery;
t_crm_client_truck.requery;
t_crm_client_hangkong.requery;
t_crm_client_baoguan.requery;
t_crm_client_weituo.requery;
t_crm_client_daili.requery;
t_crm_client_huodai.requery;
t_crm_client_shiper.requery;
t_crm_client_shouhuo.requery;
t_crm_client_tongzhi.requery;
t_crm_client_other.requery;
end;
frm_crm_client.Hide;
frm_crm_client.ManualFloat(frm_crm_client.BoundsRect );
frm_main.freeTabs('frm_crm_client');
action:=cafree;
frm_crm_client:=nil;
end;
procedure Tfrm_crm_client.t_crm_clientAfterInsert(DataSet: TDataSet);
begin
t_crm_client['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD>';
frm_crm_client_num:=1;
t_crm_client['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
t_crm_client['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
end;
procedure Tfrm_crm_client.t_crm_clientBeforePost(DataSet: TDataSet);
var
aQuery:TAdoQuery;
begin
table_before_post(t_crm_client,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_crm_client,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_crm_client,'<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>');
if (t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asboolean=false)and
(t_crm_client.fieldbyname('<27><>վ').asboolean=false)and
(t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD>').asboolean=false)and
(t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean=false)and
(t_crm_client.fieldbyname('ί<>е<EFBFBD>λ').asboolean=false)and
(t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD>').asboolean=false)and
(t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD>').asboolean=false)and
(t_crm_client.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD>').asboolean=false)and
(t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean=false)and
(t_crm_client.fieldbyname('֪ͨ<CDA8><D6AA>').asboolean=false)and
(t_crm_client.fieldbyname('<27><><EFBFBD>չ<EFBFBD>˾').asboolean=false)and
(t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>').asboolean=false)and
(t_crm_client.fieldbyname('<27><><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>').asboolean=false)and
(t_crm_client.fieldbyname('<27>ֿ<EFBFBD>').asboolean=false)and
(t_crm_client.fieldbyname('<27><><EFBFBD>ݹ<EFBFBD>˾').asboolean=false)then
begin
showmessage('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>վ<EFBFBD><D5BE><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>ί<EFBFBD>е<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ջ<EFBFBD><D5BB>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD>֪ͨ<CDA8>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD>չ<EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD>˾,<2C>ֿ<EFBFBD><D6BF><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>');
abort;
end;
if t_crm_client.State=dsedit then
begin
if t_crm_client.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').OldValue<>t_crm_client.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString then
begin
frm_crm_client_num:=2;
end
else
frm_crm_client_num:=0;
end;
aQuery:=CreateAdoQuery;
try
with aQuery do begin
sql.Text:='select count(*) as ct from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>'''+t_crm_client.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+''' and <20>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>='''+t_crm_client.fieldbyname('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString+'''';
open;
if fieldbyname('ct').AsInteger<>0 then
showmessage('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>');
end;
finally
freeandnil(aQuery);
end;
end;
procedure Tfrm_crm_client.DBEdit4KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit1);
end;
procedure Tfrm_crm_client.DBEdit5KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit2);
end;
procedure Tfrm_crm_client.DBEdit6KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit7);
end;
procedure Tfrm_crm_client.DBEdit7KeyPress(Sender: TObject; var Key: Char);
begin
key_wwDBDateTimePicker(key,wwDBDateTimePicker5);
end;
procedure Tfrm_crm_client.DBEdit8KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit10);
end;
procedure Tfrm_crm_client.DBEdit10KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit9);
end;
procedure Tfrm_crm_client.DBEdit9KeyPress(Sender: TObject; var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo14);
end;
procedure Tfrm_crm_client.RxDBLookupCombo14KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo1);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox1KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox2);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox2KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox3);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox3KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox4);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox4KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox11);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox11KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox9);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox9KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox8);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox8KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox7);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox7KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox6);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox6KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox5);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox5KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox12);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox12KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox10);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox10KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox13);
end;
procedure Tfrm_crm_client.t_crm_clientDeleteError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
showmessage('<27>ͻ<EFBFBD><CDBB>Ѿ<EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_crm_client.t_crm_clientPostError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
showmessage('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1>棡');
end;
procedure Tfrm_crm_client.t_crm_clientAfterScroll(DataSet: TDataSet);
begin
if v_all_client.IsEmpty then
begin
DBEdit4.ReadOnly:=false;
DBEdit5.ReadOnly:=false;
end
else
begin
DBEdit4.ReadOnly:=true;
DBEdit5.ReadOnly:=true;
end;
end;
procedure Tfrm_crm_client.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort(Column,t_crm_client,'<27><><EFBFBD><EFBFBD>');
end;
procedure Tfrm_crm_client.t_crm_clientBeforeDelete(DataSet: TDataSet);
begin
if not if_open('202') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
abort;
end;
if do_data('0008',t_crm_client.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,t_crm_client.fieldbyname('<27>ͷ<EFBFBD>Ա').asstring,'','','')=false then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸Ĵ<DEB8><C4B4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
abort;
end;
if not v_all_client.IsEmpty then
begin
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD><CDBB>Ѿ<EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
abort;
end;
if strtobool(get_parameters_value(188,'false')) then
begin
if t_crm_client.State<>dsinsert then
SendMsg_gonggao('54','');
end;
end;
procedure Tfrm_crm_client.DBEdit1KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit5);
end;
procedure Tfrm_crm_client.RxDBLookupCombo1KeyPress(Sender: TObject;
var Key: Char);
begin
key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox1);
end;
procedure Tfrm_crm_client.bsSkinButton6Click(Sender: TObject);
begin
table_post(t_crm_client);
IF t_crm_client.IsEmpty then
exit;
frm_data_share.t_sys_department.first;
while not frm_data_share.t_sys_department.eof do
begin
if not t_crm_client_limited.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_data_share.t_sys_department.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,[])then
begin
t_crm_client_limited.insert;
t_crm_client_limited['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_sys_department.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
t_crm_client_limited.post;
end;
frm_data_share.t_sys_department.next;
end;
end;
procedure Tfrm_crm_client.bsSkinButton10Click(Sender: TObject);
begin
table_post(t_crm_client);
IF t_crm_client.IsEmpty then
exit;
if not t_crm_client_limited.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_data_share.t_sys_department.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,[])then
begin
t_crm_client_limited.insert;
t_crm_client_limited['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_sys_department.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
t_crm_client_limited.post;
end;
end;
procedure Tfrm_crm_client.bsSkinButton11Click(Sender: TObject);
begin
if t_crm_client_limited.IsEmpty then
exit;
t_crm_client_limited.Delete;
end;
procedure Tfrm_crm_client.bsSkinPanel2Resize(Sender: TObject);
var
i:integer;
begin
i:=round(bsSkinPanel2.Width/8);
bsSkinButton1.Width:=i;
bsSkinButton2.Width:=i;
bsSkinButton4.Width:=i;
bsSkinButton3.Width:=i;
bsSkinButton8.Width:=i;
bsSkinButton9.Width:=i;
bsSkinButton15.Width:=i;
end;
procedure Tfrm_crm_client.t_crm_client_limitedAfterInsert(
DataSet: TDataSet);
begin
t_crm_client_limited['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=t_crm_client['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'];
end;
procedure Tfrm_crm_client.t_crm_client_limitedBeforeInsert(
DataSet: TDataSet);
begin
table_post(t_crm_client);
end;
procedure Tfrm_crm_client.bsSkinDBCheckRadioBox13KeyPress(Sender: TObject;
var Key: Char);
begin
key_DBMemo(Key,DBMemo1);
end;
procedure Tfrm_crm_client.bsSkinButton9Click(Sender: TObject);
begin
wwDBComboBox1.text:='';
Edit1.text:='';
Edit2.text:='';
Edit3.text:='';
RxDBLookupCombo2.ClearValue;
end;
procedure Tfrm_crm_client.bsSkinButton8Click(Sender: TObject);
var
str:widestring;
begin
str:='where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>'+''''+'Ŀ<><C4BF>'+'''';
if wwDBComboBox1.text<>'' then
begin
str:=str+' and '+wwDBComboBox1.text+'=1';
end;
if Edit1.text<>''then
begin
str:=str+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
end;
if Edit2.text<>''then
begin
str:=str+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit2.text+'%'+'''';
end;
if Edit3.text<>''then
begin
str:=str+' and <20>ͻ<EFBFBD>ȫ<EFBFBD><C8AB> like '+''''+'%'+Edit3.text+'%'+'''';
end;
if RxDBLookupCombo2.DisplayValue<>''then
begin
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo2.DisplayValue+'''';
end;
if Edit4.text<>''then
begin
str:=str+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
end;
if Edit5.text<>''then
begin
str:=str+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+Edit5.text+'%'+'''';
end;
if trim(ComboBox1.Text)<>'' then
begin
str:=str+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in ( select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_crm_client_sales where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+ComboBox1.Text+''')' ;
end;
if trim(wwDBDateTimePicker8.text)<>'' then
begin
str:=str+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in ( select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_crm_client_sales where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='''+ wwDBDateTimePicker8.text+''')' ;
end;
if (wwDBDateTimePicker9.text<>'') and (wwDBDateTimePicker10.text<>'') then
begin
str:=str+' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker9.text+'''';
str:=str+' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker10.text+'''';
end
else
if wwDBDateTimePicker9.text<>''then
str:=str+' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker9.text+''''
else
if wwDBDateTimePicker10.text<>''then
str:=str+' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker10.text+'''';
t_crm_client.close;
t_crm_client.sql.clear;
t_crm_client.sql.add('select * from t_crm_client '+str+' and '+open_data('0008','¼<><C2BC><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27>ͷ<EFBFBD>Ա','no','no')+' order by <20><><EFBFBD><EFBFBD>');
t_crm_client.open;
end;
procedure Tfrm_crm_client.wwDBComboBox1KeyPress(Sender: TObject;
var Key: Char);
begin
IF key=#13 then
begin
key:=#0;
frm_crm_client.bsSkinButton8Click(Sender);
end;
end;
procedure Tfrm_crm_client.t_crm_clientAfterPost(DataSet: TDataSet);
begin
if strtobool(get_parameters_value(188,'false')) then
begin
if frm_crm_client_num=1 then
SendMsg_gonggao('53','<27>¿ͻ<C2BF>:'+t_crm_client['<27><><EFBFBD><EFBFBD>']+','+t_crm_client['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']);
if frm_crm_client_num=2 then
SendMsg_gonggao('54','');
frm_data_share.t_crm_client.Requery;
frm_data_share.t_crm_client_all.Requery;
end;
frm_crm_client_num:=0;
end;
procedure Tfrm_crm_client.t_crm_clientBeforeCancel(DataSet: TDataSet);
begin
frm_crm_client_num:=0;
end;
procedure Tfrm_crm_client.t_crm_clientBeforeEdit(DataSet: TDataSet);
begin
if not if_open('283') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
abort;
end;
if do_data('0008',t_crm_client.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,t_crm_client.fieldbyname('<27>ͷ<EFBFBD>Ա').asstring,'','','')=false then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸Ĵ<DEB8><C4B4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
abort;
end;
end;
procedure Tfrm_crm_client.t_crm_clientBeforeInsert(DataSet: TDataSet);
begin
if not if_open('202') 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_crm_client.bsSkinButton7Click(Sender: TObject);
begin
t_crm_client_linkman.insert;
end;
procedure Tfrm_crm_client.bsSkinButton12Click(Sender: TObject);
begin
table_post(t_crm_client_linkman);
end;
procedure Tfrm_crm_client.bsSkinButton13Click(Sender: TObject);
begin
table_delete(t_crm_client_linkman);
end;
procedure Tfrm_crm_client.bsSkinButton14Click(Sender: TObject);
begin
table_cancel(t_crm_client_linkman);
end;
procedure Tfrm_crm_client.bsSkinButton15Click(Sender: TObject);
begin
if not if_open('202') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
abort;
end;
sys_print('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>ϴ<EFBFBD>ӡ',2,nil,nil,nil,nil,t_crm_client1,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_crm_client.wwDBDateTimePicker5KeyPress(Sender: TObject;
var Key: Char);
begin
key_DBEdit(Key,DBEdit8);
end;
procedure Tfrm_crm_client.t_crm_client_salesAfterInsert(DataSet: TDataSet);
begin
t_crm_client_sales['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=t_crm_client['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'];
t_crm_client_sales['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_crm_client['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_crm_client_sales['״̬']:='<27>½<EFBFBD>';
t_crm_client_sales['<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>']:=0;
t_crm_client_sales['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_crm_client_sales['<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>']:=0;
t_crm_client_sales['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_crm_client_sales['<27><><EFBFBD><EFBFBD>ģʽ']:='<27><><EFBFBD>̶<EFBFBD>';
end;
procedure Tfrm_crm_client.bsSkinButton17Click(Sender: TObject);
begin
t_crm_client_sales.Prior ;
end;
procedure Tfrm_crm_client.bsSkinButton16Click(Sender: TObject);
begin
t_crm_client_sales.Next ;
end;
procedure Tfrm_crm_client.bsSkinButton18Click(Sender: TObject);
begin
t_crm_client_sales.insert;
end;
procedure Tfrm_crm_client.bsSkinButton19Click(Sender: TObject);
begin
table_post(t_crm_client_sales);
end;
procedure Tfrm_crm_client.bsSkinButton20Click(Sender: TObject);
begin
table_delete(t_crm_client_sales);
end;
procedure Tfrm_crm_client.bsSkinButton21Click(Sender: TObject);
begin
table_cancel(t_crm_client_sales);
end;
procedure Tfrm_crm_client.t_crm_client_salesBeforePost(DataSet: TDataSet);
begin
table_before_post(t_crm_client_sales,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_crm_client_sales,'<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>');
table_before_post(t_crm_client_sales,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
if not DataSet.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>').AsBoolean then begin
if DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='' then begin
ShowMessage('<27><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Abort;
end;
end;
if DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then begin
if DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger=0 then begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Abort;
end;
end;
if DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC>ʱ<EFBFBD><CAB1>' then begin
if DataSet.FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString='' then begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Abort;
end;
if DataSet.FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString='<27><><EFBFBD>̶<EFBFBD>' then
DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asinteger:=0 ;
end;
if DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='<27>ֽ׶θ<D7B6><CEB8><EFBFBD>' then begin
if DataSet.FieldByName('<27><><EFBFBD><EFBFBD>ģʽ').AsString='' then begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Abort;
end;
if DataSet.FieldByName('<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>').AsInteger=0 then begin
ShowMessage('<27>ֽ׶θ<D7B6><CEB8>Ѳ<EFBFBD><D1B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Abort;
end;
end;
end;
procedure Tfrm_crm_client.t_crm_client_salesBeforeDelete(
DataSet: TDataSet);
begin
if t_crm_client_sales.FieldByName('״̬').AsString='<27><><EFBFBD><EFBFBD>' then begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD>˷<EFBFBD><CBB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
if do_data('0008',t_crm_client.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'','','','')=false then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸Ĵ<DEB8><C4B4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
abort;
end;
end;
procedure Tfrm_crm_client.t_crm_client_salesBeforeEdit(DataSet: TDataSet);
begin
if t_crm_client_sales.FieldByName('״̬').AsString='<27><><EFBFBD><EFBFBD>' then begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD>˷<EFBFBD><CBB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
if do_data('0008',t_crm_client.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'','','','')=false then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸Ĵ<DEB8><C4B4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
abort;
end;
end;
procedure Tfrm_crm_client.t_crm_client_salesBeforeInsert(
DataSet: TDataSet);
begin
table_post(t_crm_client);
end;
procedure Tfrm_crm_client.bsSkinButton22Click(Sender: TObject);
begin
frm_main.view_momo(t_crm_client1,'<27><>ע');
end;
procedure Tfrm_crm_client.wwDBComboBox13Change(Sender: TObject);
begin
if wwDBComboBox13.Text='Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
begin
bsSkinGroupBox12.Visible:=true ;
bsSkinGroupBox13.Visible:=false ;
end
else if wwDBComboBox13.Text='Լ<><D4BC>ʱ<EFBFBD><CAB1>' then
begin
bsSkinGroupBox12.Visible:=false ;
bsSkinGroupBox13.Visible:=true ;
end
else
begin //<2F>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bsSkinGroupBox12.Visible:=false ;
bsSkinGroupBox13.Visible:=false ;
end
end;
procedure Tfrm_crm_client.wwDBComboBox15Change(Sender: TObject);
begin
{
if (wwDBComboBox15.text='<27>̶<EFBFBD>')and(bsSkinGroupBox13.Visible) then
DBEdit61.Visible:=true
else
DBEdit61.Visible:=false ;
lblmonth.Visible:=DBEdit61.Visible ;
lbldate.Visible:=DBEdit61.Visible ;
}
end;
procedure Tfrm_crm_client.bsSkinButton23Click(Sender: TObject);
var
i:Integer;
begin
if not if_open('283') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
abort;
end;
if do_data('0008',t_crm_client.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,t_crm_client.fieldbyname('<27>ͷ<EFBFBD>Ա').asstring,'','','')=false then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸Ĵ<DEB8><C4B4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
abort;
end;
if strtobool(get_parameters_value(154,'false')) then begin
if t_crm_client.fieldbyname('<27><><EFBFBD>ϲ<EFBFBD>ѯ').AsBoolean then begin
frm_main.qryweb.close;
frm_main.qryweb.sql.clear;
frm_main.qryweb.sql.add('delete from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+t_crm_client.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
frm_main.qryweb.ExecSQL;
t_crm_client.Edit;
t_crm_client['<27><><EFBFBD>ϲ<EFBFBD>ѯ']:=0;
t_crm_client.post;
end else begin
frm_main.qryweb.close;
frm_main.qryweb.sql.clear;
frm_main.qryweb.sql.add('select * from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+t_crm_client.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'''');
frm_main.qryweb.open;
if frm_main.qryweb.IsEmpty then begin
frm_main.qryweb.Insert;
for i:=0 to frm_main.qryweb.FieldCount-1 do begin
if t_crm_client.FindField(frm_main.qryweb.Fields[i].fieldname)<>nil then
frm_main.qryweb.Fields[i].Value:=t_crm_client.fieldbyname(frm_main.qryweb.Fields[i].FieldName).Value;
end;
frm_main.qryweb.post;
end else begin
frm_main.qryweb.Edit;
for i:=0 to frm_main.qryweb.FieldCount-1 do begin
if t_crm_client.FindField(frm_main.qryweb.Fields[i].fieldname)<>nil then
frm_main.qryweb.Fields[i].Value:=t_crm_client.fieldbyname(frm_main.qryweb.Fields[i].FieldName).Value;
end;
frm_main.qryweb.post;
end;
t_crm_client.Edit;
t_crm_client['<27><><EFBFBD>ϲ<EFBFBD>ѯ']:=1;
t_crm_client.post;
end;
end;
end;
procedure Tfrm_crm_client.bsSkinButton24Click(Sender: TObject);
begin
t_crm_client.Edit;
DBMemo1.Clear;
DBMemo1.Lines.Add(t_crm_client.fieldbyname('Ӣ<><D3A2>ȫ<EFBFBD><C8AB>').asstring);
DBMemo1.Lines.Add('ADDR:'+t_crm_client.fieldbyname('Ӣ<>ĵ<EFBFBD>ַ').asstring);
DBMemo1.Lines.Add('TEL:'+t_crm_client.fieldbyname('<27>绰').asstring);
DBMemo1.Lines.Add('FAX:'+t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
DBMemo4.Clear;
DBMemo4.Lines.Add(t_crm_client.fieldbyname('Ӣ<><D3A2>ȫ<EFBFBD><C8AB>').asstring);
DBMemo4.Lines.Add('ADDR:'+t_crm_client.fieldbyname('Ӣ<>ĵ<EFBFBD>ַ').asstring);
DBMemo4.Lines.Add('TEL:'+t_crm_client.fieldbyname('<27>绰').asstring);
DBMemo4.Lines.Add('FAX:'+t_crm_client.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
t_crm_client.Post;
end;
procedure Tfrm_crm_client.bsSkinButton25Click(Sender: TObject);
begin
if trim(t_crm_client.fieldbyname('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').asstring)<>'' then
begin
t_crm_client.Edit;
t_crm_client.fieldbyname('<27><>Ʊ̧ͷ').asstring:=t_crm_client.fieldbyname('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').asstring;
t_crm_client.Post;
end;
end;
procedure Tfrm_crm_client.FormCreate(Sender: TObject);
begin
t_crm_client.close;
t_crm_client.sql.clear;
t_crm_client.sql.add('select * from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>''Ŀ<><C4BF>'' and '+open_data('0008','¼<><C2BC><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27>ͷ<EFBFBD>Ա','no','no')+' order by <20><><EFBFBD><EFBFBD>');
t_crm_client.open;
t_crm_client.Edit;
v_all_client.open;
t_crm_client_linkman.Open;
t_crm_client_sales.Open ;
t_crm_client_Invoice.Open;
t_crm_client_yard.Open;
frm_data_share.t_sys_employee.Requery();
frm_data_share.t_sys_department.Requery();
end;
procedure Tfrm_crm_client.t_crm_client_linkmanNewRecord(DataSet: TDataSet);
begin
t_crm_client_linkman.FieldByName('<27>Ա<EFBFBD>').AsString:='<27><>';
end;
procedure Tfrm_crm_client.bsSkinButton26Click(Sender: TObject);
var aAdoQuery,aAdoQuerySel:TAdoQuery;
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 ί<>е<EFBFBD>λ=:ί<>е<EFBFBD>λ and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:Date1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:date2 ');
finally
end;
aAdoQuerySel:=CreateAdoQuery;
with aAdoQuerySel do
try
Close;sql.Clear;
sql.Add('select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_crm_client_sales');
sql.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:Date1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>''''');
Parameters.ParamByName('Date1').Value:='2012-08-25';
Open;First;
while not eof do
begin
aAdoQuery.Close;
aAdoQuery.Parameters.ParamByName('ί<>е<EFBFBD>λ').Value:=Trim(aAdoQuerySel.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
aAdoQuery.Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=Trim(aAdoQuerySel.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
aAdoQuery.Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=Trim(aAdoQuerySel.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
aAdoQuery.Parameters.ParamByName('Date1').Value:=aAdoQuerySel.FieldByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').Value;
aAdoQuery.Parameters.ParamByName('Date2').Value:=aAdoQuerySel.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
aAdoQuery.ExecSQL;
Next;
end;
finally
Free;
end;
end;
procedure Tfrm_crm_client.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid1);
end;
procedure Tfrm_crm_client.t_crm_client_salesAfterPost(DataSet: TDataSet);
begin
bsSkinButton26.OnClick(bsSkinButton26);
end;
procedure Tfrm_crm_client.ComboBox1KeyPress(Sender: TObject;
var Key: Char);
begin
IF key=#13 then
begin
key:=#0;
frm_crm_client.bsSkinButton8Click(Sender);
end;
end;
procedure Tfrm_crm_client.wwDBDateTimePicker8KeyPress(Sender: TObject;
var Key: Char);
begin
IF key=#13 then
begin
key:=#0;
frm_crm_client.bsSkinButton8Click(Sender);
end;
end;
procedure Tfrm_crm_client.wwDBDateTimePicker9KeyPress(Sender: TObject;
var Key: Char);
begin
IF key=#13 then
begin
key:=#0;
frm_crm_client.bsSkinButton8Click(Sender);
end;
end;
procedure Tfrm_crm_client.wwDBDateTimePicker10KeyPress(Sender: TObject;
var Key: Char);
begin
IF key=#13 then
begin
key:=#0;
frm_crm_client.bsSkinButton8Click(Sender);
end;
end;
procedure Tfrm_crm_client.t_crm_client_yardNewRecord(DataSet: TDataSet);
begin
t_crm_client_yard.FieldByName('<27>Ƿ<EFBFBD>Ĭ<EFBFBD><C4AC>').Value:=0;
t_crm_client_yard.FieldByName('¼<><C2BC><EFBFBD><EFBFBD>').Value:=employee;
t_crm_client_yard.FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=Now;
end;
procedure Tfrm_crm_client.wwDBLookupCombo21Enter(Sender: TObject);
begin
if not t_sys_country_code.Active then t_sys_country_code.Open;
end;
procedure Tfrm_crm_client.wwDBLookupCombo21Exit(Sender: TObject);
begin
if Trim(wwDBLookupCombo21.DisplayValue)='' then
begin
ShowMessage('<27><>û<EFBFBD><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>Ҵ<EFBFBD><D2B4>룡');
wwDBLookupCombo21.SetFocus;
Exit;
end;
with t_sys_country_qycode do
begin
Close;
Parameters.ParamByName('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD>').Value:=wwDBLookupCombo21.DisplayValue;
Open;
end;
end;
procedure Tfrm_crm_client.wwDBLookupCombo1Enter(Sender: TObject);
begin
if Trim(wwDBLookupCombo21.DisplayValue)='' then
begin
ShowMessage('<27><>û<EFBFBD><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>Ҵ<EFBFBD><D2B4>룡');
wwDBLookupCombo21.SetFocus;
Exit;
end;
with t_sys_country_qycode do
begin
Close;
Parameters.ParamByName('<27><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD>').Value:=wwDBLookupCombo21.DisplayValue;
Open;
end;
end;
procedure Tfrm_crm_client.DBEdit57Exit(Sender: TObject);
begin
{ if Trim(t_crm_client.FieldByName('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='USCI' then
begin
if Length(DBEdit57.Text)<>18 then
begin
ShowMessage('USCI<43><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ18λ<38><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+IntToStr(Length(DBEdit57.Text))+'λ,<2C><><EFBFBD><EFBFBD><EFBFBD>飡');
Exit;
end;
end;
if Trim(t_crm_client.FieldByName('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='OC' then
begin
if Length(DBEdit57.Text)<>9 then
begin
ShowMessage('OC<4F><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ9λ<39><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+IntToStr(Length(DBEdit57.Text))+'λ,<2C><><EFBFBD><EFBFBD><EFBFBD>飡');
Exit;
end;
end; }
end;
procedure Tfrm_crm_client.wwDBLookupCombo1Exit(Sender: TObject);
var
LengthQ,PosQ:Integer;
s:string;
begin
t_crm_client.Active:=True;
t_crm_client.Edit;
LengthQ :=Length(t_crm_client.fieldbyname('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString);
PosQ:=Pos('+',t_crm_client.fieldbyname('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString);
if PosQ=0 then
begin
t_crm_client.FieldByName('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString:=wwDBLookupCombo1.DisplayValue+'+'+DBEdit57.text
end
else
begin
s:=Copy(t_crm_client.fieldbyname('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString,PosQ+1,LengthQ-POSQ+1);
t_crm_client.FieldByName('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString:=wwDBLookupCombo1.DisplayValue+'+'+s;
end;
end;
procedure Tfrm_crm_client.wwDBLookupCombo1MouseEnter(Sender: TObject);
var
LengthQ,PosQ:Integer;
s:string;
begin
t_crm_client.Active:=True;
t_crm_client.Edit;
LengthQ :=Length(t_crm_client.fieldbyname('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString);
PosQ:=Pos('+',t_crm_client.fieldbyname('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString);
if PosQ=0 then
begin
t_crm_client.FieldByName('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString:=wwDBLookupCombo1.DisplayValue+'+'+DBEdit57.text
end
else
begin
s:=Copy(t_crm_client.fieldbyname('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString,PosQ+1,LengthQ-POSQ+1);
t_crm_client.FieldByName('<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString:=wwDBLookupCombo1.DisplayValue+'+'+s;
end;
end;
end.