|
|
unit u_op_railway_feemodify;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, BusinessSkinForm, bsSkinCtrls, dxExEdtr, dxCntner, dxTL,
|
|
|
dxDBCtrl, dxDBGrid, DB, ADODB, dxDBTLCl, dxGrClms, RxLookup, StdCtrls,
|
|
|
wwdbdatetimepicker, Mask, wwdbedit, Wwdotdot, Wwdbcomb;
|
|
|
|
|
|
type
|
|
|
Tfrm_op_railway_feemodify = class(TForm)
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinNotebook1: TbsSkinNotebook;
|
|
|
t_op_railway1: TDataSource;
|
|
|
t_op_railway: TADOQuery;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
Edit1: TEdit;
|
|
|
Edit2: TEdit;
|
|
|
Label6: TLabel;
|
|
|
Label1: TLabel;
|
|
|
Label9: TLabel;
|
|
|
RxDBLookupCombo2: TRxDBLookupCombo;
|
|
|
Label3: TLabel;
|
|
|
Edit4: TEdit;
|
|
|
Edit3: TEdit;
|
|
|
Label2: TLabel;
|
|
|
Label10: TLabel;
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
op_type: TEdit;
|
|
|
fee_type: TEdit;
|
|
|
Label5: TLabel;
|
|
|
Edit5: TEdit;
|
|
|
wwDBComboBox5: TwwDBComboBox;
|
|
|
Label7: TLabel;
|
|
|
bsSkinButton45: TbsSkinButton;
|
|
|
bsSkinButton44: TbsSkinButton;
|
|
|
Label4: TLabel;
|
|
|
wwDBComboBox1: TwwDBComboBox;
|
|
|
Label8: TLabel;
|
|
|
wwDBDateTimePicker2: TwwDBDateTimePicker;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
t_ch_fee: TADOQuery;
|
|
|
Label37: TLabel;
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
Label38: TLabel;
|
|
|
RxDBLookupCombo16: TRxDBLookupCombo;
|
|
|
wwDBComboBox31: TwwDBComboBox;
|
|
|
Label25: TLabel;
|
|
|
RxDBLookupCombo5: TRxDBLookupCombo;
|
|
|
Label13: TLabel;
|
|
|
dxDBGrid2: TdxDBGrid;
|
|
|
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid2Column22: TdxDBGridColumn;
|
|
|
dxDBGrid2Column23: TdxDBGridColumn;
|
|
|
dxDBGrid2Column24: TdxDBGridColumn;
|
|
|
dxDBGrid1Column20: TdxDBGridMaskColumn;
|
|
|
dxDBGrid2Column30: TdxDBGridColumn;
|
|
|
dxDBGrid2Column31: TdxDBGridColumn;
|
|
|
dxDBGrid2Column32: TdxDBGridColumn;
|
|
|
dxDBGrid2Column33: TdxDBGridColumn;
|
|
|
dxDBGrid2Column34: TdxDBGridColumn;
|
|
|
dxDBGrid2Column35: TdxDBGridColumn;
|
|
|
dxDBGridMaskColumn4: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn5: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn6: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column12: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column14: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column13: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column16: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column18: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column15: TdxDBGridMaskColumn;
|
|
|
dxDBGrid2Column25: TdxDBGridColumn;
|
|
|
dxDBGrid2Column26: TdxDBGridColumn;
|
|
|
dxDBGrid2Column27: TdxDBGridColumn;
|
|
|
dxDBGrid2Column28: TdxDBGridColumn;
|
|
|
dxDBGrid2Column29: TdxDBGridColumn;
|
|
|
dxDBGrid1Column17: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column19: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column22: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column63: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column64: TdxDBGridMaskColumn;
|
|
|
dxDBGrid2Column21: TdxDBGridColumn;
|
|
|
dxDBGrid2Column36: TdxDBGridColumn;
|
|
|
bsSkinButton11: TbsSkinButton;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
dxDBGrid2Column37: TdxDBGridColumn;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure bsSkinButton44Click(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton45Click(Sender: TObject);
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure bsSkinButton11Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure dxDBGrid2Column27CustomDraw(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
|
|
|
var AColor: TColor; ASelected, AFocused: Boolean;
|
|
|
var ADone: Boolean);
|
|
|
private
|
|
|
function fee_get_client(str:string):string;
|
|
|
function fee_get_num(Str: String): Double;
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_railway_feemodify: Tfrm_op_railway_feemodify;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, my_sys_function, u_data_share,
|
|
|
u_op_shendate, u_op_givedate, u_op_railway_piliangfee, u_op_acceptcode,
|
|
|
u_op_railway_piliangfeemodify;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_op_railway_feemodify.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
CLOSE;
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_railway_feemodify.fee_get_client(str:string):string;
|
|
|
begin
|
|
|
end;
|
|
|
function Tfrm_op_railway_feemodify.fee_get_num(Str: String): Double;
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_feemodify.bsSkinButton44Click(Sender: TObject);
|
|
|
var
|
|
|
str:string;
|
|
|
begin
|
|
|
if Edit1.text<>''then
|
|
|
str:=' and t_op_railway.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
|
|
|
if Edit4.text<>''then
|
|
|
begin
|
|
|
str:=str+' and ( t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_railway where ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''))';
|
|
|
end;
|
|
|
if Edit2.text<>''then
|
|
|
begin
|
|
|
str:=str+' and t_op_railway.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+Edit2.text+'%'+'''';
|
|
|
end;
|
|
|
if Edit3.text<>''then
|
|
|
begin
|
|
|
str:=str+' and t_op_railway.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+Edit3.text+'%'+'''';
|
|
|
end;
|
|
|
if Edit5.text<>''then
|
|
|
begin
|
|
|
str:=str+' and t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit5.text+'%'+'''';
|
|
|
end;
|
|
|
|
|
|
if wwDBComboBox5.text<>''then
|
|
|
begin
|
|
|
str:=str+' and t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ= '+''''+wwDBComboBox5.text+'''';
|
|
|
end;
|
|
|
|
|
|
if RxDBLookupCombo2.DisplayValue<>''then
|
|
|
begin
|
|
|
str:=str+' and t_op_railway.ί<>е<EFBFBD>λ='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
|
|
|
end;
|
|
|
if wwDBDateTimePicker1.text<>''then
|
|
|
begin
|
|
|
str:=str+' and t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
|
|
|
end;
|
|
|
|
|
|
if wwDBDateTimePicker2.text<>''then
|
|
|
begin
|
|
|
str:=str+' and t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
|
|
|
end;
|
|
|
|
|
|
if RxDBLookupCombo5.DisplayValue<>''then
|
|
|
begin
|
|
|
str:=str+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo5.DisplayValues[1]+'''';
|
|
|
end;
|
|
|
|
|
|
if wwDBComboBox31.text<>''then
|
|
|
begin
|
|
|
str:=str+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>= '+''''+wwDBComboBox31.text+'''';
|
|
|
end;
|
|
|
|
|
|
if RxDBLookupCombo1.DisplayValue<>''then
|
|
|
begin
|
|
|
str:=str+' and t_ch_fee.<2E>ұ<EFBFBD>='+''''+RxDBLookupCombo1.DisplayValues[0]+'''';
|
|
|
end;
|
|
|
|
|
|
if RxDBLookupCombo16.DisplayValue<>''then
|
|
|
begin
|
|
|
str:=str+' and t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
|
|
|
end;
|
|
|
|
|
|
str:=str+' and '+open_data('0006','t_op_railway.¼<><C2BC><EFBFBD><EFBFBD>','t_op_railway.<2E><><EFBFBD><EFBFBD>Ա','t_op_railway.<2E>ͷ<EFBFBD>Ա','t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','no');
|
|
|
str:=str+' and '+open_data('7000','t_ch_fee.¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no');
|
|
|
str:='select t_ch_fee.*,t_op_railway.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_railway.ί<>б<EFBFBD><D0B1><EFBFBD>,t_op_railway.ί<>е<EFBFBD>λ,t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_railway.<2E><><EFBFBD><EFBFBD>Ա,t_op_railway.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'t_op_railway.<2E><><EFBFBD><EFBFBD>,t_op_railway.<2E><><EFBFBD><EFBFBD>,t_op_railway.<2E><>Դ,t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_railway.<2E><>վ,t_op_railway.<2E><><EFBFBD><EFBFBD>վ,t_op_railway.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+' from t_ch_fee left join t_op_railway on (t_op_railway.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD>) where t_op_railway.װ<>˷<EFBFBD>ʽ<>''<27><>·<EFBFBD><C2B7>Ʊ'' '+str+' order by t_op_railway.<2E><><EFBFBD><EFBFBD>';
|
|
|
t_op_railway.close;
|
|
|
t_op_railway.sql.clear;
|
|
|
t_op_railway.sql.add(str);
|
|
|
t_op_railway.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_feemodify.bsSkinButton2Click(Sender: TObject);
|
|
|
var
|
|
|
i:Integer;
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('delete from t_ch_fee where ch_id=:ch_id');
|
|
|
end;
|
|
|
t_op_railway.DisableControls;
|
|
|
|
|
|
for i:=0 to dxDBGrid2.SelectedCount-1 do
|
|
|
begin
|
|
|
t_op_railway.GotoBookmark(pointer(dxDBGrid2.selectedrows[i]));
|
|
|
if (t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>') or (t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='¼<><C2BC>״̬') then begin
|
|
|
aQuery.Parameters.ParamByName('CH_ID').Value:=t_op_railway['CH_ID'];
|
|
|
aQuery.ExecSQL;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
t_op_railway.Requery();
|
|
|
t_op_railway.EnableControls;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_feemodify.bsSkinButton45Click(Sender: TObject);
|
|
|
begin
|
|
|
Edit1.text:='';
|
|
|
Edit2.text:='';
|
|
|
Edit3.text:='';
|
|
|
Edit4.text:='';
|
|
|
Edit5.text:='';
|
|
|
RxDBLookupCombo2.ClearValue;
|
|
|
wwDBDateTimePicker1.Text:='';
|
|
|
wwDBDateTimePicker2.Text:='';
|
|
|
wwDBComboBox1.text:='';
|
|
|
RxDBLookupCombo1.ClearValue;
|
|
|
RxDBLookupCombo5.ClearValue;
|
|
|
RxDBLookupCombo16.ClearValue;
|
|
|
wwDBComboBox31.text:='';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_feemodify.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
frm_op_railway_feemodify.Hide;
|
|
|
frm_op_railway_feemodify.ManualFloat(frm_op_railway_feemodify.BoundsRect );
|
|
|
frm_main.freeTabs('frm_op_railway_feemodify');
|
|
|
action:=cafree;
|
|
|
frm_op_railway_feemodify:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_feemodify.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
try
|
|
|
frm_op_railway_piliangfeemodify:=tfrm_op_railway_piliangfeemodify.Create (self);
|
|
|
|
|
|
frm_op_railway_piliangfeemodify.ShowModal;
|
|
|
finally
|
|
|
frm_op_railway_piliangfeemodify.Free;
|
|
|
frm_op_railway_piliangfeemodify:=nil;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_feemodify.bsSkinButton11Click(Sender: TObject);
|
|
|
var
|
|
|
i:Integer;
|
|
|
begin
|
|
|
try
|
|
|
t_op_railway.DisableControls;
|
|
|
|
|
|
for i:=0 to dxDBGrid2.SelectedCount-1 do
|
|
|
begin
|
|
|
t_op_railway.GotoBookmark(pointer(dxDBGrid2.selectedrows[i]));
|
|
|
if t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='¼<><C2BC>״̬' then begin
|
|
|
t_op_railway.Edit;
|
|
|
t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>';
|
|
|
t_op_railway['<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>']:=Now;
|
|
|
t_op_railway.post;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
t_op_railway.Refresh;
|
|
|
t_op_railway.EnableControls;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_feemodify.bsSkinButton1Click(Sender: TObject);
|
|
|
var
|
|
|
i:Integer;
|
|
|
begin
|
|
|
try
|
|
|
t_op_railway.DisableControls;
|
|
|
|
|
|
for i:=0 to dxDBGrid2.SelectedCount-1 do
|
|
|
begin
|
|
|
t_op_railway.GotoBookmark(pointer(dxDBGrid2.selectedrows[i]));
|
|
|
if t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>' then begin
|
|
|
t_op_railway.Edit;
|
|
|
t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='¼<><C2BC>״̬';
|
|
|
t_op_railway['<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>']:=null;
|
|
|
t_op_railway.post;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
t_op_railway.Refresh;
|
|
|
t_op_railway.EnableControls;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_feemodify.dxDBGrid2Column27CustomDraw(
|
|
|
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
|
|
|
AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid2Column27.Index]);
|
|
|
AFont.Color:=clblack;
|
|
|
end;
|
|
|
|
|
|
end.
|