📄 tradeimportunit.~pas
字号:
HYLookImportData.ADOQuery1.Open;
HYLookImportData.ShowModal;
end;
procedure TTradeImportFrm.BitBtn13Click(Sender: TObject);
begin
if Edit1.Text='' then
begin
showmessage('请输入导入数据的位置');
exit;
end;
if ComboBox9.Text='' then
begin
showmessage('对不起!起始年份不能为空!请重新选择条件!');
exit;
end;
if ComboBox10.Text='' then
begin
showmessage('对不起!终止年份不能为空!请重新选择条件!');
exit;
end;
if (Length(ComboBox9.Text)<>4) or ((Length(ComboBox10.Text)<>4)) then
begin
showmessage('对不起!您选择的年份非法!请重新选择!');
exit;
end;
try
temp:=StrToInt(ComboBox9.Text);
except
showmessage('起始年份非法!请重新选择!');
exit;
end;
try
temp:=StrToInt(ComboBox10.Text);
except
showmessage('终止年份非法!请重新选择!');
exit;
end;
if (StrToInt(ComboBox9.Text)<1900) or (StrToInt(ComboBox9.Text)>3000) then
begin
showmessage('对不起!您选择的"起始年份"非法!请重新选择!');
exit;
end;
if (StrToInt(ComboBox10.Text)<1900) or (StrToInt(ComboBox10.Text)>3000) then
begin
showmessage('对不起!您选择的"终止年份"非法!请重新选择!');
exit;
end;
if StrToInt(ComboBox9.Text)>StrToInt(ComboBox10.Text) then
begin
showmessage('对不起!起始年份不能大于终止年份!请重新选择条件!');
exit;
end;
if ComboBox11.Text='' then
begin
showmessage('对不起!起始月份不能为空!请重新选择条件!');
exit;
end;
if ComboBox12.Text='' then
begin
showmessage('对不起!终止月份不能为空!请重新选择条件!');
exit;
end;
if StrToInt(ComboBox11.Text)>StrToInt(ComboBox12.Text) then
begin
showmessage('对不起!起始月份不能大于终止月份!请重新选择条件!');
exit;
end;
Application.CreateForm(THYLookImportData, HYLookImportData);
HYLookImportData.Label1.Caption:='公交行业月报导入数据浏览';
HYLookImportData.Edit1.Text:=ComboBox9.Text;
HYLookImportData.Edit2.Text:=ComboBox10.Text;
HYLookImportData.Edit3.Text:=ComboBox11.Text;
HYLookImportData.Edit4.Text:=ComboBox12.Text;
HYLookImportData.StatusBar1.Panels[0].Text:='行业代码: 7511';
HYLookImportData.StatusBar1.Panels[1].Text:='行业名称: 公交行业';
HYLookImportData.ADOQuery1.Connection:=ADOConnection1;
HYLookImportData.ADOQuery1.SQL.Clear;
HYLookImportData.ADOQuery1.SQL.Add('select a.统计年份 as 统计年份, a.统计月份 as 统计月份,'
+' b.指标名称 as 指标名称, b.指标代码 as 指标代码, b.单位 as 单位, a.本月实际 as 本月实际'
+' from 公交行业统计月报_z as a, 公交行业统计月报指标定义表 as b'
+' where a.统计年份>='+ComboBox9.Text+' and a.统计年份<='+ComboBox10.Text
+' and a.统计月份>='+ComboBox11.Text+' and a.统计月份<='+ComboBox12.Text
+' and a.指标代码=b.指标代码 ORDER BY a.统计年份,a.统计月份,b.指标代码');
HYLookImportData.ADOQuery1.Open;
HYLookImportData.ShowModal;
end;
procedure TTradeImportFrm.BitBtn10Click(Sender: TObject);
begin
if Edit1.Text='' then
begin
showmessage('请输入导入数据的位置');
exit;
end;
if ComboBox5.Text='' then
begin
showmessage('对不起!起始年份不能为空!请重新选择条件!');
exit;
end;
if ComboBox6.Text='' then
begin
showmessage('对不起!终止年份不能为空!请重新选择条件!');
exit;
end;
if (Length(ComboBox5.Text)<>4) or ((Length(ComboBox6.Text)<>4)) then
begin
showmessage('对不起!您选择的年份非法!请重新选择!');
exit;
end;
try
temp:=StrToInt(ComboBox5.Text);
except
showmessage('起始年份非法!请重新选择!');
exit;
end;
try
temp:=StrToInt(ComboBox6.Text);
except
showmessage('终止年份非法!请重新选择!');
exit;
end;
if (StrToInt(ComboBox5.Text)<1900) or (StrToInt(ComboBox5.Text)>3000) then
begin
showmessage('对不起!您选择的"起始年份"非法!请重新选择!');
exit;
end;
if (StrToInt(ComboBox6.Text)<1900) or (StrToInt(ComboBox6.Text)>3000) then
begin
showmessage('对不起!您选择的"终止年份"非法!请重新选择!');
exit;
end;
if StrToInt(ComboBox5.Text)>StrToInt(ComboBox6.Text) then
begin
showmessage('对不起!起始年份不能大于终止年份!请重新选择条件!');
exit;
end;
Application.CreateForm(THYLookImportData2, HYLookImportData2);
HYLookImportData2.Label1.Caption:='公交企业年报导入数据浏览';
HYLookImportData2.Edit1.Text:=ComboBox5.Text;
HYLookImportData2.Edit2.Text:=ComboBox6.Text;
HYLookImportData2.StatusBar1.Panels[0].Text:='行业代码: 7511';
HYLookImportData2.StatusBar1.Panels[1].Text:='行业名称: 公交行业';
HYLookImportData2.ADOQuery1.Connection:=ADOConnection1;
HYLookImportData2.ADOQuery1.SQL.Clear;
HYLookImportData2.ADOQuery1.SQL.Add('select a.企业代码 as 企业代码, a.统计年份 as 统计年份,b.指标名称 as 指标名称,'
+' b.指标代码 as 指标代码, b.单位 as 单位,a.全年实际 as 全年实际'
+' from 公交企业统计年报表_z as a, 公交行业统计年报指标定义表 as b'
+' where a.统计年份>='+ComboBox5.Text+' and a.统计年份<='+ComboBox6.Text
+' and a.指标代码=b.指标代码 ORDER BY a.企业代码, a.统计年份, b.指标代码');
HYLookImportData2.ADOQuery1.Open;
HYLookImportData2.ShowModal;
end;
procedure TTradeImportFrm.BitBtn11Click(Sender: TObject);
begin
if Edit1.Text='' then
begin
showmessage('请输入导入数据的位置');
exit;
end;
if ComboBox7.Text='' then
begin
showmessage('对不起!起始年份不能为空!请重新选择条件!');
exit;
end;
if ComboBox8.Text='' then
begin
showmessage('对不起!终止年份不能为空!请重新选择条件!');
exit;
end;
if (Length(ComboBox7.Text)<>4) or ((Length(ComboBox8.Text)<>4)) then
begin
showmessage('对不起!您选择的年份非法!请重新选择!');
exit;
end;
try
temp:=StrToInt(ComboBox7.Text);
except
showmessage('起始年份非法!请重新选择!');
exit;
end;
try
temp:=StrToInt(ComboBox8.Text);
except
showmessage('终止年份非法!请重新选择!');
exit;
end;
if (StrToInt(ComboBox7.Text)<1900) or (StrToInt(ComboBox7.Text)>3000) then
begin
showmessage('对不起!您选择的"起始年份"非法!请重新选择!');
exit;
end;
if (StrToInt(ComboBox8.Text)<1900) or (StrToInt(ComboBox8.Text)>3000) then
begin
showmessage('对不起!您选择的"终止年份"非法!请重新选择!');
exit;
end;
if StrToInt(ComboBox7.Text)>StrToInt(ComboBox8.Text) then
begin
showmessage('对不起!起始年份不能大于终止年份!请重新选择条件!');
exit;
end;
Application.CreateForm(THYLookImportData2, HYLookImportData2);
HYLookImportData2.Label1.Caption:='公交行业综合年报导入数据浏览';
HYLookImportData2.Edit1.Text:=ComboBox7.Text;
HYLookImportData2.Edit2.Text:=ComboBox8.Text;
HYLookImportData2.StatusBar1.Panels[0].Text:='行业代码: 7511';
HYLookImportData2.StatusBar1.Panels[1].Text:='行业名称: 公交行业';
HYLookImportData2.ADOQuery1.Connection:=ADOConnection1;
HYLookImportData2.ADOQuery1.SQL.Clear;
HYLookImportData2.ADOQuery1.SQL.Add('select a.统计年份 AS 统计年份 , b.指标名称 AS 指标名称,'
+' a.指标代码 AS 指标代码, b.单位 AS 单位, a.全年实际 AS 全年实际'
+' from 公交行业综合年报_z AS a, 公交行业综合年报指标定义表 AS b'
+' where a.统计年份>='+ComboBox7.Text+' and a.统计年份<='+ComboBox8.Text
+' and a.指标代码=b.指标代码 ORDER BY a.统计年份,b.指标代码');
HYLookImportData2.ADOQuery1.Open;
HYLookImportData2.ShowModal;
end;
procedure TTradeImportFrm.BitBtn15Click(Sender: TObject);
begin
if Edit1.Text='' then
begin
showmessage('请输入导入数据的位置');
exit;
end;
if ComboBox13.Text='' then
begin
showmessage('对不起!起始年份不能为空!请重新选择条件!');
exit;
end;
if ComboBox14.Text='' then
begin
showmessage('对不起!终止年份不能为空!请重新选择条件!');
exit;
end;
if (Length(ComboBox13.Text)<>4) or ((Length(ComboBox14.Text)<>4)) then
begin
showmessage('对不起!您选择的年份非法!请重新选择!');
exit;
end;
try
temp:=StrToInt(ComboBox13.Text);
except
showmessage('起始年份非法!请重新选择!');
exit;
end;
try
temp:=StrToInt(ComboBox14.Text);
except
showmessage('终止年份非法!请重新选择!');
exit;
end;
if (StrToInt(ComboBox13.Text)<1900) or (StrToInt(ComboBox13.Text)>3000) then
begin
showmessage('对不起!您选择的"起始年份"非法!请重新选择!');
exit;
end;
if (StrToInt(ComboBox14.Text)<1900) or (StrToInt(ComboBox14.Text)>3000) then
begin
showmessage('对不起!您选择的"终止年份"非法!请重新选择!');
exit;
end;
if StrToInt(ComboBox13.Text)>StrToInt(ComboBox14.Text) then
begin
showmessage('对不起!起始年份不能大于终止年份!请重新选择条件!');
exit;
end;
Application.CreateForm(THYLookImportData2, HYLookImportData2);
HYLookImportData2.Label1.Caption:='公交行业年报导入数据浏览';
HYLookImportData2.Edit1.Text:=ComboBox13.Text;
HYLookImportData2.Edit2.Text:=ComboBox14.Text;
HYLookImportData2.StatusBar1.Panels[0].Text:='行业代码: 7511';
HYLookImportData2.StatusBar1.Panels[1].Text:='行业名称: 公交行业';
HYLookImportData2.ADOQuery1.Connection:=ADOConnection1;
HYLookImportData2.ADOQuery1.SQL.Clear;
HYLookImportData2.ADOQuery1.SQL.Add('select a.统计年份 as 统计年份, b.指标名称 as 指标名称,'
+' b.指标代码 as 指标代码, b.单位 as 单位, a.全年实际 as 全年实际'
+' from 公交行业统计年报_z AS a, 公交行业统计年报指标定义表 as b'
+' where a.统计年份>='+ComboBox13.Text+' and a.统计年份<='+ComboBox14.Text
+' and a.指标代码=b.指标代码 ORDER BY a.统计年份,b.指标代码');
HYLookImportData2.ADOQuery1.Open;
HYLookImportData2.ShowModal;
end;
procedure TTradeImportFrm.BitBtn20Click(Sender: TObject);
begin
if Edit1.Text='' then
begin
showmessage('请输入导入数据的位置');
exit;
end;
if ComboBox15.Text='' then
begin
showmessage('对不起!起始年份不能为空!请重新选择条件!');
exit;
end;
if ComboBox16.Text='' then
begin
showmessage('对不起!终止年份不能为空!请重新选择条件!');
exit;
end;
if (Length(ComboBox15.Text)<>4) or ((Length(ComboBox16.Text)<>4)) then
begin
showmessage('对不起!您选择的年份非法!请重新选择!');
exit;
end;
try
temp:=StrToInt(ComboBox15.Text);
except
showmessage('起始年份非法!请重新选择!');
exit;
end;
try
temp:=StrToInt(ComboBox16.Text);
except
showmessage('终止年份非法!请重新选择!');
exit;
end;
if (StrToInt(ComboBox15.Text)<1900) or (StrToInt(ComboBox15.Text)>3000) then
begin
showmessage('对不起!
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -