unit u_info_price_person_view; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, dxExEdtr, DB, ADODB, StdCtrls, ComCtrls, DBCtrls, bsSkinCtrls, wwdblook, RxLookup, Mask, wwdbedit, Wwdotdot, Wwdbcomb, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxDBGrid, dxCntner, ExtCtrls, BusinessSkinForm, wwdbdatetimepicker; type Tfrm_info_price_person_view = class(TForm) t_price_prerson: TADOQuery; t_price_prerson1: TDataSource; bsBusinessSkinForm1: TbsBusinessSkinForm; Panel1: TPanel; bsSkinButton2: TbsSkinButton; bsSkinButton4: TbsSkinButton; bsSkinButton8: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton3: TbsSkinButton; Panel2: TPanel; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; bsSkinPanel1: TbsSkinPanel; bsSkinPanel2: TbsSkinPanel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; wwDBComboBox1: TwwDBComboBox; RxDBLookupCombo2: TRxDBLookupCombo; wwDBLookupCombo52: TwwDBLookupCombo; bsSkinGroupBox1: TbsSkinGroupBox; DBRichEdit1: TDBRichEdit; wwDBDateTimePicker1: TwwDBDateTimePicker; dxDBGrid1Column4: TdxDBGridColumn; dxDBGrid1Column5: TdxDBGridColumn; dxDBGrid1Column6: TdxDBGridColumn; procedure t_price_prersonAfterInsert(DataSet: TDataSet); procedure t_price_prersonBeforePost(DataSet: TDataSet); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton11Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure t_price_prersonBeforeEdit(DataSet: TDataSet); private { Private declarations } public { Public declarations } end; var frm_info_price_person_view: Tfrm_info_price_person_view; implementation uses u_main, my_sys_function; {$R *.dfm} procedure Tfrm_info_price_person_view.t_price_prersonAfterInsert( DataSet: TDataSet); begin t_price_prerson['录入人']:=employee; t_price_prerson['录入日期']:=date; end; procedure Tfrm_info_price_person_view.t_price_prersonBeforePost( DataSet: TDataSet); begin table_before_post(t_price_prerson,'收付类别'); table_before_post(t_price_prerson,'客户名称'); table_before_post(t_price_prerson,'运价说明'); end; procedure Tfrm_info_price_person_view.bsSkinButton9Click(Sender: TObject); begin close; end; procedure Tfrm_info_price_person_view.bsSkinButton2Click(Sender: TObject); begin t_price_prerson.insert; end; procedure Tfrm_info_price_person_view.bsSkinButton11Click(Sender: TObject); begin table_post(t_price_prerson); end; procedure Tfrm_info_price_person_view.bsSkinButton8Click(Sender: TObject); begin table_cancel(t_price_prerson); end; procedure Tfrm_info_price_person_view.bsSkinButton4Click(Sender: TObject); begin table_delete(t_price_prerson); end; procedure Tfrm_info_price_person_view.bsSkinButton3Click(Sender: TObject); var afield : variant; i: Integer; begin if t_price_prerson.IsEmpty then begin showmessage('没有复制母体,不能复制新建!'); exit; end; afield := vararraycreate([0,t_price_prerson.fieldcount-1],varvariant); for i := 1 to (t_price_prerson.fieldcount-1) do begin afield[i] :=t_price_prerson.fields[i].value ; end; t_price_prerson.append; for i := 1 to (t_price_prerson.fieldcount-1) do begin t_price_prerson.fields[i].value := afield[i] ; end; showmessage('复制成功!!'); end; procedure Tfrm_info_price_person_view.t_price_prersonBeforeEdit( DataSet: TDataSet); begin if not do_data('3008',t_price_prerson.fieldbyname('录入人').asstring ,'','','','','') then begin showmessage('对不起你无权修改数据!!'); abort; end; end; end.