⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tradeimportunit.~pas

📁 公交行业的管理系统
💻 ~PAS
📖 第 1 页 / 共 5 页
字号:
          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;
          try
                YearFrom:=ComboBox9.Text;
                YearTo:=ComboBox10.Text;
                MonthFrom:=ComboBox11.Text;
                MonthTo:=ComboBox12.Text;
                Screen.Cursor:=crHourGlass;
                TableToTableMonthHY('gjhymonth.data','公交行业统计月报表');
                if judge=false then StrToInt('sf');
                TableToTableMonthHY('gjhymonth_z.data','公交行业统计月报_z');
                if judge=false then StrToInt('sf');
                showmessage('数据导入成功!');
                RichEdit1.Lines.Add('公交行业统计月报表导入成功');
           except
                showmessage('数据导入失败!');
                RichEdit1.Lines.Add('公交行业统计月报表导入失败');
           end;
           Screen.Cursor:=crDefault;
end;

procedure TTradeImportFrm.BitBtn16Click(Sender: TObject);
begin
           judge:=true;
           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;
           try
                YearFrom:=ComboBox13.Text;
                YearTo:=ComboBox14.Text;
                Screen.Cursor:=crHourGlass;
                TableToTableYearHY('gjhyyear.data','公交行业统计年报表');
                if judge=false then StrToInt('sf');
                TableToTableYearHY('gjhyyear_z.data','公交行业统计年报_z');
                if judge=false then StrToInt('sf');
                showmessage('数据导入成功!');
                RichEdit1.Lines.Add('公交行业统计年报表导入成功');
           except
                showmessage('数据导入失败!');
                RichEdit1.Lines.Add('公交行业统计年报表导入失败');
           end;
           Screen.Cursor:=crDefault;
end;

procedure TTradeImportFrm.BitBtn12Click(Sender: TObject);
begin
           judge:=true;
           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;
           try
                YearFrom:=ComboBox7.Text;
                YearTo:=ComboBox8.Text;
                Screen.Cursor:=crHourGlass;
                TableToTableYearHY('gjhyzhyear.data','公交行业综合年报表');
                if judge=false then StrToInt('sf');
                TableToTableYearHY('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 TTradeImportFrm.BitBtn1Click(Sender: TObject);
begin
        TabSheet1.TabVisible:=True;
        TabSheet2.TabVisible:=FALSE;
        TabSheet3.TabVisible:=FALSE;
        TabSheet4.TabVisible:=FALSE;
        TabSheet5.TabVisible:=True;
        TabSheet6.TabVisible:=FALSE;
        TabSheet7.TabVisible:=FALSE;
        TabSheet8.TabVisible:=False;
        TabSheet9.TabVisible:=False;
        PageControl1.ActivePage:=TabSheet5;
end;

procedure TTradeImportFrm.BitBtn4Click(Sender: TObject);
begin
        TabSheet1.TabVisible:=True;
        TabSheet2.TabVisible:=True;
        TabSheet3.TabVisible:=FALSE;
        TabSheet4.TabVisible:=FALSE;
        TabSheet5.TabVisible:=FALSE;
        TabSheet6.TabVisible:=FALSE;
        TabSheet7.TabVisible:=FALSE;
        TabSheet8.TabVisible:=False;
        TabSheet9.TabVisible:=False;
        PageControl1.ActivePage:=TabSheet2;
end;

procedure TTradeImportFrm.BitBtn5Click(Sender: TObject);
begin
        TabSheet1.TabVisible:=True;
        TabSheet2.TabVisible:=FALSE;
        TabSheet3.TabVisible:=True;
        TabSheet4.TabVisible:=FALSE;
        TabSheet5.TabVisible:=FALSE;
        TabSheet6.TabVisible:=FALSE;
        TabSheet7.TabVisible:=FALSE;
        TabSheet8.TabVisible:=False;
        TabSheet9.TabVisible:=False;
        PageControl1.ActivePage:=TabSheet3;
end;

procedure TTradeImportFrm.BitBtn3Click(Sender: TObject);
begin
        TabSheet1.TabVisible:=True;
        TabSheet2.TabVisible:=FALSE;
        TabSheet3.TabVisible:=FALSE;
        TabSheet4.TabVisible:=True;
        TabSheet5.TabVisible:=FALSE;
        TabSheet6.TabVisible:=FALSE;
        TabSheet7.TabVisible:=FALSE;
        TabSheet8.TabVisible:=False;
        TabSheet9.TabVisible:=False;
        PageControl1.ActivePage:=TabSheet4;
end;

procedure TTradeImportFrm.BitBtn2Click(Sender: TObject);
begin
        TabSheet1.TabVisible:=True;
        TabSheet2.TabVisible:=FALSE;
        TabSheet3.TabVisible:=FALSE;
        TabSheet4.TabVisible:=FALSE;
        TabSheet5.TabVisible:=FALSE;
        TabSheet6.TabVisible:=True;
        TabSheet7.TabVisible:=FALSE;
        TabSheet8.TabVisible:=False;
        TabSheet9.TabVisible:=False;
        PageControl1.ActivePage:=TabSheet6;
end;

procedure TTradeImportFrm.BitBtn6Click(Sender: TObject);
begin
        TabSheet1.TabVisible:=True;
        TabSheet2.TabVisible:=FALSE;
        TabSheet3.TabVisible:=FALSE;
        TabSheet4.TabVisible:=FALSE;
        TabSheet5.TabVisible:=FALSE;
        TabSheet6.TabVisible:=FALSE;
        TabSheet7.TabVisible:=True;
        TabSheet8.TabVisible:=False;
        TabSheet9.TabVisible:=False;
        PageControl1.ActivePage:=TabSheet7;
end;

procedure TTradeImportFrm.BitBtn9Click(Sender: TObject);
begin
        if Edit1.Text='' then
        begin
                showmessage('请输入导入数据的位置');
                exit;
        end;
        if ComboBox1.Text='' then
        begin
                showmessage('对不起!起始年份不能为空!请重新选择条件!');
                exit;
        end;
        if ComboBox2.Text='' then
        begin
                showmessage('对不起!终止年份不能为空!请重新选择条件!');
                exit;
        end;
        if (Length(ComboBox1.Text)<>4) or ((Length(ComboBox2.Text)<>4)) then
        begin
                showmessage('对不起!您选择的年份非法!请重新选择!');
                exit;
        end;
        try
                temp:=StrToInt(ComboBox1.Text);
        except
                showmessage('起始年份非法!请重新选择!');
                exit;
        end;
        try
                temp:=StrToInt(ComboBox2.Text);
        except
                showmessage('终止年份非法!请重新选择!');
                exit;
        end;
        if (StrToInt(ComboBox1.Text)<1900) or (StrToInt(ComboBox1.Text)>3000) then
        begin
                showmessage('对不起!您选择的"起始年份"非法!请重新选择!');
                exit;
        end;
        if (StrToInt(ComboBox2.Text)<1900) or (StrToInt(ComboBox2.Text)>3000) then
        begin
                showmessage('对不起!您选择的"终止年份"非法!请重新选择!');
                exit;
        end;
        if StrToInt(ComboBox1.Text)>StrToInt(ComboBox2.Text) then
        begin
                showmessage('对不起!起始年份不能大于终止年份!请重新选择条件!');
                exit;
        end;
        if ComboBox3.Text='' then
        begin
                showmessage('对不起!起始月份不能为空!请重新选择条件!');
                exit;
        end;
        if ComboBox4.Text='' then
        begin
                showmessage('对不起!终止月份不能为空!请重新选择条件!');
                exit;
        end;
        if StrToInt(ComboBox3.Text)>StrToInt(ComboBox4.Text) then
        begin
                showmessage('对不起!起始月份不能大于终止月份!请重新选择条件!');
                exit;
        end;
        Application.CreateForm(THYLookImportData, HYLookImportData);

        HYLookImportData.Label1.Caption:='公交企业月报导入数据浏览';
        HYLookImportData.Edit1.Text:=ComboBox1.Text;
        HYLookImportData.Edit2.Text:=ComboBox2.Text;
        HYLookImportData.Edit3.Text:=ComboBox3.Text;
        HYLookImportData.Edit4.Text:=ComboBox4.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 统计年份, a.统计月份 AS 统计月份,'
                     +' b.指标名称 AS 指标名称, b.指标代码 AS 指标代码, b.单位 AS 单位, a.本月实际 AS 本月实际'
                     +' from 公交企业统计月报表_z AS a, 公交企业统计月报指标定义表 AS b'
                     +' where a.统计年份>='+ComboBox1.Text+' and a.统计年份<='+ComboBox2.Text+' and a.统计月份>='+ComboBox3.Text
                     +' and a.统计月份<='+ComboBox4.Text+' and a.指标代码=b.指标代码'
                     +' ORDER BY a.企业代码, a.统计年份,a.统计月份,b.指标代码');

⌨️ 快捷键说明

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