|
|
unit u_info_render;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, DB, ADODB, dxExEdtr, bsSkinCtrls, ExtCtrls, StdCtrls, ComCtrls,
|
|
|
DBCtrls, Mask, dxDBGrid, dxTL, dxDBCtrl, dxCntner, dxDBTLCl, dxGrClms,
|
|
|
bsdbctrls, bsSkinTabs, RxLookup, wwdbdatetimepicker, wwdbedit, Wwdotdot,
|
|
|
Wwdbcomb;
|
|
|
|
|
|
type
|
|
|
Tfrm_info_render = class(TForm)
|
|
|
t_info_render: TADOQuery;
|
|
|
t_info_render1: TDataSource;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
Label1: TLabel;
|
|
|
Label2: TLabel;
|
|
|
DBEdit1: TDBEdit;
|
|
|
DBEdit2: TDBEdit;
|
|
|
Panel1: TPanel;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column4: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column5: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column6: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column7: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column8: TdxDBGridDateColumn;
|
|
|
Label3: TLabel;
|
|
|
DBEdit3: TDBEdit;
|
|
|
Label4: TLabel;
|
|
|
DBEdit4: TDBEdit;
|
|
|
Label5: TLabel;
|
|
|
DBEdit5: TDBEdit;
|
|
|
Label6: TLabel;
|
|
|
DBEdit6: TDBEdit;
|
|
|
Label7: TLabel;
|
|
|
DBEdit7: TDBEdit;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
bsSkinPageControl1: TbsSkinPageControl;
|
|
|
bsSkinTabSheet1: TbsSkinTabSheet;
|
|
|
bsSkinTabSheet2: TbsSkinTabSheet;
|
|
|
bsSkinGroupBox2: TbsSkinGroupBox;
|
|
|
DBRichEdit1: TDBRichEdit;
|
|
|
bsSkinGroupBox3: TbsSkinGroupBox;
|
|
|
DBRichEdit3: TDBRichEdit;
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
DBRichEdit2: TDBRichEdit;
|
|
|
t_crm_client_link: TADOQuery;
|
|
|
t_crm_client_link1: TDataSource;
|
|
|
dxDBGrid3: TdxDBGrid;
|
|
|
dxDBGrid3Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid3Column7: TdxDBGridMaskColumn;
|
|
|
dxDBGrid3Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid3Column3: TdxDBGridMaskColumn;
|
|
|
dxDBGrid3Column4: TdxDBGridMaskColumn;
|
|
|
dxDBGrid3Column5: TdxDBGridDateColumn;
|
|
|
dxDBGrid3Column6: TdxDBGridCurrencyColumn;
|
|
|
dxDBGrid3Column8: TdxDBGridMaskColumn;
|
|
|
dxDBGrid3Column9: TdxDBGridDateColumn;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
Label55: TLabel;
|
|
|
Label54: TLabel;
|
|
|
Label56: TLabel;
|
|
|
Label57: TLabel;
|
|
|
Label60: TLabel;
|
|
|
Label58: TLabel;
|
|
|
Label61: TLabel;
|
|
|
Label59: TLabel;
|
|
|
bsSkinButton14: TbsSkinButton;
|
|
|
bsSkinButton15: TbsSkinButton;
|
|
|
bsSkinButton16: TbsSkinButton;
|
|
|
bsSkinButton17: TbsSkinButton;
|
|
|
DBEdit46: TDBEdit;
|
|
|
wwDBComboBox3: TwwDBComboBox;
|
|
|
DBEdit47: TDBEdit;
|
|
|
wwDBDateTimePicker5: TwwDBDateTimePicker;
|
|
|
RxDBLookupCombo8: TRxDBLookupCombo;
|
|
|
DBEdit49: TDBEdit;
|
|
|
wwDBComboBox4: TwwDBComboBox;
|
|
|
DBMemo3: TDBMemo;
|
|
|
Label18: TLabel;
|
|
|
RxDBLookupCombo2: TRxDBLookupCombo;
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure t_info_renderAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_info_renderBeforePost(DataSet: TDataSet);
|
|
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
|
|
procedure FormResize(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
procedure dxDBGrid1Column1CustomDraw(Sender: TObject; ACanvas: TCanvas;
|
|
|
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn;
|
|
|
const AText: String; AFont: TFont; var AColor: TColor; ASelected,
|
|
|
AFocused: Boolean; var ADone: Boolean);
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
procedure t_info_renderBeforeEdit(DataSet: TDataSet);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure bsSkinButton14Click(Sender: TObject);
|
|
|
procedure bsSkinButton15Click(Sender: TObject);
|
|
|
procedure bsSkinButton16Click(Sender: TObject);
|
|
|
procedure bsSkinButton17Click(Sender: TObject);
|
|
|
procedure t_crm_client_linkAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_crm_client_linkBeforeInsert(DataSet: TDataSet);
|
|
|
procedure t_info_renderBeforeDelete(DataSet: TDataSet);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_info_render: Tfrm_info_render;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, u_info_render_query, my_sys_function;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_info_render.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
frm_info_render.Hide;
|
|
|
frm_info_render.ManualFloat(frm_info_render.BoundsRect );
|
|
|
frm_main.freeTabs('frm_info_render');
|
|
|
action:=cafree;
|
|
|
frm_info_render:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
t_info_render.Parameters[0].Value:=employee;
|
|
|
t_info_render.open;
|
|
|
t_crm_client_link.Open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton7Click(Sender: TObject);
|
|
|
begin
|
|
|
table_Prior(t_info_render);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
table_next(t_info_render);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_info_render);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
table_delete(t_info_render);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
table_cancel(t_info_render);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
t_info_render.insert;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.t_info_renderAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_info_render['<27>㱨<EFBFBD><E3B1A8><EFBFBD><EFBFBD>']:=date;
|
|
|
t_info_render['<27>㱨<EFBFBD><E3B1A8>']:=employee;
|
|
|
t_info_render['<27><><EFBFBD><EFBFBD>״̬']:='¼<><C2BC>״̬';
|
|
|
DBEdit1.SetFocus;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.t_info_renderBeforePost(DataSet: TDataSet);
|
|
|
begin
|
|
|
table_before_post(t_info_render,'<27>㱨<EFBFBD><E3B1A8>Ŀ');
|
|
|
table_before_post(t_info_render,'<27>㱨<EFBFBD><E3B1A8><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.FormCloseQuery(Sender: TObject;
|
|
|
var CanClose: Boolean);
|
|
|
begin
|
|
|
CanClose:=close_query(t_info_render);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.FormResize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
i:=round(panel1.Width/10);
|
|
|
bsSkinButton7.Width:=i;
|
|
|
bsSkinButton6.Width:=i;
|
|
|
bsSkinButton10.Width:=i;
|
|
|
bsSkinButton1.Width:=i;
|
|
|
bsSkinButton2.Width:=i;
|
|
|
bsSkinButton4.Width:=i;
|
|
|
bsSkinButton3.Width:=i;
|
|
|
bsSkinButton8.Width:=i;
|
|
|
bsSkinButton9.Width:=i;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton10Click(Sender: TObject);
|
|
|
begin
|
|
|
try
|
|
|
frm_info_render_query:=tfrm_info_render_query.Create (self);
|
|
|
frm_info_render_query.wwDBLookupCombo1.Text:=employee;
|
|
|
frm_info_render_query.wwDBLookupCombo1.ReadOnly:=true;
|
|
|
frm_info_render_query.Hint:='1';
|
|
|
frm_info_render_query.ShowModal;
|
|
|
finally
|
|
|
frm_info_render_query.Free;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.DBEdit1KeyPress(Sender: TObject; var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit2);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort(Column,t_info_render,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.dxDBGrid1Column1CustomDraw(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
|
|
|
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
|
|
|
begin
|
|
|
if ANode.Strings[dxDBGrid1Column1.Index]='¼<><C2BC>״̬' then
|
|
|
AColor:=clWhite;
|
|
|
if ANode.Strings[dxDBGrid1Column1.Index]='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>' then
|
|
|
AColor:=$0080FFFF;
|
|
|
if ANode.Strings[dxDBGrid1Column1.Index]='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
|
|
|
AColor:=$0000FF80;
|
|
|
if ANode.Strings[dxDBGrid1Column1.Index]='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
|
|
|
AColor:=clAqua;
|
|
|
AFont.Color:=clblack;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton8Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_info_render.IsEmpty then
|
|
|
exit;
|
|
|
if t_info_render.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring<>'¼<><C2BC>״̬' then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>浱ǰ״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD>ύ!!');
|
|
|
exit;
|
|
|
end;
|
|
|
try
|
|
|
t_info_render.Edit;
|
|
|
t_info_render['<27><><EFBFBD><EFBFBD>״̬']:='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>';
|
|
|
t_info_render.post;
|
|
|
finally
|
|
|
;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.t_info_renderBeforeEdit(DataSet: TDataSet);
|
|
|
begin
|
|
|
if not modify_all then
|
|
|
if (t_info_render.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>')
|
|
|
or (t_info_render.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>')
|
|
|
or (t_info_render.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>') then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>浱ǰ״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!!');
|
|
|
abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
sys_print('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ',2,t_info_render1,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton14Click(Sender: TObject);
|
|
|
begin
|
|
|
t_crm_client_link.Insert;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton15Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_crm_client_link);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton16Click(Sender: TObject);
|
|
|
begin
|
|
|
table_delete(t_crm_client_link);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.bsSkinButton17Click(Sender: TObject);
|
|
|
begin
|
|
|
table_Cancel(t_crm_client_link);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.t_crm_client_linkAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_crm_client_link['PD_ID']:=t_info_render['RD_ID'];
|
|
|
t_crm_client_link['<27>Ӵ<EFBFBD><D3B4><EFBFBD>']:=employee;
|
|
|
t_crm_client_link['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
|
|
|
t_crm_client_link['<27>Ӵ<EFBFBD><D3B4><EFBFBD><EFBFBD><EFBFBD>']:=Date;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.t_crm_client_linkBeforeInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_info_render.State in [dsinsert,dsedit] then t_info_render.post;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_render.t_info_renderBeforeDelete(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_crm_client_link.First;
|
|
|
while not t_crm_client_link.Eof do begin
|
|
|
t_crm_client_link.Delete;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end.
|