📄 parasetup.pas
字号:
unit parasetup;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TFlatRadioButtonUnit, TFlatGroupBoxUnit, StdCtrls,
TFlatEditUnit, ExtCtrls, ActnList, TFlatButtonUnit,IniFiles;
type
Tparasetup_form = class(TForm)
Panel1: TPanel;
FlatEdit1: TFlatEdit;
FlatEdit2: TFlatEdit;
FlatEdit5: TFlatEdit;
FlatGroupBox1: TFlatGroupBox;
FlatRadioButton1: TFlatRadioButton;
FlatRadioButton2: TFlatRadioButton;
FlatGroupBox2: TFlatGroupBox;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
FlatRadioButton3: TFlatRadioButton;
FlatRadioButton4: TFlatRadioButton;
FlatEdit6: TFlatEdit;
FlatEdit7: TFlatEdit;
FlatEdit8: TFlatEdit;
FlatEdit9: TFlatEdit;
FlatEdit3: TFlatEdit;
FlatEdit4: TFlatEdit;
ActionList1: TActionList;
Exit_but: TAction;
FlatGroupBox3: TFlatGroupBox;
Label3: TLabel;
Label7: TLabel;
Label2: TLabel;
Label1: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
FlatGroupBox4: TFlatGroupBox;
Label14: TLabel;
Label15: TLabel;
FlatButton2: TFlatButton;
FlatButton1: TFlatButton;
FlatButton3: TFlatButton;
FlatEdit10: TFlatEdit;
FlatEdit11: TFlatEdit;
{procedure FormCreate(Sender: TObject);
procedure Exit_butExecute(Sender: TObject);
procedure FlatButton2Click(Sender: TObject);
procedure FlatButton1Click(Sender: TObject);
function ipaddress_check(address:string):boolean;
procedure FlatButton3Click(Sender: TObject); }
private
{ Private declarations }
public
{ Public declarations }
end;
var
parasetup_form: Tparasetup_form;
implementation
uses datashare, main;
{$R *.dfm}
{function Tparasetup_form.ipaddress_check(address:string):boolean;
var
i,s:integer;
t_str:string;
begin
if length(address)>15 then
begin
application.MessageBox('IP地址超出长度!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
result:=false;
exit;
end;
t_str:='';
for i:=1 to length(address) do
begin
if (copy(address,i,1)<>'.')and(i<>length(address)) then
begin
t_str:=t_str+copy(address,i,1);
end else
begin
if(i=length(address)) then
begin
if copy(address,i,1)='.' then
begin
application.MessageBox('IP地址格式不正确!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
result:=false;
exit;
end else
t_str:=t_str+copy(address,i,1);
end;
if (t_str='')or(strtoint(t_str)>255) then
begin
application.MessageBox('IP地址格式不正确!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
result:=false;
exit;
end;
t_str:='';
inc(s);
end;
end;
Result:=true;
end;
procedure Tparasetup_form.FormCreate(Sender: TObject);
var
Str:string;
i:integer;
myinifile:Tinifile;
vs:string;
begin
inherited;
for i:=0 to componentcount-1 do
begin
if components[i] is TFlatEdit then
begin
(components[i] as TFlatEdit).Text:='';
(components[i] as TFlatEdit).ReadOnly:=true;
end;
end;
try
with datashare_form.Query1 do
begin
close;
sql.Clear;
Str:='select * from SCOIPARASETUP'; //检索社保参数表中是否有记录
sql.Add(Str);
prepare;
open;
FlatEdit1.Text:=fieldbyname('BEGINYEAR').AsString;
FlatEdit2.Text:=fieldbyname('BEGINMONTH').AsString;
FlatEdit3.Text:=fieldbyname('ENDYEAR').AsString;
FlatEdit4.Text:=fieldbyname('ENDMONTH').AsString;
FlatEdit5.Text:=FormatFloat('#,##0.00',fieldbyname('AVAGPAY').AsFloat);
if fieldbyname('PAYREFER').AsString='0' then
begin
FlatRadiobutton1.Checked:=true;
FlatRadiobutton2.Enabled:=false;
end
else
begin
FlatRadioButton2.Checked:=true;
FlatRadioButton1.Enabled:=false;
end;
if fieldbyname('MODESTAT').AsString='0' then
begin //按比例
FlatRadioButton3.Checked:=true;
FlatEdit6.Text:=FormatFloat('#,##0.00',fieldbyname('TOPVALUE').AsFloat*100)+'%';
FlatEdit7.Text:=FormatFloat('#,##0.00',fieldbyname('BUTVALUE').AsFloat*100)+'%';
FlatEdit8.Enabled:=false;
FlatEdit9.Enabled:=false;
//label12.Visible:=false;
//label13.Visible:=false;
FlatRadioButton4.Enabled:=false;
end
else
begin //按绝对值
FlatRadioButton4.Checked:=true;
FlatEdit9.Text:=FormatFloat('#,##0.00',fieldbyname('TOPVALUE').AsFloat);
FlatEdit8.Text:=FormatFloat('#,##0.00',fieldbyname('BUTVALUE').AsFloat);
FlatEdit6.Enabled:=false;
FlatEdit7.Enabled:=false;
//label8.Visible:=false;
//label9.Visible:=false;
// label10.Visible:=false;
//label11.Visible:=false;
FlatRadioButton3.Enabled:=false;
end;
// FlatEdit10.Text:=FormatFloat('#,##0.00',fieldbyname('PERSON').AsFloat*100)+'%';
// FlatEdit11.Text:=FormatFloat('#,##0.00',fieldbyname('UNITVALUE').AsFloat*100)+'%';
close;
end;
except
on e:exception do
application.MessageBox(pchar(e.Message),'恩普软件',MB_OK+MB_IconStop+MB_SystemModal);
end;
myinifile:=Tinifile.create(pchar(d+'\esiis.ini'));
vs:=myinifile.ReadString('http','host','');
Flatedit10.Text:=vs;
vs:=myinifile.ReadString('http','port','');
Flatedit11.Text:=vs;
myinifile.Destroy;
end;
procedure Tparasetup_form.Exit_butExecute(Sender: TObject);
begin
//退出当前模块
if Application.MessageBox('您真的要退出当前模块操作吗?','退出确认',MB_OKCancel+MB_DEFBUTTON1+MB_IconQuestion+MB_SystemModal)=IdOk then
close;
end;
procedure Tparasetup_form.FlatButton2Click(Sender: TObject);
begin
if Application.MessageBox('您真的要关闭当前模块吗?','退出确认',MB_OKCancel+MB_DEFBUTTON1+MB_IconQuestion+MB_SystemModal)=IdOk then
close;
end;
procedure Tparasetup_form.FlatButton1Click(Sender: TObject);
begin
flatedit10.ReadOnly :=false;
flatedit11.ReadOnly :=false;
flatedit10.SetFocus;
end;
procedure Tparasetup_form.FlatButton3Click(Sender: TObject);
var
myinifile:Tinifile;
begin
if flatedit10.Text='' then
begin
application.MessageBox('请输入HTTP地址!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
flatedit10.SetFocus;
exit;
end;
if flatedit11.Text='' then
begin
application.MessageBox('请输入HTTP端口!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
Flatedit11.SetFocus;
exit;
end;
if not ipaddress_check(flatedit10.Text) then
begin
flatedit10.SetFocus;
exit;
end;
flatedit10.Enabled:=true;
flatedit11.Enabled:=true;
myinifile:=Tinifile.create(pchar(d+'\esiis.ini'));
myinifile.writestring('http','host',flatedit10.Text);
myinifile.writestring('http','port',flatedit11.Text);
myinifile.Destroy;
application.MessageBox('设置保存成功!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
end; }
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -