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.

325 lines
9.7 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_info_price_agreement;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, DB, ADODB, bsSkinCtrls, StdCtrls, ComCtrls, DBCtrls,
wwdbdatetimepicker, RxLookup, Mask, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl,
dxDBGrid, dxCntner, ExtCtrls;
type
Tfrm_info_price_agreement = class(TForm)
Notebook1: TNotebook;
dxDBGrid1: TdxDBGrid;
bsSkinPanel3: TbsSkinPanel;
t_price_agreement: TADOQuery;
t_price_agreement1: TDataSource;
Panel1: TPanel;
bsSkinButton7: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton8: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
dxDBGrid1Column3: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridDateColumn;
dxDBGrid1Column5: TdxDBGridDateColumn;
dxDBGrid1Column6: TdxDBGridDateColumn;
dxDBGrid1Column7: TdxDBGridMaskColumn;
dxDBGrid1Column8: TdxDBGridMaskColumn;
dxDBGrid1Column9: TdxDBGridMaskColumn;
dxDBGrid1Column10: TdxDBGridDateColumn;
bsSkinPanel1: TbsSkinPanel;
Label1: TLabel;
DBEdit1: TDBEdit;
Label9: TLabel;
RxDBLookupCombo4: TRxDBLookupCombo;
Label21: TLabel;
RxDBLookupCombo20: TRxDBLookupCombo;
Label10: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBDateTimePicker3: TwwDBDateTimePicker;
Label6: TLabel;
wwDBDateTimePicker2: TwwDBDateTimePicker;
Label2: TLabel;
RxDBLookupCombo3: TRxDBLookupCombo;
Label14: TLabel;
DBEdit2: TDBEdit;
Label5: TLabel;
bsSkinGroupBox1: TbsSkinGroupBox;
DBRichEdit1: TDBRichEdit;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton7Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure t_price_agreementAfterInsert(DataSet: TDataSet);
procedure t_price_agreementBeforePost(DataSet: TDataSet);
procedure FormShow(Sender: TObject);
procedure Panel1Resize(Sender: TObject);
procedure dxDBGrid1CustomDrawCell(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn;
ASelected, AFocused, ANewItemRow: Boolean; var AText: String;
var AColor: TColor; AFont: TFont; var AAlignment: TAlignment;
var ADone: Boolean);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure t_price_agreementBeforeEdit(DataSet: TDataSet);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo4KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo20KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit2KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo3KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker3KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_info_price_agreement: Tfrm_info_price_agreement;
implementation
uses u_main, my_sys_function, u_info_price_agreement_query, u_data_share;
{$R *.dfm}
procedure Tfrm_info_price_agreement.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_info_price_agreement.Hide;
frm_info_price_agreement.ManualFloat(frm_info_price_agreement.BoundsRect );
frm_main.freeTabs('frm_info_price_agreement');
action:=cafree;
frm_info_price_agreement:=nil;
end;
procedure Tfrm_info_price_agreement.bsSkinButton7Click(Sender: TObject);
begin
table_Prior(t_price_agreement);
end;
procedure Tfrm_info_price_agreement.bsSkinButton6Click(Sender: TObject);
begin
table_next(t_price_agreement);
end;
procedure Tfrm_info_price_agreement.bsSkinButton11Click(Sender: TObject);
begin
table_post(t_price_agreement);
end;
procedure Tfrm_info_price_agreement.bsSkinButton8Click(Sender: TObject);
begin
table_cancel(t_price_agreement);
end;
procedure Tfrm_info_price_agreement.bsSkinButton4Click(Sender: TObject);
begin
table_delete(t_price_agreement);
end;
procedure Tfrm_info_price_agreement.bsSkinButton10Click(Sender: TObject);
var
answer:TModalResult;
begin
if bsSkinButton10.Caption='<27><EFBFBD>޸<EFBFBD>' then
begin
Notebook1.PageIndex:=1;
bsSkinButton10.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
end
else
begin
if (t_price_agreement.State=dsinsert)or(t_price_agreement.State=dsedit) then
BEGIN
answer:=messagedlg( '<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>޸ģ<DEB8><C4A3>Ƿ񱣴棿',mtWarning,mbYesNoCancel,0);
if answer=mrYes then
begin
t_price_agreement.post;
end;
if answer=mrNo then
begin
t_price_agreement.cancel;
end;
if answer=mrCancel then
begin
exit;
end;
END;
Notebook1.PageIndex:=0;
bsSkinButton10.Caption:='<27><EFBFBD>޸<EFBFBD>';
end;
end;
procedure Tfrm_info_price_agreement.bsSkinButton9Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_info_price_agreement.bsSkinButton2Click(Sender: TObject);
begin
t_price_agreement.insert;
Notebook1.PageIndex:=1;
bsSkinButton10.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
end;
procedure Tfrm_info_price_agreement.t_price_agreementAfterInsert(
DataSet: TDataSet);
begin
t_price_agreement['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_price_agreement['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
t_price_agreement['ǩԼʱ<D4BC><CAB1>']:=date;
t_price_agreement['<27><>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>']:=date;
end;
procedure Tfrm_info_price_agreement.t_price_agreementBeforePost(
DataSet: TDataSet);
begin
table_before_post(t_price_agreement,'<27><>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>');
table_before_post(t_price_agreement,'ǩԼʱ<D4BC><CAB1>');
table_before_post(t_price_agreement,'<27><><EFBFBD><EFBFBD>˾');
table_before_post(t_price_agreement,'<27><>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>');
table_before_post(t_price_agreement,'<27><>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>');
table_before_post(t_price_agreement,'<27><>Լ<EFBFBD><D4BC>');
table_before_post(t_price_agreement,'ǩԼ<C7A9><D4BC>');
table_before_post(t_price_agreement,'ǩԼ<C7A9><D4BC><EFBFBD><EFBFBD>');
end;
procedure Tfrm_info_price_agreement.FormShow(Sender: TObject);
begin
t_price_agreement.sql.Clear;
t_price_agreement.sql.add('SELECT * FROM t_price_agreement where <20><>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>>=getdate()');
// t_price_agreement.sql.add(' and '+open_data('3002','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no'));
t_price_agreement.sql.add(' order by <20><>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>');
t_price_agreement.open;
frm_data_share.t_crm_client_ship.requery;
end;
procedure Tfrm_info_price_agreement.Panel1Resize(Sender: TObject);
var
i:integer;
begin
i:=round(Panel1.Width/10);
bsSkinButton5.Width:=i;
bsSkinButton7.Width:=i;
bsSkinButton6.Width:=i;
bsSkinButton2.Width:=i;
bsSkinButton10.Width:=i;
bsSkinButton11.Width:=i;
bsSkinButton4.Width:=i;
bsSkinButton8.Width:=i;
bsSkinButton1.Width:=i;
end;
procedure Tfrm_info_price_agreement.dxDBGrid1CustomDrawCell(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
var AText: String; var AColor: TColor; AFont: TFont;
var AAlignment: TAlignment; var ADone: Boolean);
begin
if strtodatetime(ANode.Strings[dxDBGrid1Column5.Index])<date then
AColor:=clBtnFace;
end;
procedure Tfrm_info_price_agreement.bsSkinButton5Click(Sender: TObject);
begin
sys_print('<27>˼ۺ<CBBC>Լ<EFBFBD><D4BC>ӡ',2,t_price_agreement1,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_info_price_agreement.bsSkinButton1Click(Sender: TObject);
begin
try
frm_info_price_agreement_query:=tfrm_info_price_agreement_query.Create (self);
frm_info_price_agreement_query.ShowModal;
finally
frm_info_price_agreement_query.Free;
end;
end;
procedure Tfrm_info_price_agreement.t_price_agreementBeforeEdit(
DataSet: TDataSet);
begin
{ if do_data('3002',t_price_agreement.fieldbyname('¼<><C2BC><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_info_price_agreement.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose:=frm_close_query(t_price_agreement);
end;
procedure Tfrm_info_price_agreement.DBEdit1KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo4);
end;
procedure Tfrm_info_price_agreement.RxDBLookupCombo4KeyPress(
Sender: TObject; var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo20);
end;
procedure Tfrm_info_price_agreement.RxDBLookupCombo20KeyPress(
Sender: TObject; var Key: Char);
begin
key_wwDBDateTimePicker(Key,wwDBDateTimePicker1);
end;
procedure Tfrm_info_price_agreement.wwDBDateTimePicker1KeyPress(
Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit2);
end;
procedure Tfrm_info_price_agreement.DBEdit2KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo3);
end;
procedure Tfrm_info_price_agreement.RxDBLookupCombo3KeyPress(
Sender: TObject; var Key: Char);
begin
key_wwDBDateTimePicker(Key,wwDBDateTimePicker2);
end;
procedure Tfrm_info_price_agreement.wwDBDateTimePicker2KeyPress(
Sender: TObject; var Key: Char);
begin
key_wwDBDateTimePicker(Key,wwDBDateTimePicker3);
end;
procedure Tfrm_info_price_agreement.wwDBDateTimePicker3KeyPress(
Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
DBRichEdit1.SetFocus;
end;
end;
end.