📄 systemset.pas
字号:
CheckBox2.Checked:=False;
end;
end;
procedure Tfrm_SystemSet.SpeedButton1Click(Sender: TObject);
begin
func.Mond_Select:='';
func.Mond_Select_Result:='';
func.Mond_Select:='have';
frm_Mond_Select:=Tfrm_Mond_Select.Create(self);
frm_Mond_Select.ShowModal;
Edit4.Text:=func.Mond_Select_Result;
frm_Mond_Select.Free;
end;
procedure Tfrm_SystemSet.Cmd_EditClick(Sender: TObject);
begin
inherited;
if APPlication.MessageBox('确定需要修改该【单位信息】吗?请确认!',Pchar(Application.Title),MB_okcancel)=idok then
begin
with frm_data.Query_Mond_Information do
begin
Close;
Sql.Clear;
Sql.Add('UPDATE [Mond_Information] SET Mond_Name=:u1,Mond_Code=:u2,Mond_Prop=:u3,UpMond_Name=:u4,Address=:u5,ZIP=:u6,Email=:u7,WWW=:u8,Telphone=:u9,Charager=:u10,Mond_UpFlag=:u11,Mond_DownFlag=:u12 WHERE ID=:u13');
frm_data.Query_Mond_Information.Parameters[0].Value:=Trim(Edit1.Text);
frm_data.Query_Mond_Information.Parameters[1].Value:=Trim(Edit2.Text);
frm_data.Query_Mond_Information.Parameters[2].Value:=Trim(Edit3.Text);
frm_data.Query_Mond_Information.Parameters[3].Value:=Trim(Edit4.Text);
frm_data.Query_Mond_Information.Parameters[4].Value:=Trim(Edit5.Text);
frm_data.Query_Mond_Information.Parameters[5].Value:=Trim(Edit6.Text);
frm_data.Query_Mond_Information.Parameters[6].Value:=Trim(Edit7.Text);
frm_data.Query_Mond_Information.Parameters[7].Value:=Trim(Edit8.Text);
frm_data.Query_Mond_Information.Parameters[8].Value:=Trim(Edit9.Text);
frm_data.Query_Mond_Information.Parameters[9].Value:=Trim(Edit10.Text);
frm_data.Query_Mond_Information.Parameters[10].Value:=Trim(tempupstr);
frm_data.Query_Mond_Information.Parameters[11].Value:=Trim(tempdownstr);
frm_data.Query_Mond_Information.Parameters[12].Value:=Trim(Edit_ID.Text);
try
Prepared;
Execsql;
APPlication.MessageBox('修改数据成功!请确认!',Pchar(Application.Title),MB_ICONwarning);
Cmd_RushClick(Sender);
Except
APPlication.MessageBox('系统错误!系统在修改数据表【Drive_Card_Check】时出现服务器连接错误!请确认!',Pchar(Application.Title),MB_ICONwarning);
Exit;
end;
end;
end;
end;
procedure Tfrm_SystemSet.Cmd_DeleteClick(Sender: TObject);
begin
inherited;
if APPlication.MessageBox('确定需要删除该【单位信息】吗?请确认!',Pchar(Application.Title),MB_okcancel)=idok then
begin
with frm_data.Query_Mond_Information do
begin
Close;
Sql.Clear;
Sql.Add('DELETE [Mond_Information] WHERE ID='''+Trim(Edit_ID.Text)+''' ');
try
Prepared;
Execsql;
APPlication.MessageBox('删除数据成功!请确认!',Pchar(Application.Title),MB_ICONwarning);
Cmd_RushClick(Sender);
Except
APPlication.MessageBox('系统错误!系统在删除数据表【Drive_Card_Check】时出现服务器连接错误!请确认!',Pchar(Application.Title),MB_ICONwarning);
Exit;
end;
end;
end;
end;
procedure Tfrm_SystemSet.Cmd_CreateClick(Sender: TObject);
var
tempComp:String;
Mup,Mdown,Mpart:String;
begin
TreeView1.Items.Clear;
with TreeView1.Items do
begin
Node1:=Add(nil,'◆单位信息◆');
Node1.ImageIndex:=0;
with frm_Data.ADOQuery2 do
begin
Close;
Sql.Clear;
Sql.Add('SELECT DISTINCT Mond_Name FROM [Mond_Information] where Mond_UpFlag=''无'' and Mond_DownFlag=''有''');
Prepared;
Open;
First;
While Not Eof do
begin
NodeText1:=frm_Data.ADOQuery2.FieldByname('Mond_Name').AsString;
Mup:=frm_Data.ADOQuery2.FieldByname('Mond_Name').AsString;
Node2:=AddChild(Node1,NodeText1);
Node2.ImageIndex:=1;
with frm_Data.ADOQuery3 do
begin
Close;
Sql.Clear;
Sql.Add('SELECT DISTINCT Mond_Name from [Mond_Information] where Mond_UpFlag=''有'' and UpMond_Name='''+Mup+'''');
Prepared;
Open;
First;
While Not Eof do
begin
if Mup=frm_Data.ADOQuery2.FieldByname('Mond_Name').AsString then
begin
NodeText2:=frm_Data.ADOQuery3.FieldByname('Mond_Name').AsString;
Mpart:=frm_Data.ADOQuery3.FieldByname('Mond_Name').AsString;
Mdown:=frm_Data.ADOQuery3.FieldByname('Mond_Name').AsString;
Node3:=AddChild(Node2,NodeText2);
Node3.ImageIndex:=2;
with frm_Data.ADOQuery4 do
begin
Close;
Sql.Clear;
Sql.Add('SELECT DISTINCT Mond_Name from [Mond_Information] where Mond_UpFlag=''有'' and UpMond_Name='''+Mpart+'''');
Prepared;
Open;
First;
While not eof do
begin
if ((Mup=frm_Data.ADOQuery2.FieldByname('Mond_Name').AsString) and (Mdown=frm_Data.ADOQuery3.FieldByname('Mond_Name').AsString)) then
begin
NodeText3:=frm_Data.ADOQuery4.FieldByname('Mond_Name').AsString;
Node4:=AddChild(Node3,NodeText3);
Node4.ImageIndex:=2;
end;
Next;
end;
end;
end;
Next;
end;
end;
Next;
end;
end;
end;
frm_Data.ADOQuery3.Close;
frm_Data.ADOQuery2.Close;
end;
procedure Tfrm_SystemSet.Edit3Change(Sender: TObject);
begin
if Edit3.ItemIndex=0 then
begin
CheckBox2.Checked:=True;
end;
if Edit3.ItemIndex=1 then
begin
CheckBox2.Checked:=True;
end;
if Edit3.ItemIndex=2 then
begin
CheckBox2.Checked:=False;
end;
end;
procedure Tfrm_SystemSet.TreeView1Change(Sender: TObject; Node: TTreeNode);
var
MUpName,MDownName:String;
begin
if TreeView1.Selected.Level<>0 then
begin
if TreeView1.Selected.Level=1 then
begin
MUpName:=TreeView1.Selected.Text;
Edit1.Text:=TreeView1.Selected.Text;
with frm_data.Query_Mond_Information do
begin
Close;
Sql.Clear;
Sql.Add('SELECT * FROM [Mond_Information] WHERE Mond_Name='''+Trim(Edit1.Text)+'''');
Try
Prepared;
Open;
if frm_data.Query_Mond_Information.RecordCount>0 then
begin
Last;
Edit2.Text:=frm_data.Query_Mond_Information.FieldByName('Mond_Code').AsString;
Edit3.Text:=frm_data.Query_Mond_Information.FieldByName('Mond_Prop').AsString;
Edit4.Text:=frm_data.Query_Mond_Information.FieldByName('UpMond_Name').AsString;
Edit5.Text:=frm_data.Query_Mond_Information.FieldByName('Address').AsString;
Edit6.Text:=frm_data.Query_Mond_Information.FieldByName('ZIP').AsString;
Edit7.Text:=frm_data.Query_Mond_Information.FieldByName('Email').AsString;
Edit8.Text:=frm_data.Query_Mond_Information.FieldByName('WWW').AsString;
Edit9.Text:=frm_data.Query_Mond_Information.FieldByName('Telphone').AsString;
Edit10.Text:=frm_data.Query_Mond_Information.FieldByName('Charager').AsString;
tempupstr:=frm_data.Query_Mond_Information.FieldByName('Mond_UpFlag').AsString;
tempdownstr:=frm_data.Query_Mond_Information.FieldByName('Mond_DownFlag').AsString;
Edit_ID.Text:=frm_data.Query_Mond_Information.FieldByName('ID').AsString;
if Trim(tempupstr)='有' then
begin
CheckBox1.Checked:=True;
end
else
begin
CheckBox1.Checked:=False;
end;
if Trim(tempdownstr)='有' then
begin
CheckBox2.Checked:=True;
end
else
begin
CheckBox2.Checked:=False;
end;
end;
except
APPlication.MessageBox('系统错误!系统在打开数据表【Drive_Card_Check】时出现服务器连接错误!请确认!',Pchar(Application.Title),MB_ICONwarning);
Exit;
end;
end;
end;
if TreeView1.Selected.Level=2 then
begin
MUpName:=TreeView1.Selected.Parent.Text;
Edit4.Text:=TreeView1.Selected.Parent.Text;
Edit1.Text:=TreeView1.Selected.Text;
with frm_data.Query_Mond_Information do
begin
Close;
Sql.Clear;
Sql.Add('SELECT * FROM [Mond_Information] WHERE UpMond_Name='''+Trim(Edit4.Text)+''' and Mond_Name='''+Trim(Edit1.Text)+'''');
Try
Prepared;
Open;
if frm_data.Query_Mond_Information.RecordCount>0 then
begin
Last;
Edit2.Text:=frm_data.Query_Mond_Information.FieldByName('Mond_Code').AsString;
Edit3.Text:=frm_data.Query_Mond_Information.FieldByName('Mond_Prop').AsString;
Edit4.Text:=frm_data.Query_Mond_Information.FieldByName('UpMond_Name').AsString;
Edit5.Text:=frm_data.Query_Mond_Information.FieldByName('Address').AsString;
Edit6.Text:=frm_data.Query_Mond_Information.FieldByName('ZIP').AsString;
Edit7.Text:=frm_data.Query_Mond_Information.FieldByName('Email').AsString;
Edit8.Text:=frm_data.Query_Mond_Information.FieldByName('WWW').AsString;
Edit9.Text:=frm_data.Query_Mond_Information.FieldByName('Telphone').AsString;
Edit10.Text:=frm_data.Query_Mond_Information.FieldByName('Charager').AsString;
tempupstr:=frm_data.Query_Mond_Information.FieldByName('Mond_UpFlag').AsString;
tempdownstr:=frm_data.Query_Mond_Information.FieldByName('Mond_DownFlag').AsString;
Edit_ID.Text:=frm_data.Query_Mond_Information.FieldByName('ID').AsString;
if Trim(tempupstr)='有' then
begin
CheckBox1.Checked:=True;
end
else
begin
CheckBox1.Checked:=False;
end;
if Trim(tempdownstr)='有' then
begin
CheckBox2.Checked:=True;
end
else
begin
CheckBox2.Checked:=False;
end;
end;
except
APPlication.MessageBox('系统错误!系统在打开数据表【Drive_Card_Check】时出现服务器连接错误!请确认!',Pchar(Application.Title),MB_ICONwarning);
Exit;
end;
end;
end;
if TreeView1.Selected.Level=3 then
begin
MUpName:=TreeView1.Selected.Parent.Text;
Edit4.Text:=TreeView1.Selected.Parent.Text;
Edit1.Text:=TreeView1.Selected.Text;
with frm_data.Query_Mond_Information do
begin
Close;
Sql.Clear;
Sql.Add('SELECT * FROM [Mond_Information] WHERE UpMond_Name='''+Trim(Edit4.Text)+''' and Mond_Name='''+Trim(Edit1.Text)+'''');
Try
Prepared;
Open;
if frm_data.Query_Mond_Information.RecordCount>0 then
begin
Last;
Edit2.Text:=frm_data.Query_Mond_Information.FieldByName('Mond_Code').AsString;
Edit3.Text:=frm_data.Query_Mond_Information.FieldByName('Mond_Prop').AsString;
Edit4.Text:=frm_data.Query_Mond_Information.FieldByName('UpMond_Name').AsString;
Edit5.Text:=frm_data.Query_Mond_Information.FieldByName('Address').AsString;
Edit6.Text:=frm_data.Query_Mond_Information.FieldByName('ZIP').AsString;
Edit7.Text:=frm_data.Query_Mond_Information.FieldByName('Email').AsString;
Edit8.Text:=frm_data.Query_Mond_Information.FieldByName('WWW').AsString;
Edit9.Text:=frm_data.Query_Mond_Information.FieldByName('Telphone').AsString;
Edit10.Text:=frm_data.Query_Mond_Information.FieldByName('Charager').AsString;
tempupstr:=frm_data.Query_Mond_Information.FieldByName('Mond_UpFlag').AsString;
tempdownstr:=frm_data.Query_Mond_Information.FieldByName('Mond_DownFlag').AsString;
Edit_ID.Text:=frm_data.Query_Mond_Information.FieldByName('ID').AsString;
if Trim(tempupstr)='有' then
begin
CheckBox1.Checked:=True;
end
else
begin
CheckBox1.Checked:=False;
end;
if Trim(tempdownstr)='有' then
begin
CheckBox2.Checked:=True;
end
else
begin
CheckBox2.Checked:=False;
end;
end;
except
APPlication.MessageBox('系统错误!系统在打开数据表【Drive_Card_Check】时出现服务器连接错误!请确认!',Pchar(Application.Title),MB_ICONwarning);
Exit;
end;
end;
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -