tradeoutputunit.~pas

来自「公交行业的管理系统」· ~PAS 代码 · 共 1,570 行 · 第 1/5 页

~PAS
1,570
字号
        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('对不起!您选择的"起始年份"非法!请重新选择!');
                exit;
        end;
        if (StrToInt(ComboBox16.Text)<1900) or (StrToInt(ComboBox16.Text)>3000) then
        begin
                showmessage('对不起!您选择的"终止年份"非法!请重新选择!');
                exit;
        end;
        if StrToInt(ComboBox15.Text)>StrToInt(ComboBox16.Text) then
        begin
                showmessage('对不起!"起始年份"不能大于"终止年份"!请重新选择条件!');
                exit;
        end;
        try
          Screen.Cursor:=crHourGlass;
          TradeTableToTableYear('gjhyzhyear.data','公交行业综合年报表');
          if judge=false then StrToInt('sf');
          TradeTableToTableYear('gjhyzhyear_z.data','公交行业综合年报_z');
          if judge=false then StrToInt('sf');
          showmessage('公交行业综合年报数据导出成功!');
          RichEdit1.Lines.Add('公交行业综合年报数据导出成功');
        except
          showmessage('数据导出失败!');
          RichEdit1.Lines.Add('公交行业综合年报表导出失败');
        end;
        Screen.Cursor:=crDefault;
end;

procedure TTradeOutputFrm.BitBtn22Click(Sender: TObject);
begin
        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('对不起!您选择的"起始年份"非法!请重新选择!');
                exit;
        end;
        if (StrToInt(ComboBox16.Text)<1900) or (StrToInt(ComboBox16.Text)>3000) then
        begin
                showmessage('对不起!您选择的"终止年份"非法!请重新选择!');
                exit;
        end;
        if StrToInt(ComboBox15.Text)>StrToInt(ComboBox16.Text) then
        begin
                showmessage('对不起!"起始年份"不能大于"终止年份"!请重新选择条件!');
                exit;
        end;
        Application.CreateForm(TLookImportData5, LookImportData5);

        LookImportData5.Label1.Caption:='公交行业综合年报导出数据浏览';
        LookImportData5.Edit1.Text:=ComboBox15.Text;
        LookImportData5.Edit2.Text:=ComboBox16.Text;
        LookImportData5.ADOQuery1.Connection:=BusTradeDataModule.ADOConnection1;
        LookImportData5.ADOQuery1.SQL.Clear;
        LookImportData5.ADOQuery1.SQL.Add('select a.统计年份 as 统计年份,b.指标名称 as 指标名称,'
                     +' b.指标代码 as 指标代码, b.单位 as 单位,a.全年实际 as 全年实际'
                     +' from 公交行业综合年报_z as a, 公交行业综合年报指标定义表 as b'
                     +' where a.统计年份>='+ComboBox15.Text+' and a.统计年份<='+ComboBox16.Text
                     +' and a.指标代码=b.指标代码 ORDER BY a.统计年份, b.指标代码');
        LookImportData5.ADOQuery1.Open;

        LookImportData5.ShowModal;
end;

procedure TTradeOutputFrm.BitBtn24Click(Sender: TObject);
begin
        if ComboBox17.Text='' then
        begin
                showmessage('对不起!"起始年份"不能为空!请重新选择条件!');
                exit;
        end;
        if ComboBox18.Text='' then
        begin
                showmessage('对不起!"终止年份"不能为空!请重新选择条件!');
                exit;
        end;
        if (Length(ComboBox17.Text)<>4) or (Length(ComboBox18.Text)<>4) then
        begin
                showmessage('对不起!您选择的年份非法!请重新选择!');
                exit;
        end;
        try
                temp:=StrToInt(ComboBox17.Text);
        except
                showmessage('起始年份非法!请重新选择!');
                exit;
        end;
        try
                temp:=StrToInt(ComboBox18.Text);
        except
                showmessage('终止年份非法!请重新选择!');
                exit;
        end;
        if (StrToInt(ComboBox17.Text)<1900) or (StrToInt(ComboBox17.Text)>3000) then
        begin
                showmessage('对不起!您选择的"起始年份"非法!请重新选择!');
                exit;
        end;
        if (StrToInt(ComboBox18.Text)<1900) or (StrToInt(ComboBox18.Text)>3000) then
        begin
                showmessage('对不起!您选择的"终止年份"非法!请重新选择!');
                exit;
        end;
        if StrToInt(ComboBox17.Text)>StrToInt(ComboBox18.Text) then
        begin
                showmessage('对不起!"起始年份"不能大于"终止年份"!请重新选择条件!');
                exit;
        end;
        Application.CreateForm(TLookImportData5, LookImportData5);

        LookImportData5.Label1.Caption:='公交行业城市交流指标表导出数据浏览';
        LookImportData5.Edit1.Text:=ComboBox17.Text;
        LookImportData5.Edit2.Text:=ComboBox18.Text;
        LookImportData5.ADOQuery1.Connection:=BusTradeDataModule.ADOConnection1;
        LookImportData5.ADOQuery1.SQL.Clear;
        LookImportData5.ADOQuery1.SQL.Add('select a.统计年份 as 统计年份,b.指标名称 as 指标名称,'
                     +' b.指标代码 as 指标代码, b.单位 as 单位,a.本年实际 as 本年实际'
                     +' from 公交行业城市交流指标表_z as a, 公交行业城市交流指标定义表 as b'
                     +' where  a.城市代码='+''''+'022'+''''+' and a.统计年份>='+ComboBox17.Text+' and a.统计年份<='+ComboBox18.Text
                     +' and a.指标代码=b.指标代码 ORDER BY a.统计年份, b.指标代码,a.城市代码');
        LookImportData5.ADOQuery1.Open;

        LookImportData5.ShowModal;
end;

procedure TTradeOutputFrm.BitBtn25Click(Sender: TObject);
begin
        judge:=true;
        {if(not CheckFileSuc)then
        begin
                showmessage('请选择导出文件!');
                exit;
        end;}
        if ComboBox17.Text='' then
        begin
                showmessage('对不起!"起始年份"不能为空!请重新选择条件!');
                exit;
        end;
        if ComboBox18.Text='' then
        begin
                showmessage('对不起!"终止年份"不能为空!请重新选择条件!');
                exit;
        end;
        if (Length(ComboBox17.Text)<>4) or (Length(ComboBox18.Text)<>4) then
        begin
                showmessage('对不起!您选择的年份非法!请重新选择!');
                exit;
        end;
        try
                temp:=StrToInt(ComboBox17.Text);
        except
                showmessage('起始年份非法!请重新选择!');
                exit;
        end;
        try
                temp:=StrToInt(ComboBox18.Text);
        except
                showmessage('终止年份非法!请重新选择!');
                exit;
        end;
        if (StrToInt(ComboBox17.Text)<1900) or (StrToInt(ComboBox17.Text)>3000) then
        begin
                showmessage('对不起!您选择的"起始年份"非法!请重新选择!');
                exit;
        end;
        if (StrToInt(ComboBox18.Text)<1900) or (StrToInt(ComboBox18.Text)>3000) then
        begin
                showmessage('对不起!您选择的"终止年份"非法!请重新选择!');
                exit;
        end;
        if StrToInt(ComboBox17.Text)>StrToInt(ComboBox18.Text) then
        begin
                showmessage('对不起!"起始年份"不能大于"终止年份"!请重新选择条件!');
                exit;
        end;
        try
          Screen.Cursor:=crHourGlass;
          TradeTableToTableYear('gjjlzb.data','公交行业城市交流指标表');
          if judge=false then StrToInt('sf');
          TradeTableToTableYear('gjjlzb_z.data','公交行业城市交流指标表_z');
          if judge=false then StrToInt('sf');
          showmessage('公交行业城市交流指标表数据导出成功!');
          RichEdit1.Lines.Add('公交行业城市交流指标表导出成功');
        except
          showmessage('数据导出失败!');
          RichEdit1.Lines.Add('公交行业城市交流指标表导出失败');
        end;
        Screen.Cursor:=crDefault;
end;

procedure TTradeOutputFrm.BitBtn27Click(Sender: TObject);
begin
        judge:=true;
        {if(not CheckFileSuc)then
        begin
                showmessage('请选择导出文件!');
                exit;
        end;}
        if ComboBox19.Text='' then
        begin
                showmessage('对不起!"起始年份"不能为空!请重新选择条件!');
                exit;
        end;
        if ComboBox20.Text='' then
        begin
                showmessage('对不起!"终止年份"不能为空!请重新选择条件!');
                exit;
        end;
        if (Length(ComboBox19.Text)<>4) or (Length(ComboBox20.Text)<>4) then
        begin
                showmessage('对不起!您选择的年份非法!请重新选择!');
                exit;
        end;
        try
                temp:=StrToInt(ComboBox19.Text);
        except
                showmessage('起始年份非法!请重新选择!');
                exit;
        end;
        try
                temp:=StrToInt(ComboBox20.Text);
        except
                showmessage('终止年份非法!请重新选择!');
                exit;
        end;
        if (StrToInt(ComboBox19.Text)<1900) or (StrToInt(ComboBox19.Text)>3000) then
        begin
                showmessage('对不起!您选择的"起始年份"非法!请重新选择!');
                exit;
        end;
        if (StrToInt(ComboBox20.Text)<1900) or (StrToInt(ComboBox20.Text)>3000) then
        begin
                showmessage('对不起!您选择的"终止年份"非法!请重新选择!');
                exit;
        end;
        if StrToInt(ComboBox19.Text)>StrToInt(ComboBox20.Text) then
        begin
                showmessage('对不起!"起始年份"不能大于"终止年份"!请重新选择条件!');
                exit;
        end;
        try
          Screen.Cursor:=crHourGlass;
          TradeTableToTableYear('gjscale.data','公交行业城市规模指标表');
          if judge=false then StrToInt('sf');
          TradeTableToTableYear('gjscale_z.data','公交行业城市规模指标表_z');
          if judge=false then StrToInt('sf');
          showmessage('公交行业城市规模指标表数据导出成功!');
          RichEdit1.Lines.Add('公交行业城市规模指标表导出成功');
        except
          showmessage('数据导出失败!');
          RichEdit1.Lines.Add('公交行业城市规模指标表导出失败');
        end;
        Screen.Cursor:=crDefault;
end;

procedure TTradeOutputFrm.BitBtn26Click(Sender: TObjec

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?