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.

279 lines
8.1 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_mgJJ;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, RxLookup, StdCtrls, wwdblook, bsSkinCtrls, ExtCtrls, dxExEdtr,
dxDBTLCl, dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner, Menus, DB, ADODB,
Grids, Wwdbigrd, Wwdbgrid, DBGridEh;
type
TFrm_info_price_mgJJ = class(TForm)
Panel1: TPanel;
bsSkinButton7: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton8: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinPanel5: TbsSkinPanel;
Label7: TLabel;
Label124: TLabel;
Label11: TLabel;
Label8: TLabel;
Label10: TLabel;
bsSkinButton1: TbsSkinButton;
wwDBLookupCombo2: TwwDBLookupCombo;
wwDBLookupCombo4: TwwDBLookupCombo;
Edit1: TEdit;
bsSkinButton10: TbsSkinButton;
RxDBLookupCombo3: TRxDBLookupCombo;
RxDBLookupCombo4: TRxDBLookupCombo;
t_price_ship: TADOQuery;
t_price_ship1: TDataSource;
t_price_agreement1: TDataSource;
t_price_agreement: TADOQuery;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
N73: TMenuItem;
N48: TMenuItem;
wwDBGrid1: TwwDBGrid;
bsSkinButton12: TbsSkinButton;
bsSkinButton13: TbsSkinButton;
wwstartport: TwwDBLookupCombo;
wwendEnPort: TwwDBLookupCombo;
shipper: TwwDBLookupCombo;
shipline: TwwDBLookupCombo;
wwendpotcn: TwwDBLookupCombo;
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton7Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormShow(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure bsSkinButton13Click(Sender: TObject);
procedure t_price_ship1DataChange(Sender: TObject; Field: TField);
procedure wwDBGrid1CalcCellColors(Sender: TObject; Field: TField;
State: TGridDrawState; Highlight: Boolean; AFont: TFont;
ABrush: TBrush);
private
{ Private declarations }
procedure loadwwgrid ;
procedure savewwgrid ;
public
{ Public declarations }
end;
var
Frm_info_price_mgJJ: TFrm_info_price_mgJJ;
implementation
uses u_main, u_data_share, my_sys_function, u_info_price_query,
u_info_price_agreeview, u_info_price_manage;
{$R *.dfm}
procedure TFrm_info_price_mgJJ.bsSkinButton10Click(Sender: TObject);
var
str,str_tiaojian:String;
begin
IF TRIM(Edit1.TEXT)=''THEN
EXIT;
str_tiaojian:=' like '+''''+'%'+TRIM(Edit1.TEXT)+'%'+'''';
str:='where Ŀ<>ĸ<EFBFBD>'+str_tiaojian;
str:=str+' or Ŀ<>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD>'+str_tiaojian;
str:=str+' or <20><><EFBFBD>˸<EFBFBD>'+str_tiaojian;
str:=str+' or <20><><EFBFBD><EFBFBD>'+str_tiaojian;
str:=str+' or <20><><EFBFBD><EFBFBD>˾'+str_tiaojian;
str:=str+' or <20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>'+str_tiaojian;
str:=str+' or <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>'+str_tiaojian;
str:=str+' or <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>'+str_tiaojian;
str:=Str+' and '+open_data('3001','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no');
t_price_ship.close;
t_price_ship.sql.Clear;
t_price_ship.sql.add('select * from t_price_ship ');
t_price_ship.sql.add(str);
t_price_ship.sql.add(' order by <20>˼۱<CBBC><DBB1><EFBFBD>');
t_price_ship.open;
end;
procedure TFrm_info_price_mgJJ.bsSkinButton1Click(Sender: TObject);
var
str:widestring;
begin
str:='SELECT * FROM t_price_ship where 1=1 ';
str:=Str+' and '+open_data('3001','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no');
if wwDBLookupCombo2.text<>''then
str:=str+' and <20><><EFBFBD>˸<EFBFBD> like '+''''+'%'+wwDBLookupCombo2.text+'%'+'''';
if wwDBLookupCombo4.text<>''then
str:=str+' and Ŀ<>ĸ<EFBFBD> like '+''''+'%'+wwDBLookupCombo4.text+'%'+'''';
if RxDBLookupCombo3.DisplayValue<>''then
str:=str+' and <20><><EFBFBD><EFBFBD>˾='+''''+RxDBLookupCombo3.KeyValue+'''';
if RxDBLookupCombo4.DisplayValue<>''then
str:=str+' and <20><><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo4.KeyValue+'''';
t_price_ship.close;
t_price_ship.sql.Clear;
t_price_ship.sql.add(str);
t_price_ship.sql.add(' order by <20>˼۱<CBBC><DBB1><EFBFBD>');
t_price_ship.open;
end;
procedure TFrm_info_price_mgJJ.bsSkinButton7Click(Sender: TObject);
begin
table_Prior(t_price_ship);
end;
procedure TFrm_info_price_mgJJ.bsSkinButton6Click(Sender: TObject);
begin
table_next(t_price_ship);
end;
procedure TFrm_info_price_mgJJ.bsSkinButton5Click(Sender: TObject);
begin
sys_print('<27><>Լ<EFBFBD>˼۴<CBBC>ӡ',2,t_price_ship1,frm_data_share.t_code_price_ctn1,nil,nil,t_price_ship1,nil,nil,nil,nil,nil,nil);
end;
procedure TFrm_info_price_mgJJ.bsSkinButton3Click(Sender: TObject);
var
afield : variant;
i: Integer;
begin
if t_price_ship.IsEmpty then
exit;
afield := vararraycreate([0,t_price_ship.fieldcount-1],varvariant);
for i := 0 to (t_price_ship.fieldcount-1) do
begin
afield[i] :=t_price_ship.fields[i].value ;
end;
t_price_ship.append;
for i := 1 to (t_price_ship.fieldcount-1) do
begin
if t_price_ship.fields[i].FieldName<>'<27>˼۱<CBBC><DBB1><EFBFBD>' then
t_price_ship.fields[i].value := afield[i] ;
end;
t_price_ship['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_price_ship['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳɹ<D3B3><C9B9><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure TFrm_info_price_mgJJ.bsSkinButton11Click(Sender: TObject);
begin
table_post(t_price_ship);
end;
procedure TFrm_info_price_mgJJ.bsSkinButton4Click(Sender: TObject);
begin
table_delete(t_price_ship);
end;
procedure TFrm_info_price_mgJJ.bsSkinButton8Click(Sender: TObject);
begin
table_cancel(t_price_ship);
end;
procedure TFrm_info_price_mgJJ.bsSkinButton9Click(Sender: TObject);
begin
close;
end;
procedure TFrm_info_price_mgJJ.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savewwgrid ;
frm_info_price_mgJJ.Hide;
frm_info_price_mgJJ.ManualFloat(frm_info_price_mgJJ.BoundsRect );
frm_main.freeTabs('Frm_info_price_mgJJ');
action:=cafree;
frm_info_price_mgJJ:=nil;
end;
procedure TFrm_info_price_mgJJ.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose:=frm_close_query(t_price_ship);
end;
procedure TFrm_info_price_mgJJ.FormShow(Sender: TObject);
begin
loadwwgrid;
t_price_ship.sql.Clear;
t_price_ship.sql.add('SELECT * FROM t_price_ship where 1=1 ');
t_price_ship.sql.add(' and '+open_data('3001','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no'));
t_price_ship.sql.add(' order by <20><><EFBFBD><EFBFBD> ');
t_price_ship.open;
t_price_agreement.open;
end;
procedure TFrm_info_price_mgJJ.bsSkinButton2Click(Sender: TObject);
begin
t_price_ship.insert;
end;
procedure TFrm_info_price_mgJJ.loadwwgrid;
begin
wwDBGrid1.IniAttributes.FileName:=caption+'jj' ;
wwDBGrid1.LoadFromIniFile;
end;
procedure TFrm_info_price_mgJJ.savewwgrid;
begin
wwDBGrid1.IniAttributes.Enabled := True;
wwDBGrid1.IniAttributes.FileName:=caption+'jj' ;
wwDBGrid1.SaveToIniFile;
end;
procedure TFrm_info_price_mgJJ.bsSkinButton12Click(Sender: TObject);
begin
if t_price_ship.FieldByName('<27><><EFBFBD><EFBFBD>').AsBoolean then exit ;
t_price_ship.Edit ;
t_price_ship.FieldByName('<27><><EFBFBD><EFBFBD>').AsBoolean:=true ;
t_price_ship.post ;
end;
procedure TFrm_info_price_mgJJ.bsSkinButton13Click(Sender: TObject);
begin
if not t_price_ship.FieldByName('<27><><EFBFBD><EFBFBD>').AsBoolean then exit ;
t_price_ship.Edit ;
t_price_ship.FieldByName('<27><><EFBFBD><EFBFBD>').AsBoolean:=False ;
t_price_ship.post ;
end;
procedure TFrm_info_price_mgJJ.t_price_ship1DataChange(Sender: TObject;
Field: TField);
begin
wwDBGrid1.ReadOnly:=t_price_ship.FieldByName('<27><><EFBFBD><EFBFBD>').AsBoolean ;
end;
procedure TFrm_info_price_mgJJ.wwDBGrid1CalcCellColors(Sender: TObject;
Field: TField; State: TGridDrawState; Highlight: Boolean; AFont: TFont;
ABrush: TBrush);
begin
if t_price_ship.FieldByName('<27><><EFBFBD><EFBFBD>').AsBoolean then brush.Color:=clskyblue
else brush.color:=clwhite ;
end;
end.