|
|
unit u_crm_client_check;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, dxExEdtr, DB, ADODB, dxDBTLCl, dxGrClms, wwdbdatetimepicker,
|
|
|
StdCtrls, DBCtrls, wwdbedit, Wwdotdot, Wwdbcomb, RxLookup, bsSkinCtrls,
|
|
|
bsdbctrls, Mask, ComCtrls, bsSkinTabs, ExtCtrls, dxTL, dxDBCtrl,
|
|
|
dxDBGrid, dxCntner, Grids, Wwdbigrd, Wwdbgrid, Psock, NMsmtp,
|
|
|
IdComponent, IdTCPConnection, IdTCPClient, IdMessageClient, IdSMTP,
|
|
|
IdBaseComponent, IdMessage, IdExplicitTLSClientServerBase, IdSMTPBase,
|
|
|
wwdblook, Menus;
|
|
|
|
|
|
type
|
|
|
Tfrm_crm_client_check = class(TForm)
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column4: TdxDBGridMaskColumn;
|
|
|
t_crm_client: TADOQuery;
|
|
|
t_crm_client1: TDataSource;
|
|
|
t_crm_client_linkman: TADOQuery;
|
|
|
t_crm_client_linkman1: TDataSource;
|
|
|
t_crm_client_link: TADOQuery;
|
|
|
t_crm_client_link1: TDataSource;
|
|
|
Panel1: TPanel;
|
|
|
bsSkinPageControl1: TbsSkinPageControl;
|
|
|
bsSkinTabSheet1: TbsSkinTabSheet;
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
Label1: TLabel;
|
|
|
Label3: TLabel;
|
|
|
Label9: TLabel;
|
|
|
Label12: TLabel;
|
|
|
DBEdit1: TDBEdit;
|
|
|
DBEdit3: TDBEdit;
|
|
|
DBEdit11: TDBEdit;
|
|
|
DBEdit12: TDBEdit;
|
|
|
bsSkinGroupBox2: TbsSkinGroupBox;
|
|
|
Label13: TLabel;
|
|
|
Label14: TLabel;
|
|
|
Label15: TLabel;
|
|
|
Label16: TLabel;
|
|
|
DBEdit13: TDBEdit;
|
|
|
DBEdit14: TDBEdit;
|
|
|
DBEdit15: TDBEdit;
|
|
|
DBEdit16: TDBEdit;
|
|
|
bsSkinGroupBox4: TbsSkinGroupBox;
|
|
|
bsSkinTabSheet2: TbsSkinTabSheet;
|
|
|
bsSkinGroupBox5: TbsSkinGroupBox;
|
|
|
Label20: TLabel;
|
|
|
Label21: TLabel;
|
|
|
Label22: TLabel;
|
|
|
Label164: TLabel;
|
|
|
DBEdit20: TDBEdit;
|
|
|
DBEdit21: TDBEdit;
|
|
|
DBEdit22: TDBEdit;
|
|
|
RxDBLookupCombo11: TRxDBLookupCombo;
|
|
|
bsSkinGroupBox6: TbsSkinGroupBox;
|
|
|
Label19: TLabel;
|
|
|
Label24: TLabel;
|
|
|
Label46: TLabel;
|
|
|
DBEdit19: TDBEdit;
|
|
|
DBEdit24: TDBEdit;
|
|
|
DBEdit30: TDBEdit;
|
|
|
bsSkinGroupBox7: TbsSkinGroupBox;
|
|
|
Label23: TLabel;
|
|
|
Label26: TLabel;
|
|
|
Label27: TLabel;
|
|
|
Label28: TLabel;
|
|
|
DBEdit26: TDBEdit;
|
|
|
DBEdit23: TDBEdit;
|
|
|
DBEdit27: TDBEdit;
|
|
|
bsSkinDBCheckRadioBox9: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox10: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox11: TbsSkinDBCheckRadioBox;
|
|
|
DBEdit28: TDBEdit;
|
|
|
bsSkinGroupBox8: TbsSkinGroupBox;
|
|
|
Label29: TLabel;
|
|
|
Label30: TLabel;
|
|
|
Label31: TLabel;
|
|
|
Label32: TLabel;
|
|
|
Label33: TLabel;
|
|
|
Label34: TLabel;
|
|
|
Label35: TLabel;
|
|
|
DBEdit29: TDBEdit;
|
|
|
DBEdit31: TDBEdit;
|
|
|
DBEdit32: TDBEdit;
|
|
|
DBEdit33: TDBEdit;
|
|
|
DBEdit34: TDBEdit;
|
|
|
wwDBComboBox1: TwwDBComboBox;
|
|
|
DBMemo1: TDBMemo;
|
|
|
bsSkinTabSheet3: TbsSkinTabSheet;
|
|
|
Label36: TLabel;
|
|
|
Label37: TLabel;
|
|
|
Label38: TLabel;
|
|
|
Label39: TLabel;
|
|
|
Label40: TLabel;
|
|
|
Label41: TLabel;
|
|
|
Label42: TLabel;
|
|
|
Label43: TLabel;
|
|
|
Label44: TLabel;
|
|
|
Label47: TLabel;
|
|
|
Label48: TLabel;
|
|
|
Label49: TLabel;
|
|
|
Label50: TLabel;
|
|
|
Label51: TLabel;
|
|
|
Label52: TLabel;
|
|
|
Label53: TLabel;
|
|
|
dxDBGrid2: TdxDBGrid;
|
|
|
dxDBGrid2Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid2Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid2Column3: TdxDBGridMaskColumn;
|
|
|
DBEdit35: TDBEdit;
|
|
|
DBEdit37: TDBEdit;
|
|
|
DBEdit38: TDBEdit;
|
|
|
DBEdit39: TDBEdit;
|
|
|
wwDBComboBox2: TwwDBComboBox;
|
|
|
DBEdit36: TDBEdit;
|
|
|
DBEdit40: TDBEdit;
|
|
|
DBEdit41: TDBEdit;
|
|
|
DBEdit42: TDBEdit;
|
|
|
DBEdit43: TDBEdit;
|
|
|
DBEdit44: TDBEdit;
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker2: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker3: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker4: TwwDBDateTimePicker;
|
|
|
DBMemo2: TDBMemo;
|
|
|
bsSkinTabSheet4: TbsSkinTabSheet;
|
|
|
Label54: TLabel;
|
|
|
Label55: TLabel;
|
|
|
Label56: TLabel;
|
|
|
Label57: TLabel;
|
|
|
Label58: TLabel;
|
|
|
Label59: TLabel;
|
|
|
Label60: TLabel;
|
|
|
Label61: TLabel;
|
|
|
dxDBGrid3: TdxDBGrid;
|
|
|
dxDBGrid3Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid3Column2: TdxDBGridDateColumn;
|
|
|
DBEdit46: TDBEdit;
|
|
|
DBEdit47: TDBEdit;
|
|
|
DBEdit49: TDBEdit;
|
|
|
wwDBComboBox3: TwwDBComboBox;
|
|
|
RxDBLookupCombo8: TRxDBLookupCombo;
|
|
|
wwDBDateTimePicker5: TwwDBDateTimePicker;
|
|
|
wwDBComboBox4: TwwDBComboBox;
|
|
|
DBMemo3: TDBMemo;
|
|
|
bsSkinTabSheet5: TbsSkinTabSheet;
|
|
|
p_client_liushi: TADOStoredProc;
|
|
|
p_client_state: TADOStoredProc;
|
|
|
p_update: TADOStoredProc;
|
|
|
bsSkinGroupBox3: TbsSkinGroupBox;
|
|
|
Label4: TLabel;
|
|
|
Label5: TLabel;
|
|
|
Label2: TLabel;
|
|
|
Label7: TLabel;
|
|
|
Label6: TLabel;
|
|
|
Label10: TLabel;
|
|
|
Label11: TLabel;
|
|
|
Label8: TLabel;
|
|
|
Label17: TLabel;
|
|
|
Label18: TLabel;
|
|
|
Label62: TLabel;
|
|
|
DBEdit4: TDBEdit;
|
|
|
DBEdit5: TDBEdit;
|
|
|
DBEdit2: TDBEdit;
|
|
|
DBEdit7: TDBEdit;
|
|
|
DBEdit6: TDBEdit;
|
|
|
DBEdit10: TDBEdit;
|
|
|
DBEdit9: TDBEdit;
|
|
|
DBEdit8: TDBEdit;
|
|
|
DBEdit17: TDBEdit;
|
|
|
DBEdit18: TDBEdit;
|
|
|
DBEdit45: TDBEdit;
|
|
|
Panel2: TPanel;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
bsSkinButton12: TbsSkinButton;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinDBCheckRadioBox5: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox12: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox4: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox3: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox6: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox7: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox8: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox13: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox14: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox15: TbsSkinDBCheckRadioBox;
|
|
|
bskntbsht1: TbsSkinTabSheet;
|
|
|
ds_crm_client_sales1: TDataSource;
|
|
|
t_crm_client_sales: TADOQuery;
|
|
|
pnl1: TPanel;
|
|
|
bskngrpbx1: TbsSkinGroupBox;
|
|
|
bskngrpbx2: TbsSkinGroupBox;
|
|
|
Label74: TLabel;
|
|
|
Label75: TLabel;
|
|
|
Label76: TLabel;
|
|
|
Label80: TLabel;
|
|
|
Label81: TLabel;
|
|
|
Label82: TLabel;
|
|
|
Label83: TLabel;
|
|
|
Label84: TLabel;
|
|
|
Label88: TLabel;
|
|
|
Label89: TLabel;
|
|
|
Label78: TLabel;
|
|
|
Label85: TLabel;
|
|
|
bvl1: TBevel;
|
|
|
Bevel1: TBevel;
|
|
|
DBEdit50: TDBEdit;
|
|
|
DBEdit54: TDBEdit;
|
|
|
DBEdit56: TDBEdit;
|
|
|
DBEdit57: TDBEdit;
|
|
|
DBEdit58: TDBEdit;
|
|
|
DBEdit60: TDBEdit;
|
|
|
wwDBComboBox11: TwwDBComboBox;
|
|
|
bsSkinPanel5: TbsSkinPanel;
|
|
|
Label25: TLabel;
|
|
|
lbl1: TLabel;
|
|
|
Label64: TLabel;
|
|
|
DBEdit51: TDBEdit;
|
|
|
wwDBComboBox6: TwwDBComboBox;
|
|
|
wwDBComboBox12: TwwDBComboBox;
|
|
|
bsSkinDBCheckRadioBox16: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinGroupBox12: TbsSkinGroupBox;
|
|
|
Label65: TLabel;
|
|
|
DBEdit55: TDBEdit;
|
|
|
bsSkinGroupBox13: TbsSkinGroupBox;
|
|
|
Label77: TLabel;
|
|
|
Label66: TLabel;
|
|
|
Label67: TLabel;
|
|
|
Label72: TLabel;
|
|
|
Label73: TLabel;
|
|
|
wwDBComboBox13: TwwDBComboBox;
|
|
|
wwDBComboBox14: TwwDBComboBox;
|
|
|
DBEdit59: TDBEdit;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
wwDBGrid1: TwwDBGrid;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinButton11: TbsSkinButton;
|
|
|
bsSkinButton13: TbsSkinButton;
|
|
|
IdMsg: TIdMessage;
|
|
|
SMTP1: TIdSMTP;
|
|
|
bsSkinButton14: TbsSkinButton;
|
|
|
bsSkinGroupBox9: TbsSkinGroupBox;
|
|
|
bsSkinButton15: TbsSkinButton;
|
|
|
bsSkinButton16: TbsSkinButton;
|
|
|
Memo1: TMemo;
|
|
|
bsSkinButton17: TbsSkinButton;
|
|
|
bsSkinTabSheet7: TbsSkinTabSheet;
|
|
|
t_crm_client_ty: TADOQuery;
|
|
|
t_crm_client_ty1: TDataSource;
|
|
|
bsSkinPanel6: TbsSkinPanel;
|
|
|
Label79: TLabel;
|
|
|
Label86: TLabel;
|
|
|
Label87: TLabel;
|
|
|
Label90: TLabel;
|
|
|
Label91: TLabel;
|
|
|
Label92: TLabel;
|
|
|
Label93: TLabel;
|
|
|
Label94: TLabel;
|
|
|
Label95: TLabel;
|
|
|
Label96: TLabel;
|
|
|
Label97: TLabel;
|
|
|
Label98: TLabel;
|
|
|
Label99: TLabel;
|
|
|
DBEdit25: TDBEdit;
|
|
|
DBEdit48: TDBEdit;
|
|
|
DBEdit61: TDBEdit;
|
|
|
RxDBLookupCombo4: TRxDBLookupCombo;
|
|
|
DBEdit62: TDBEdit;
|
|
|
DBEdit63: TDBEdit;
|
|
|
DBMemo7: TDBMemo;
|
|
|
bsSkinDBCheckRadioBox17: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinDBCheckRadioBox18: TbsSkinDBCheckRadioBox;
|
|
|
DBEdit64: TDBEdit;
|
|
|
DBEdit65: TDBEdit;
|
|
|
DBEdit66: TDBEdit;
|
|
|
DBMemo8: TDBMemo;
|
|
|
bsSkinPanel7: TbsSkinPanel;
|
|
|
DBEdit67: TDBEdit;
|
|
|
DBEdit68: TDBEdit;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
bsSkinButton18: TbsSkinButton;
|
|
|
bsSkinButton19: TbsSkinButton;
|
|
|
bsSkinButton21: TbsSkinButton;
|
|
|
bsSkinTabSheet8: TbsSkinTabSheet;
|
|
|
bsSkinTabSheet9: TbsSkinTabSheet;
|
|
|
t_crm_client_tmpacc: TADOQuery;
|
|
|
t_crm_client_tmpacc1: TDataSource;
|
|
|
t_crm_client_limitamt: TADOQuery;
|
|
|
t_crm_client_limitamt1: TDataSource;
|
|
|
t_crm_client_unlockitems: TADOQuery;
|
|
|
t_crm_client_unlock: TADOQuery;
|
|
|
t_crm_client_unlock1: TDataSource;
|
|
|
t_crm_client_unlockitems1: TDataSource;
|
|
|
bsSkinPanel9: TbsSkinPanel;
|
|
|
bsSkinPanel10: TbsSkinPanel;
|
|
|
wwDBGrid2: TwwDBGrid;
|
|
|
wwDBLookupCombo1: TwwDBLookupCombo;
|
|
|
bsSkinPanel11: TbsSkinPanel;
|
|
|
bsSkinPanel12: TbsSkinPanel;
|
|
|
bsSkinButton32: TbsSkinButton;
|
|
|
bsSkinGroupBox15: TbsSkinGroupBox;
|
|
|
bsSkinPanel13: TbsSkinPanel;
|
|
|
Label112: TLabel;
|
|
|
Label113: TLabel;
|
|
|
Label114: TLabel;
|
|
|
DBEdit75: TDBEdit;
|
|
|
wwDBComboBox5: TwwDBComboBox;
|
|
|
wwDBComboBox7: TwwDBComboBox;
|
|
|
bsSkinDBCheckRadioBox19: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinGroupBox17: TbsSkinGroupBox;
|
|
|
Label115: TLabel;
|
|
|
DBEdit76: TDBEdit;
|
|
|
bsSkinGroupBox18: TbsSkinGroupBox;
|
|
|
Label116: TLabel;
|
|
|
Label117: TLabel;
|
|
|
Label118: TLabel;
|
|
|
Label119: TLabel;
|
|
|
Label120: TLabel;
|
|
|
wwDBComboBox8: TwwDBComboBox;
|
|
|
wwDBComboBox15: TwwDBComboBox;
|
|
|
DBEdit77: TDBEdit;
|
|
|
bsSkinGroupBox19: TbsSkinGroupBox;
|
|
|
DBMemo9: TDBMemo;
|
|
|
bsSkinPanel8: TbsSkinPanel;
|
|
|
bsSkinPanel14: TbsSkinPanel;
|
|
|
dxDBGrid7: TdxDBGrid;
|
|
|
dxDBGrid7Column1: TdxDBGridColumn;
|
|
|
dxDBGrid7Column2: TdxDBGridColumn;
|
|
|
dxDBGrid7Column4: TdxDBGridColumn;
|
|
|
dxDBGrid7Column8: TdxDBGridColumn;
|
|
|
dxDBGrid7Column5: TdxDBGridColumn;
|
|
|
dxDBGrid7Column6: TdxDBGridColumn;
|
|
|
dxDBGrid7Column7: TdxDBGridColumn;
|
|
|
bsSkinPanel15: TbsSkinPanel;
|
|
|
Label100: TLabel;
|
|
|
Label101: TLabel;
|
|
|
Label102: TLabel;
|
|
|
Label103: TLabel;
|
|
|
Label104: TLabel;
|
|
|
bsSkinPanel16: TbsSkinPanel;
|
|
|
DBEdit69: TDBEdit;
|
|
|
DBEdit70: TDBEdit;
|
|
|
DBEdit71: TDBEdit;
|
|
|
DBEdit72: TDBEdit;
|
|
|
RxDBLookupCombo13: TRxDBLookupCombo;
|
|
|
bsSkinPanel19: TbsSkinPanel;
|
|
|
dxDBGrid8: TdxDBGrid;
|
|
|
dxDBGrid8Column1: TdxDBGridColumn;
|
|
|
dxDBGrid8Column2: TdxDBGridColumn;
|
|
|
dxDBGrid8Column3: TdxDBGridColumn;
|
|
|
dxDBGrid8Column4: TdxDBGridColumn;
|
|
|
dxDBGrid8Column5: TdxDBGridColumn;
|
|
|
bsSkinPanel18: TbsSkinPanel;
|
|
|
bsSkinPanel17: TbsSkinPanel;
|
|
|
dxDBGrid9: TdxDBGrid;
|
|
|
dxDBGridColumn1: TdxDBGridColumn;
|
|
|
dxDBGridColumn3: TdxDBGridColumn;
|
|
|
dxDBGridColumn2: TdxDBGridColumn;
|
|
|
bsSkinButton20: TbsSkinButton;
|
|
|
bsSkinButton22: TbsSkinButton;
|
|
|
bsSkinButton23: TbsSkinButton;
|
|
|
bsSkinButton24: TbsSkinButton;
|
|
|
bsSkinButton25: TbsSkinButton;
|
|
|
bsSkinButton26: TbsSkinButton;
|
|
|
bsSkinButton27: TbsSkinButton;
|
|
|
bsSkinButton28: TbsSkinButton;
|
|
|
bsSkinButton29: TbsSkinButton;
|
|
|
PopupMenu3: TPopupMenu;
|
|
|
N8: TMenuItem;
|
|
|
N9: TMenuItem;
|
|
|
N17: TMenuItem;
|
|
|
N1: TMenuItem;
|
|
|
N2: TMenuItem;
|
|
|
Label106: TLabel;
|
|
|
DBMemo10: TDBMemo;
|
|
|
dxDBGrid8Column6: TdxDBGridColumn;
|
|
|
dxDBGrid8Column7: TdxDBGridColumn;
|
|
|
bsSkinTabSheet10: TbsSkinTabSheet;
|
|
|
t_crm_client_class: TADOQuery;
|
|
|
t_crm_client_class1: TDataSource;
|
|
|
bsSkinButton30: TbsSkinButton;
|
|
|
bsSkinPanel20: TbsSkinPanel;
|
|
|
bsSkinPanel23: TbsSkinPanel;
|
|
|
Label110: TLabel;
|
|
|
Label121: TLabel;
|
|
|
Label122: TLabel;
|
|
|
Label109: TLabel;
|
|
|
Label111: TLabel;
|
|
|
Label123: TLabel;
|
|
|
Label124: TLabel;
|
|
|
DBEdit79: TDBEdit;
|
|
|
wwDBDateTimePicker6: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker7: TwwDBDateTimePicker;
|
|
|
DBMemo11: TDBMemo;
|
|
|
dxDBGrid10: TdxDBGrid;
|
|
|
dxDBGridColumn4: TdxDBGridColumn;
|
|
|
dxDBGridColumn10: TdxDBGridColumn;
|
|
|
dxDBGridColumn6: TdxDBGridColumn;
|
|
|
dxDBGridColumn7: TdxDBGridColumn;
|
|
|
dxDBGridColumn8: TdxDBGridColumn;
|
|
|
dxDBGridColumn9: TdxDBGridColumn;
|
|
|
dxDBGrid10Column8: TdxDBGridColumn;
|
|
|
DBEdit52: TDBEdit;
|
|
|
DBEdit53: TDBEdit;
|
|
|
DBEdit73: TDBEdit;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
bsSkinButton31: TbsSkinButton;
|
|
|
bsSkinButton33: TbsSkinButton;
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure bsSkinButton12Click(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
procedure Panel2Resize(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
function get_client_state(i:real):string;
|
|
|
procedure dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
procedure bsSkinButton13Click(Sender: TObject);
|
|
|
procedure bsSkinButton11Click(Sender: TObject);
|
|
|
procedure NMSMTP1Connect(Sender: TObject);
|
|
|
procedure bsSkinButton14Click(Sender: TObject);
|
|
|
procedure bsSkinButton15Click(Sender: TObject);
|
|
|
procedure bsSkinButton16Click(Sender: TObject);
|
|
|
procedure bsSkinButton17Click(Sender: TObject);
|
|
|
procedure bsSkinButton21Click(Sender: TObject);
|
|
|
procedure bsSkinButton18Click(Sender: TObject);
|
|
|
procedure bsSkinButton19Click(Sender: TObject);
|
|
|
procedure bsSkinButton20Click(Sender: TObject);
|
|
|
procedure bsSkinButton32Click(Sender: TObject);
|
|
|
procedure bsSkinButton22Click(Sender: TObject);
|
|
|
procedure bsSkinButton29Click(Sender: TObject);
|
|
|
procedure N8Click(Sender: TObject);
|
|
|
procedure N17Click(Sender: TObject);
|
|
|
procedure N2Click(Sender: TObject);
|
|
|
procedure bsSkinButton23Click(Sender: TObject);
|
|
|
procedure bsSkinButton24Click(Sender: TObject);
|
|
|
procedure bsSkinButton25Click(Sender: TObject);
|
|
|
procedure bsSkinButton26Click(Sender: TObject);
|
|
|
procedure bsSkinButton27Click(Sender: TObject);
|
|
|
procedure bsSkinButton28Click(Sender: TObject);
|
|
|
procedure bsSkinButton30Click(Sender: TObject);
|
|
|
procedure bsSkinButton31Click(Sender: TObject);
|
|
|
procedure bsSkinButton33Click(Sender: TObject);
|
|
|
procedure t_crm_client_classBeforeDelete(DataSet: TDataSet);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_crm_client_check: Tfrm_crm_client_check;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, u_data_share, my_sys_function, u_sys_progress,
|
|
|
u_crm_client_check_do, my_sys_chat, u_returncust;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
function Tfrm_crm_client_check.get_client_state(i:real):string;
|
|
|
var
|
|
|
str:string;
|
|
|
begin
|
|
|
frm_data_share.t_code_price.first;
|
|
|
while not frm_data_share.t_code_price.eof do
|
|
|
begin
|
|
|
if (i>=frm_data_share.t_code_price.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asfloat)
|
|
|
and (i<frm_data_share.t_code_price.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asfloat) then
|
|
|
begin
|
|
|
str:=frm_data_share.t_code_price.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD>ֵ').asstring;
|
|
|
end;
|
|
|
frm_data_share.t_code_price.next;
|
|
|
end;
|
|
|
if str='' then
|
|
|
result:='û<>ж<EFBFBD><D0B6><EFBFBD>'
|
|
|
else
|
|
|
result:=str;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
frm_crm_client_check.Hide;
|
|
|
frm_crm_client_check.ManualFloat(frm_crm_client_check.BoundsRect );
|
|
|
frm_main.freeTabs('frm_crm_client_check');
|
|
|
action:=cafree;
|
|
|
frm_crm_client_check:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
t_crm_client.SQL.clear;
|
|
|
t_crm_client.sql.add('select * from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in ('+''''+'Ŀ<><C4BF>'+''''+')');
|
|
|
t_crm_client.SQL.Add(' and <20>ͻ<EFBFBD>״̬='+''''+'<27><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>'+''''
|
|
|
+' order by <20>ͻ<EFBFBD>״̬,<2C>ͻ<EFBFBD><CDBB><EFBFBD>ֵ,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_crm_client.open;
|
|
|
t_crm_client_linkman.open;
|
|
|
t_crm_client_link.open;
|
|
|
t_crm_client_sales.Open;
|
|
|
|
|
|
t_crm_client_tmpacc.Open;
|
|
|
t_crm_client_limitamt.Open;
|
|
|
|
|
|
t_crm_client_unlock.Open;
|
|
|
|
|
|
t_crm_client_unlockitems.Open;
|
|
|
|
|
|
t_crm_client_ty.Open;
|
|
|
dxDBGrid1.FullExpand;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
sys_print('<27><><EFBFBD>ۿͻ<DBBF><CDBB><EFBFBD>ӡ',2,t_crm_client1,t_crm_client_link1,nil,nil,t_crm_client_linkman1,nil,nil,nil,nil,nil,nil);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton12Click(Sender: TObject);
|
|
|
begin
|
|
|
if bsSkinButton12.Caption='<27>ͻ<EFBFBD>չ<EFBFBD><D5B9>' then
|
|
|
begin
|
|
|
dxdbgrid1.FullExpand;
|
|
|
bsSkinButton12.Caption:='<27>ͻ<EFBFBD><CDBB>ϲ<EFBFBD>';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
dxdbgrid1.FullCollapse;
|
|
|
bsSkinButton12.Caption:='<27>ͻ<EFBFBD>չ<EFBFBD><D5B9>';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton10Click(Sender: TObject);
|
|
|
begin
|
|
|
query_client(2,'no');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton8Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client.FieldByName('<27>ͻ<EFBFBD>״̬').asstring<>'<27><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>'then
|
|
|
begin
|
|
|
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
try
|
|
|
frm_crm_client_check_do:=tfrm_crm_client_check_do.Create (self);
|
|
|
frm_crm_client_check_do.ShowModal;
|
|
|
finally
|
|
|
frm_crm_client_check_do.Free;
|
|
|
frm_crm_client_check_do:=nil;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.Panel2Resize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
i:=round(Panel2.width/14);
|
|
|
bsSkinButton9.width:=i;
|
|
|
bsSkinButton12.width:=i;
|
|
|
bsSkinButton10.width:=i;
|
|
|
bsSkinButton8.width:=i;
|
|
|
bsSkinButton1.width:=i;
|
|
|
bsSkinButton2.width:=i;
|
|
|
bsSkinButton3.width:=i;
|
|
|
bsSkinButton4.width:=i;
|
|
|
bsSkinButton6.width:=i;
|
|
|
bsSkinButton7.width:=i;
|
|
|
bsSkinButton29.width:=i;
|
|
|
bsSkinButton17.width:=i;
|
|
|
bsSkinButton21.width:=i;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton1Click(Sender: TObject);
|
|
|
var
|
|
|
i,j:integer;
|
|
|
str:widestring;
|
|
|
begin
|
|
|
try
|
|
|
i:=strtoint(get_parameters_value(9,'3'));
|
|
|
j:=strtoint(get_parameters_value(10,'3'));
|
|
|
p_client_state.Parameters.ParamByName('d1').value:=date-j*30;
|
|
|
p_client_state.Open;
|
|
|
if not ASSIGNED(frm_sys_progress) then
|
|
|
frm_sys_progress:=tfrm_sys_progress.Create(self);
|
|
|
frm_sys_progress.Show;
|
|
|
frm_sys_progress.bsSkinGauge1.MaxValue:=(p_client_state.RecordCount+3);
|
|
|
frm_sys_progress.bsSkinGauge1.MinValue:=0;
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=0;
|
|
|
frm_sys_progress.Update;
|
|
|
|
|
|
frm_data_share.t_code_price.Requery();
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
|
|
|
|
|
|
p_client_liushi.Parameters.ParamByName('d1').value:=date-i*30;
|
|
|
p_client_liushi.ExecProc;
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
|
|
|
|
|
|
p_client_state.first;
|
|
|
while not p_client_state.eof do
|
|
|
begin
|
|
|
str:=frm_crm_client_check.get_client_state(p_client_state.fieldbyname('ë<><C3AB><EFBFBD><EFBFBD>').asfloat/j);
|
|
|
str:='update t_crm_client set <20>ͻ<EFBFBD><CDBB><EFBFBD>ֵ='+''''+str+''''+' where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='
|
|
|
+''''+p_client_state.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring+'''';
|
|
|
p_update.Parameters.ParamByName('SQLStr').value:=str;
|
|
|
p_update.ExecProc;
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
|
|
|
p_client_state.next;
|
|
|
end;
|
|
|
finally
|
|
|
frm_data_share.t_crm_client.requery;
|
|
|
t_crm_client.requery;
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.MaxValue;
|
|
|
frm_sys_progress.free;
|
|
|
frm_sys_progress:=nil;
|
|
|
showmessage('<27>ͻ<EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort(Column,t_crm_client,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton2Click(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> in ('+''''+'Ŀ<><C4BF>'+''''+')');
|
|
|
t_crm_client.SQL.Add(' and <20>ͻ<EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>'+''''+','+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+')'
|
|
|
+' order by <20>ͻ<EFBFBD>״̬,<2C>ͻ<EFBFBD><CDBB><EFBFBD>ֵ,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_crm_client.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if (t_crm_client.FieldByName('<27>ͻ<EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>')or
|
|
|
(t_crm_client.FieldByName('<27>ͻ<EFBFBD>״̬').asstring='Ŀ<><C4BF><EFBFBD>ͻ<EFBFBD>')then
|
|
|
begin
|
|
|
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD>״̬<D7B4><CCAC><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
t_crm_client.edit;
|
|
|
t_crm_client['<27>ͻ<EFBFBD>״̬']:='<27><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>';
|
|
|
t_crm_client.post;
|
|
|
// SendMsg_gonggao('54','');
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if (t_crm_client.FieldByName('<27>ͻ<EFBFBD>״̬').asstring<>'<27><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>')then
|
|
|
begin
|
|
|
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD>״̬<D7B4><CCAC><EFBFBD>ָܻ<DCBB><D6B8>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
t_crm_client.edit;
|
|
|
t_crm_client['<27>ͻ<EFBFBD>״̬']:='<27><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>';
|
|
|
t_crm_client.post;
|
|
|
// SendMsg_gonggao('54','');
|
|
|
showmessage('<27>ָ<EFBFBD><D6B8>ͻ<EFBFBD><CDBB>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client.FieldByName('<27>ͻ<EFBFBD>״̬').asstring<>'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'then
|
|
|
begin
|
|
|
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD>״̬<D7B4><CCAC><EFBFBD>ܸ<EFBFBD><DCB8><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
try
|
|
|
t_crm_client.edit;
|
|
|
t_crm_client['<27>ͻ<EFBFBD>״̬']:='<27><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>';
|
|
|
t_crm_client['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:='ϵͳ';
|
|
|
t_crm_client.post;
|
|
|
{
|
|
|
Send_invocie_check_check('<27>ͻ<EFBFBD>ת<EFBFBD><D7AA>ͨ<EFBFBD><CDA8>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>:'+t_crm_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,
|
|
|
t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'46');
|
|
|
Send_invocie_check_check('<27>ͻ<EFBFBD>ת<EFBFBD><D7AA>ͨ<EFBFBD><CDA8>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>:'+t_crm_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,
|
|
|
t_crm_client.FieldByName('¼<><C2BC><EFBFBD><EFBFBD>').asstring,'46');
|
|
|
}
|
|
|
SendMsg_gonggao('53','<27>¿ͻ<C2BF>:'+t_crm_client['<27><><EFBFBD><EFBFBD>']+','+t_crm_client['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']);
|
|
|
|
|
|
except
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton7Click(Sender: TObject);
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
mail,str:String;
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if (t_crm_client.FieldByName('<27>ͻ<EFBFBD>״̬').asstring<>'<27><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>')
|
|
|
and (t_crm_client.FieldByName('<27>ͻ<EFBFBD>״̬').asstring<>'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>')then
|
|
|
begin
|
|
|
showmessage('<27><>ǰ<EFBFBD>ͻ<EFBFBD><CDBB>Ѿ<EFBFBD><D1BE><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܲ<EFBFBD><DCB2>أ<EFBFBD><D8A3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
try
|
|
|
t_crm_client.edit;
|
|
|
t_crm_client['<27>ͻ<EFBFBD>״̬']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
t_crm_client.post;
|
|
|
{
|
|
|
Send_invocie_check_check('<27><><EFBFBD>ؿͻ<D8BF>ת<EFBFBD><D7AA>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>:'+t_crm_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,
|
|
|
t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'47');
|
|
|
Send_invocie_check_check('<27><><EFBFBD>ؿͻ<D8BF>ת<EFBFBD><D7AA>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>:'+t_crm_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,
|
|
|
t_crm_client.FieldByName('¼<><C2BC><EFBFBD><EFBFBD>').asstring,'47');
|
|
|
}
|
|
|
except
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
frmreturncust:=Tfrmreturncust.Create(self);
|
|
|
try
|
|
|
frmreturncust.ShowModal;
|
|
|
if frmreturncust.ModalResult=mrOk then begin
|
|
|
str:=frmreturncust.Memo1.Lines.CommaText;
|
|
|
t_crm_client.edit;
|
|
|
t_crm_client['<27><>ע']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '+str;
|
|
|
t_crm_client.post;
|
|
|
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(frmreturncust);
|
|
|
end;
|
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
aQuery.Close;
|
|
|
aQuery.SQL.Clear;
|
|
|
aQuery.SQL.Add('Select * from t_sys_awoke where <20><><EFBFBD><EFBFBD>״̬=''<><D7BC>ִ<EFBFBD><D6B4>'' AND <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27>¿ͻ<C2BF><CDBB><EFBFBD><EFBFBD><EFBFBD>'' AND <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><='''+FormatDateTime('YYYY-MM-DD',NOW)+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+FormatDateTime('YYYY-MM-DD',NOW)+'''');
|
|
|
aQuery.Open;
|
|
|
if not aQuery.IsEmpty then begin
|
|
|
mail:=GetEmail(Trim(t_crm_client['¼<><C2BC><EFBFBD><EFBFBD>']));
|
|
|
if mail<>'' then begin
|
|
|
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
|
|
|
|
|
|
// SMTP1.AuthenticationType := atLogin;
|
|
|
SMTP1.username:= frm_data_share.t_sys_company.FieldByName('<27><>¼<EFBFBD>û<EFBFBD><C3BB><EFBFBD>').AsString;
|
|
|
SMTP1.Password :=frm_data_share.t_sys_company.FieldByName('<27><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
|
SMTP1.Host :=frm_data_share.t_sys_company.FieldByName('SMTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ').AsString;
|
|
|
SMTP1.Port :=Strtointdef(Trim(frm_data_share.t_sys_company.FieldByName('SMTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>').AsString),25);
|
|
|
try
|
|
|
SMTP1.Connect;
|
|
|
except
|
|
|
Showmessage('<27><><EFBFBD><EFBFBD>SMTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!');
|
|
|
Exit;
|
|
|
end;
|
|
|
try
|
|
|
with IdMsg do
|
|
|
begin
|
|
|
body.Clear;
|
|
|
Body.Text :='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>:'+t_crm_client['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<2E><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>:'+str;
|
|
|
From.address :=frm_data_share.t_sys_company.FieldByName('SMTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
Recipients.EMailAddresses :=mail;
|
|
|
Subject:='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>:'+t_crm_client['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
SMTP1.Send(IdMsg);
|
|
|
finally
|
|
|
// showmessage(t_sys_awoke_emp.FieldByName('<27><>Ա').asstring+'<27><><EFBFBD>ż<EFBFBD><C5BC>ѳɹ<D1B3><C9B9><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
SMTP1.Disconnect;
|
|
|
end;
|
|
|
|
|
|
|
|
|
{
|
|
|
NMSMTP1.Host:=frm_data_share.t_sys_company.FieldByName('SMTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ').AsString;
|
|
|
NMSMTP1.Port:=Strtointdef(Trim(frm_data_share.t_sys_company.FieldByName('SMTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>').AsString),25);
|
|
|
if NMSMTP1.Connected then
|
|
|
begin
|
|
|
NMSMTP1.Disconnect;
|
|
|
end;
|
|
|
NMSMTP1.Connect;
|
|
|
NMSMTP1.PostMessage.FromAddress :=frm_data_share.t_sys_company.FieldByName('SMTP<54><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
NMSMTP1.PostMessage.FromName :='<27>ʼ<EFBFBD><CABC>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
NMSMTP1.PostMessage.ToAddress.Text :=mail;
|
|
|
NMSMTP1.PostMessage.Body.Text :='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>:'+t_crm_client['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
NMSMTP1.PostMessage.Subject :='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>:'+t_crm_client['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
NMSMTP1.SendMail;
|
|
|
}
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton13Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_sales.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
t_crm_client_sales.Edit;
|
|
|
t_crm_client_sales.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_sales.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton11Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_sales.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
t_crm_client_sales.Edit;
|
|
|
t_crm_client_sales.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_sales.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.NMSMTP1Connect(Sender: TObject);
|
|
|
var
|
|
|
StrUserName,strPassword:String;
|
|
|
begin
|
|
|
{
|
|
|
strUserName:=EncodeString(frm_data_share.t_sys_company.FieldByName('<27><>¼<EFBFBD>û<EFBFBD><C3BB><EFBFBD>').AsString);
|
|
|
strPassword:=EncodeString(frm_data_share.t_sys_company.FieldByName('<27><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>').AsString);
|
|
|
nmsmtp1.Transaction('EHLO') ;
|
|
|
nmsmtp1.Transaction('AUTH LOGIN');
|
|
|
nmsmtp1.Transaction(strUserName);
|
|
|
nmsmtp1.Transaction(strPassword);
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton14Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_sales.IsEmpty then
|
|
|
exit;
|
|
|
bsSkinGroupBox9.Visible:=true;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton15Click(Sender: TObject);
|
|
|
begin
|
|
|
t_crm_client_sales.Edit;
|
|
|
t_crm_client_sales.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_sales.FieldByName('<27><>ע').AsString:=Memo1.Lines.CommaText;
|
|
|
t_crm_client_sales.Post;
|
|
|
bsSkinGroupBox9.Visible:=false;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton16Click(Sender: TObject);
|
|
|
begin
|
|
|
bsSkinGroupBox9.Visible:=false;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton17Click(Sender: TObject);
|
|
|
begin
|
|
|
t_crm_client.SQL.clear;
|
|
|
t_crm_client.sql.add('select * from t_crm_client where (<28>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in ('+''''+'Ŀ<><C4BF>'+''''+','+''''+'ϵͳ'+''''+')');
|
|
|
t_crm_client.sql.add(' or ί<>е<EFBFBD>λ=1)');
|
|
|
t_crm_client.SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in (select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_crm_client_sales where ״̬ in ('+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+'))');
|
|
|
t_crm_client.SQL.Add(' order by <20>ͻ<EFBFBD>״̬,<2C>ͻ<EFBFBD><CDBB><EFBFBD>ֵ,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_crm_client.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton21Click(Sender: TObject);
|
|
|
begin
|
|
|
t_crm_client.SQL.clear;
|
|
|
t_crm_client.sql.add('select * from t_crm_client where (<28>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in ('+''''+'Ŀ<><C4BF>'+''''+','+''''+'ϵͳ'+''''+')');
|
|
|
t_crm_client.sql.add(' or ί<>е<EFBFBD>λ=1)');
|
|
|
t_crm_client.SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in (select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_crm_client_ty where ״̬ in ('+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+'))');
|
|
|
t_crm_client.SQL.Add(' order by <20>ͻ<EFBFBD>״̬,<2C>ͻ<EFBFBD><CDBB><EFBFBD>ֵ,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_crm_client.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton18Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_ty.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
t_crm_client_ty.Edit;
|
|
|
t_crm_client_ty.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>';
|
|
|
t_crm_client_ty['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=employee;
|
|
|
t_crm_client_ty['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
|
|
|
t_crm_client_ty.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton19Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_ty.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
t_crm_client_ty.Edit;
|
|
|
t_crm_client_ty['״̬']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_ty['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
|
|
|
t_crm_client_ty['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=null;
|
|
|
t_crm_client_ty.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton20Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_tmpacc.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
if MessageDlg('<27>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)<>mrYes then
|
|
|
begin
|
|
|
t_crm_client_tmpacc.Edit;
|
|
|
t_crm_client_tmpacc.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_tmpacc.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
t_crm_client_tmpacc.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=date;
|
|
|
t_crm_client_tmpacc.Post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_crm_client_tmpacc.Edit;
|
|
|
t_crm_client_tmpacc.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_tmpacc.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
t_crm_client_tmpacc.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=date;
|
|
|
t_crm_client_tmpacc.Post;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton32Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_tmpacc.IsEmpty then
|
|
|
exit;
|
|
|
try
|
|
|
if trim(t_crm_client_tmpacc.FieldByName('״̬').AsString)='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|
|
begin
|
|
|
t_crm_client_tmpacc.Edit;
|
|
|
t_crm_client_tmpacc.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_tmpacc.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
t_crm_client_tmpacc.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=date;
|
|
|
t_crm_client_tmpacc.Post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
showmessage('ֻ<>д<EFBFBD><D0B4><EFBFBD><EFBFBD>˵IJſ<C4B2><C5BF>Ը<EFBFBD><D4B8><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
except
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
/// showmessage('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton22Click(Sender: TObject);
|
|
|
var str:string;
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_tmpacc.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrYes then
|
|
|
begin
|
|
|
str:=trim(InputBox('<27><><EFBFBD><EFBFBD><EFBFBD>벵<EFBFBD><EBB2B5>ԭ<EFBFBD><D4AD>', '<27><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>', ''));
|
|
|
if str=''then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
t_crm_client_tmpacc.edit;
|
|
|
t_crm_client_tmpacc['<27><>ע']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+str;
|
|
|
t_crm_client_tmpacc.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_tmpacc.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='';
|
|
|
t_crm_client_tmpacc.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value:=null;
|
|
|
t_crm_client_tmpacc.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='';
|
|
|
t_crm_client_tmpacc.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value:=null;
|
|
|
t_crm_client_tmpacc.post;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton29Click(Sender: TObject);
|
|
|
var
|
|
|
Pnt:Tpoint;
|
|
|
begin
|
|
|
Pnt:=bsSkinButton29.ClientToScreen(Point(0,bsSkinButton29.Height));
|
|
|
PopupMenu3.Popup(Pnt.x,Pnt.y);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.N8Click(Sender: TObject);
|
|
|
begin
|
|
|
t_crm_client.SQL.clear;
|
|
|
t_crm_client.sql.add('select * from t_crm_client where ');
|
|
|
t_crm_client.sql.add(' ί<>е<EFBFBD>λ=1');
|
|
|
t_crm_client.SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in (select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_crm_client_tmpacc where ״̬ in ('+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+'))');
|
|
|
t_crm_client.SQL.Add(' order by <20>ͻ<EFBFBD>״̬,<2C>ͻ<EFBFBD><CDBB><EFBFBD>ֵ,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_crm_client.open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.N17Click(Sender: TObject);
|
|
|
begin
|
|
|
t_crm_client.SQL.clear;
|
|
|
t_crm_client.sql.add('select * from t_crm_client where ');
|
|
|
t_crm_client.sql.add(' ί<>е<EFBFBD>λ=1');
|
|
|
t_crm_client.SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in (select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_crm_client_limitamt where ״̬ in ('+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+'))');
|
|
|
t_crm_client.SQL.Add(' order by <20>ͻ<EFBFBD>״̬,<2C>ͻ<EFBFBD><CDBB><EFBFBD>ֵ,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_crm_client.open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.N2Click(Sender: TObject);
|
|
|
begin
|
|
|
t_crm_client.SQL.clear;
|
|
|
t_crm_client.sql.add('select * from t_crm_client where ');
|
|
|
t_crm_client.sql.add(' ί<>е<EFBFBD>λ=1');
|
|
|
t_crm_client.SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in (select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_crm_client_unlock where ״̬ in ('+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+'))');
|
|
|
t_crm_client.SQL.Add(' order by <20>ͻ<EFBFBD>״̬,<2C>ͻ<EFBFBD><CDBB><EFBFBD>ֵ,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_crm_client.open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton23Click(Sender: TObject);
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_limitamt.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
if MessageDlg('<27>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>!!!',mtWarning,[mbYes,mbNo],0)<>mrYes then
|
|
|
begin
|
|
|
t_crm_client_limitamt.Edit;
|
|
|
t_crm_client_limitamt.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_limitamt.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
t_crm_client_limitamt.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=date;
|
|
|
t_crm_client_limitamt.Post;
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
close;sql.Clear;
|
|
|
sql.Add('Update t_crm_client_sales set <20><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>=:<3A><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>');
|
|
|
sql.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=:<3A>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
Parameters.ParamByName('<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>').Value:=t_crm_client_limitamt.FieldByName('<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>').AsString;
|
|
|
Parameters.ParamByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=t_crm_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
ExecSQL;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_crm_client_limitamt.Edit;
|
|
|
t_crm_client_limitamt.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_limitamt.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
t_crm_client_limitamt.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=date;
|
|
|
t_crm_client_limitamt.Post;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton24Click(Sender: TObject);
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_limitamt.IsEmpty then
|
|
|
exit;
|
|
|
try
|
|
|
if trim(t_crm_client_limitamt.FieldByName('״̬').AsString)='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|
|
begin
|
|
|
t_crm_client_limitamt.Edit;
|
|
|
t_crm_client_limitamt.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_limitamt.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
t_crm_client_limitamt.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=date;
|
|
|
t_crm_client_limitamt.Post;
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
close;sql.Clear;
|
|
|
sql.Add('Update t_crm_client_sales set <20><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>=:<3A><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>');
|
|
|
sql.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=:<3A>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
Parameters.ParamByName('<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>').Value:=t_crm_client_limitamt.FieldByName('<27><><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD>').AsString;
|
|
|
Parameters.ParamByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=t_crm_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
ExecSQL;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
showmessage('ֻ<>д<EFBFBD><D0B4><EFBFBD><EFBFBD>˵IJſ<C4B2><C5BF>Ը<EFBFBD><D4B8><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
except
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton25Click(Sender: TObject);
|
|
|
var str:string;
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_limitamt.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrYes then
|
|
|
begin
|
|
|
str:=trim(InputBox('<27><><EFBFBD><EFBFBD><EFBFBD>벵<EFBFBD><EBB2B5>ԭ<EFBFBD><D4AD>', '<27><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>', ''));
|
|
|
if str=''then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
t_crm_client_limitamt.edit;
|
|
|
t_crm_client_limitamt['<27><>ע']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+str;
|
|
|
t_crm_client_limitamt.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_limitamt.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='';
|
|
|
t_crm_client_limitamt.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value:=null;
|
|
|
t_crm_client_limitamt.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='';
|
|
|
t_crm_client_limitamt.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value:=null;
|
|
|
t_crm_client_limitamt.post;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton26Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_unlock.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
if MessageDlg('<27>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)<>mrYes then
|
|
|
begin
|
|
|
t_crm_client_unlock.Edit;
|
|
|
t_crm_client_unlock.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_unlock.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
t_crm_client_unlock.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=date;
|
|
|
t_crm_client_unlock.Post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_crm_client_unlock.Edit;
|
|
|
t_crm_client_unlock.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_unlock.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
t_crm_client_unlock.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=date;
|
|
|
t_crm_client_unlock.Post;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton27Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_unlock.IsEmpty then
|
|
|
exit;
|
|
|
try
|
|
|
if trim(t_crm_client_unlock.FieldByName('״̬').AsString)='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|
|
begin
|
|
|
t_crm_client_unlock.Edit;
|
|
|
t_crm_client_unlock.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_unlock.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
t_crm_client_unlock.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=date;
|
|
|
t_crm_client_unlock.Post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
showmessage('ֻ<>д<EFBFBD><D0B4><EFBFBD><EFBFBD>˵IJſ<C4B2><C5BF>Ը<EFBFBD><D4B8><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
except
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
/// showmessage('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton28Click(Sender: TObject);
|
|
|
var str:string;
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_unlock.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrYes then
|
|
|
begin
|
|
|
str:=trim(InputBox('<27><><EFBFBD><EFBFBD><EFBFBD>벵<EFBFBD><EBB2B5>ԭ<EFBFBD><D4AD>', '<27><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>', ''));
|
|
|
if str=''then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
t_crm_client_unlock.edit;
|
|
|
t_crm_client_unlock['<27><>ע']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+str;
|
|
|
t_crm_client_unlock.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_unlock.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='';
|
|
|
t_crm_client_unlock.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value:=null;
|
|
|
t_crm_client_unlock.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='';
|
|
|
t_crm_client_unlock.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value:=null;
|
|
|
t_crm_client_unlock.post;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton30Click(Sender: TObject);
|
|
|
begin
|
|
|
t_crm_client.SQL.clear;
|
|
|
t_crm_client.sql.add('select * from t_crm_client where (<28>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in ('+''''+'Ŀ<><C4BF>'+''''+','+''''+'ϵͳ'+''''+')');
|
|
|
t_crm_client.sql.add(' or ί<>е<EFBFBD>λ=1)');
|
|
|
t_crm_client.SQL.Add(' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in (select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_crm_client_class where ״̬ in ('+''''+'<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+'))');
|
|
|
t_crm_client.SQL.Add(' order by <20>ͻ<EFBFBD>״̬,<2C>ͻ<EFBFBD><CDBB><EFBFBD>ֵ,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_crm_client.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton31Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_class.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
t_crm_client_class.Edit;
|
|
|
t_crm_client_class.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_class.Post;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.bsSkinButton33Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_crm_client.IsEmpty then
|
|
|
exit;
|
|
|
if t_crm_client_class.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
t_crm_client_class.Edit;
|
|
|
t_crm_client_class.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
t_crm_client_class.Post;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_crm_client_check.t_crm_client_classBeforeDelete(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
Abort;
|
|
|
end;
|
|
|
|
|
|
end.
|