📄 unit_historyinfo_b.pas
字号:
unit unit_historyinfo_B;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Unit_custombrowsebase, ImgList, Menus, Db, DBTables, Grids, DBGrids,
ComCtrls, TFlatCheckBoxUnit, TFlatSpinEditUnit, ToolWin, StdCtrls,
TFlatEditUnit, TFlatComboBoxUnit, TFlatButtonUnit, ExtCtrls;
type
Tform_historyinfo_B = class(Tform_custombrowsebase)
Label17: TLabel;
Label18: TLabel;
dtpJT_ChangeDateBegin: TDateTimePicker;
dtpJT_ChangeDateEnd: TDateTimePicker;
cbJT_ChangeDate: TFlatCheckBox;
Label10: TLabel;
ed_SID: TFlatEdit;
Label8: TLabel;
Label9: TLabel;
dtpGR_ChangeDateBegin: TDateTimePicker;
dtpGR_ChangeDateEnd: TDateTimePicker;
cbGR_ChangeDate: TFlatCheckBox;
Label13: TLabel;
edGR_ChangeMen: TFlatEdit;
Label14: TLabel;
edJT_ChangeMen: TFlatEdit;
procedure cbGR_BE_DH_TClick(Sender: TObject);
procedure cbJT_ChangeDateClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
procedure pro_GR_OpenDataSet(sender:tobject;strsql:string);override;
procedure pro_JT_OpenDataSet(sender:tobject;strsql:string);override;
procedure pro_GR_getsqlwhere(sender:tobject);override;
procedure pro_JT_getsqlwhere(sender:tobject);override;
procedure pro_GR_checkcondition(sender:tobject);override;
procedure pro_JT_checkcondition(sender:tobject);override;
{ Private declarations }
public
{ Public declarations }
end;
var
form_historyinfo_B: Tform_historyinfo_B;
//
Function Fun_MsgBox(pMsg:String='';pCaption:Integer=0;pButton:Integer=0):Integer;stdCall;external'winfun.dll';
implementation
{$R *.DFM}
procedure Tform_historyinfo_B.cbGR_BE_DH_TClick(Sender: TObject);
begin
inherited;
if cbGR_ChangeDate.Checked then
begin
dtpGR_ChangeDateBegin.Color:=clwindow;
dtpGR_ChangeDateEnd.Color:=clwindow;
dtpGR_ChangeDateBegin.Enabled:=true;
dtpGR_ChangeDateEnd.Enabled:=true;
end
else
begin
dtpGR_ChangeDateBegin.Color:=clActiveBorder;
dtpGR_ChangeDateEnd.Color:=clActiveBorder;
dtpGR_ChangeDateBegin.Enabled:=false;
dtpGR_ChangeDateEnd.Enabled:=false;
end;
end;
procedure Tform_historyinfo_B.cbJT_ChangeDateClick(Sender: TObject);
begin
inherited;
if cbJT_ChangeDate.Checked then
begin
dtpJT_ChangeDateBegin.Color:=clwindow;
dtpJT_ChangeDateEnd.Color:=clwindow;
dtpJT_ChangeDateBegin.Enabled:=true;
dtpJT_ChangeDateEnd.Enabled:=true;
end
else
begin
dtpJT_ChangeDateBegin.Color:=clActiveBorder;
dtpJT_ChangeDateEnd.Color:=clActiveBorder;
dtpJT_ChangeDateBegin.Enabled:=false;
dtpJT_ChangeDateEnd.Enabled:=false;
end;
end;
procedure Tform_historyinfo_B.FormShow(Sender: TObject);
begin
inherited;
PanelGR_base.Visible:=false;
PanelGR_Stuff.Visible:=true;
PanelGR_base1.Visible:=true;
PanelGR_Stuff.top:=0;
PanelGR_base1.top:=PanelGR_Stuff.top+PanelGR_Stuff.Height;
end;
procedure Tform_historyinfo_B.pro_GR_checkcondition(sender: tobject);
begin
inherited;
if cbGR_ChangeDate.Checked then
begin
if trunc(dtpGR_ChangeDateEnd.DateTime)<trunc(dtpGR_ChangeDateBegin.DateTime) then
begin
Fun_MsgBox('修改时间开始日期不能大于结束日期');
GR_condition:=false;
end;
end;
end;
procedure Tform_historyinfo_B.pro_GR_getsqlwhere(sender: tobject);
var
tmpstr:string;
begin
inherited;
if ed_SID.Text<>'' then
tmpstr:=tmpstr+' and '+'SID='+''''+ed_SID.Text+'''';
if edGR_WK_NO.Text<>'' then
tmpstr:=tmpstr+' and '+'SID='+''''+edGR_WK_NO.Text+'''';
if cbGR_ChangeDate.Checked then
tmpstr:=tmpstr+' and '+'ChangeDate between '+'to_date('''+formatdatetime('yyyymmdd',dtpGR_ChangeDateBegin.Date)+''',''yyyymmdd''),'+' and '+'to_date('''+formatdatetime('yyyymmdd',dtpGR_ChangeDateEnd.Date)+''',''yyyymmdd''),';
GR_sqlwhere:=GR_sqlwhere+tmpstr;
end;
procedure Tform_historyinfo_B.pro_GR_OpenDataSet(sender: tobject;
strsql: string);
begin
inherited;
with browse_normal do
begin
close;
sql.clear;
sql.add('select SID 手机号码,ChangeContent 修改内容,ChangeDate 修改时间,ChangeMen 修改者工号,WhyChange 修改原因,GH 客户经理,CityCode_desc 地市,Off_No_Home 局向');
sql.add('from T_V_GR_History_browse');
sql.Add('where 1=1');
sql.add(strsql);
open;
end;
end;
procedure Tform_historyinfo_B.pro_JT_checkcondition(sender: tobject);
begin
inherited;
if cbJT_ChangeDate.Checked then
begin
if trunc(dtpJT_ChangeDateEnd.DateTime)<trunc(dtpJT_ChangeDateBegin.DateTime) then
begin
Fun_MsgBox('修改时间开始日期不能大于结束日期');
JT_condition:=false;
end;
end;
end;
procedure Tform_historyinfo_B.pro_JT_getsqlwhere(sender: tobject);
var
tmpstr:string;
begin
inherited;
if edJT_ChangeMen.Text<>'' then
tmpstr:=tmpstr+' and '+'NAME='+''''+edJT_ChangeMen.Text+'''';
if cbJT_ChangeDate.Checked then
tmpstr:=tmpstr+' and '+'ChangeDate between '+'to_date('''+formatdatetime('yyyymmdd',dtpJT_ChangeDateBegin.Date)+''',''yyyymmdd''),'+' and '+'to_date('''+formatdatetime('yyyymmdd',dtpJT_ChangeDateEnd.Date)+''',''yyyymmdd''),';
JT_sqlwhere:=JT_sqlwhere+tmpstr;
end;
procedure Tform_historyinfo_B.pro_JT_OpenDataSet(sender: tobject;
strsql: string);
begin
inherited;
with browse_normal do
begin
close;
sql.clear;
sql.add('select JTYHMC 集团名称,ChangeContent 修改内容,ChangeDate 修改时间,ChangeMen 修改者工号,WhyChange 修改原因,GH 客户经理,CityCode_desc 地市,Off_No_Home 局向');
sql.add('from T_V_JT_History_browse');
sql.Add('where 1=1');
sql.add(strsql);
open;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -