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.

291 lines
7.9 KiB
Plaintext

unit u_info_card;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, ExtCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl,
dxDBGrid, DB, ADODB, StdCtrls, DBCtrls, wwdbdatetimepicker, wwdbedit,
Wwdotdot, Wwdbcomb, Mask, RxLookup;
type
Tfrm_info_card = class(TForm)
Panel1: TPanel;
bsSkinButton7: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinPanel1: TbsSkinPanel;
dxDBGrid1: TdxDBGrid;
t_info_card: TADOQuery;
t_info_card1: TDataSource;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
dxDBGrid1Column3: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridMaskColumn;
bsSkinPanel2: TbsSkinPanel;
Label36: TLabel;
DBEdit35: TDBEdit;
Label37: TLabel;
wwDBComboBox2: TwwDBComboBox;
Label38: TLabel;
DBEdit37: TDBEdit;
DBEdit39: TDBEdit;
Label40: TLabel;
Label39: TLabel;
Label41: TLabel;
DBEdit36: TDBEdit;
Label42: TLabel;
DBEdit40: TDBEdit;
Label43: TLabel;
DBEdit41: TDBEdit;
Label44: TLabel;
DBEdit42: TDBEdit;
Label47: TLabel;
DBEdit43: TDBEdit;
Label48: TLabel;
DBEdit44: TDBEdit;
Label49: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
Label51: TLabel;
wwDBDateTimePicker3: TwwDBDateTimePicker;
Label53: TLabel;
DBMemo2: TDBMemo;
Label50: TLabel;
wwDBDateTimePicker2: TwwDBDateTimePicker;
Label52: TLabel;
wwDBDateTimePicker4: TwwDBDateTimePicker;
Label1: TLabel;
DBEdit1: TDBEdit;
RxDBLookupCombo2: TRxDBLookupCombo;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton5Click(Sender: TObject);
procedure Panel1Resize(Sender: TObject);
procedure DBEdit35KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
procedure wwDBComboBox2KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit38KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit39KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit36KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit40KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit41KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit42KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit43KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit44KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker4KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker3KeyPress(Sender: TObject; var Key: Char);
procedure FormShow(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 FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure t_info_cardAfterInsert(DataSet: TDataSet);
procedure t_info_cardBeforePost(DataSet: TDataSet);
procedure bsSkinButton10Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_info_card: Tfrm_info_card;
implementation
uses u_main, u_info_card_query, my_sys_function;
{$R *.dfm}
procedure Tfrm_info_card.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_info_card.Hide;
frm_info_card.ManualFloat(frm_info_card.BoundsRect );
frm_main.freeTabs('frm_info_card');
action:=cafree;
frm_info_card:=nil;
end;
procedure Tfrm_info_card.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_info_card.Panel1Resize(Sender: TObject);
var
i:integer;
begin
i:=round(panel1.Width/8);
bsSkinButton7.Width:=i;
bsSkinButton6.Width:=i;
bsSkinButton10.Width:=i;
bsSkinButton1.Width:=i;
bsSkinButton2.Width:=i;
bsSkinButton4.Width:=i;
bsSkinButton3.Width:=i;
end;
procedure Tfrm_info_card.DBEdit35KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit1);
end;
procedure Tfrm_info_card.DBEdit1KeyPress(Sender: TObject; var Key: Char);
begin
key_wwDBComboBox(Key,wwDBComboBox2);
end;
procedure Tfrm_info_card.wwDBComboBox2KeyPress(Sender: TObject;
var Key: Char);
begin
key_DBEdit(Key,DBEdit37);
end;
procedure Tfrm_info_card.DBEdit38KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit39);
end;
procedure Tfrm_info_card.DBEdit39KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit36);
end;
procedure Tfrm_info_card.DBEdit36KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit40);
end;
procedure Tfrm_info_card.DBEdit40KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit41);
end;
procedure Tfrm_info_card.DBEdit41KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit42);
end;
procedure Tfrm_info_card.DBEdit42KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit43);
end;
procedure Tfrm_info_card.DBEdit43KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit44);
end;
procedure Tfrm_info_card.DBEdit44KeyPress(Sender: TObject; var Key: Char);
begin
key_wwDBDateTimePicker(Key,wwDBDateTimePicker1);
end;
procedure Tfrm_info_card.wwDBDateTimePicker1KeyPress(Sender: TObject;
var Key: Char);
begin
key_wwDBDateTimePicker(Key,wwDBDateTimePicker2);
end;
procedure Tfrm_info_card.wwDBDateTimePicker2KeyPress(Sender: TObject;
var Key: Char);
begin
key_wwDBDateTimePicker(Key,wwDBDateTimePicker3);
end;
procedure Tfrm_info_card.wwDBDateTimePicker4KeyPress(Sender: TObject;
var Key: Char);
begin
key_DBMemo(Key,DBMemo2);
end;
procedure Tfrm_info_card.wwDBDateTimePicker3KeyPress(Sender: TObject;
var Key: Char);
begin
key_wwDBDateTimePicker(Key,wwDBDateTimePicker4);
end;
procedure Tfrm_info_card.FormShow(Sender: TObject);
begin
t_info_card.close;
t_info_card.SQL.clear;
t_info_card.SQL.add('select * from t_crm_client_linkman where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in (');
t_info_card.SQL.add('select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_crm_client where ');
t_info_card.SQL.add(open_data('0008','¼<><C2BC><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','no','no','no')+')');
t_info_card.SQL.add(' order by <20><><EFBFBD><EFBFBD>');
t_info_card.open;
end;
procedure Tfrm_info_card.bsSkinButton7Click(Sender: TObject);
begin
table_Prior(t_info_card);
end;
procedure Tfrm_info_card.bsSkinButton6Click(Sender: TObject);
begin
table_next(t_info_card);
end;
procedure Tfrm_info_card.bsSkinButton2Click(Sender: TObject);
begin
table_post(t_info_card);
end;
procedure Tfrm_info_card.bsSkinButton4Click(Sender: TObject);
begin
table_delete(t_info_card);
end;
procedure Tfrm_info_card.bsSkinButton3Click(Sender: TObject);
begin
table_cancel(t_info_card);
end;
procedure Tfrm_info_card.bsSkinButton1Click(Sender: TObject);
begin
t_info_card.insert;
end;
procedure Tfrm_info_card.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose:=close_query(t_info_card);
end;
procedure Tfrm_info_card.t_info_cardAfterInsert(DataSet: TDataSet);
begin
t_info_card['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_info_card['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
DBEdit35.setfocus;
end;
procedure Tfrm_info_card.t_info_cardBeforePost(DataSet: TDataSet);
begin
table_before_post(t_info_card,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_info_card,'<27>Ա<EFBFBD>');
table_before_post(t_info_card,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_info_card.bsSkinButton10Click(Sender: TObject);
begin
try
frm_info_card_query:=tfrm_info_card_query.Create (self);
frm_info_card_query.ShowModal;
finally
frm_info_card_query.Free;
frm_info_card_query:=nil;
end;
end;
end.