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

📄 jh_find_unit.pas

📁 044一通进销存 后缀名是.dfm
💻 PAS
📖 第 1 页 / 共 2 页
字号:
      0:
        begin
           if checkbox3.Checked  then
            begin
             adoq1.SQL.Add('select * from jhthd where 单据编码=:yhbh and 录单日期 between #'+edit8.text+ '# and #' +edit9.text+'# order by 编号');
             adoq1.Parameters.ParamByName('yhbh').Value :=edit3.Text ;
            end
          else
           begin
            adoq1.SQL.Add('select * from jhthd where 单据编码=:yhbh order by 编号');
            adoq1.Parameters.ParamByName('yhbh').Value :=edit3.Text;
           end;
         end;
       1:
         if checkbox3.Checked  then
          begin
             adoq1.SQL.Add('select * from jhthd where 单据编码 like :yhbh2 and 录单日期 between #'+edit8.text+ '# and #' +edit9.text+'# order by 编号');
             adoq1.Parameters.ParamByName('yhbh2').Value :=edit3.Text+'%' ;
          end
          else
         begin
          adoq1.SQL.Add('select * from jhthd where 单据编码 like :yhbh2 order by 编号');
          adoq1.Parameters.ParamByName('yhbh2').Value :=edit3.Text+'%';
         end;
        end;
   end;
    1:
     begin
     case combobox6.ItemIndex of
      0:
        begin
           if checkbox3.Checked  then
            begin
             adoq1.SQL.Add('select * from jhthd where 供货商名称=:bh and 录单日期 between #'+edit8.text+ '# and #' +edit9.text+'# order by 编号');
             adoq1.Parameters.ParamByName('bh').Value :=edit3.Text ;
            end
          else
           begin
            adoq1.SQL.Add('select * from jhthd where 供货商名称=:bh order by 编号');
            adoq1.Parameters.ParamByName('bh').Value :=edit3.Text;
           end;
         end;
       1:
         if checkbox3.Checked  then
          begin
             adoq1.SQL.Add('select * from jhthd where 供货商名称 like :bh2 and 录单日期 between #'+edit8.text+ '# and #' +edit9.text+'# order by 编号');
             adoq1.Parameters.ParamByName('bh2').Value :=edit3.Text+'%' ;
          end
          else
         begin
          adoq1.SQL.Add('select * from jhthd where 供货商名称 like :bh2 order by 编号');
          adoq1.Parameters.ParamByName('bh2').Value :=edit3.Text+'%';
         end;
        end;
   end;
  2:
   begin
     case combobox6.itemIndex of
      0:
        begin
        if checkbox3.Checked  then
          begin
             adoq1.SQL.Add('select * from jhthd where 经手人=:mc and 录单日期 between #'+edit8.text+ '# and #' +edit9.text+'# order by 编号');
             adoq1.Parameters.ParamByName('mc').Value :=edit3.Text ;
           end
          else
           begin
            adoq1.SQL.Add('select * from jhd where 经手人=:mc order by 编号');
            adoq1.Parameters.ParamByName('mc').Value :=edit3.Text;
            end;
           end;
          1:
         if checkbox3.Checked  then
          begin
             adoq1.SQL.Add('select * from jhthd where 经手人 like :mc and 录单日期 between #'+edit8.text+ '# and #' +edit9.text+'# order by 编号');
             adoq1.Parameters.ParamByName('mc').Value :=edit3.Text+'%' ;
          end
          else
         begin
          adoq1.SQL.Add('select * from jhthd where 经手人 like :mc order by 编号');
          adoq1.Parameters.ParamByName('mc').Value :=edit3.Text+'%';
         end;
         end;
end;
//end
else
    begin
     adoq1.SQL.Clear ;
     adoq1.SQL.Add('select * from jhthd order by 编号 ');
  end;
end;
adoq1.Active :=true;
datas2.DataSet :=nil;
datas2.DataSet :=adoq1;
dbgrid2.DataSource :=datas2;
end;

end;

procedure Tjh_find_form.FormCreate(Sender: TObject);
begin
self.Top :=74;
self.Left :=11;
self.Height :=491;
self.Width :=767;
self.PageControl1.ActivePageIndex :=0;
end;

procedure Tjh_find_form.SpeedButton6Click(Sender: TObject);
begin
close;
end;

procedure Tjh_find_form.SpeedButton8Click(Sender: TObject);
begin
close;
end;

procedure Tjh_find_form.SpeedButton21Click(Sender: TObject);
begin
with database do
begin
adoq1.Connection :=adoc;
adoq1.SQL.Clear ;
edit4.Text :=formatdatetime('MM-dd-yy',datetimepicker3.date);
edit5.Text :=formatdatetime('MM-dd-yy',datetimepicker4.date);

case combobox4.ItemIndex of
    0:
     begin
     case combobox5.ItemIndex of
      0:
        begin
           if checkbox2.Checked  then
            begin
             //edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
             //edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
             adoq1.SQL.Add('select * from jhd where 单据编码=:yhbh and 录单日期 between #'+edit4.text+ '# and #' +edit5.text+'# order by 编号');
             adoq1.Parameters.ParamByName('yhbh').Value :=edit1.Text ;
            end
          else
           begin
            adoq1.SQL.Add('select * from jhd where 单据编码=:yhbh order by 编号');
            adoq1.Parameters.ParamByName('yhbh').Value :=edit1.Text;
           end;
         end;
       1:
         if checkbox2.Checked  then
          begin
             //edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
             //edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
             adoq1.SQL.Add('select * from jhd where 单据编码 like :yhbh2 and 录单日期 between #'+edit4.text+ '# and #' +edit5.text+'# order by 编号');
             adoq1.Parameters.ParamByName('yhbh2').Value :=edit1.Text+'%' ;
          end
          else
         begin
          adoq1.SQL.Add('select * from jhd where 单据编码 like :yhbh2 order by 编号');
          adoq1.Parameters.ParamByName('yhbh2').Value :=edit1.Text+'%';
         end;
        end;
   end;
    1:
     begin
     case combobox5.ItemIndex of
      0:
        begin
           if checkbox2.Checked  then
            begin
             //edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
             //edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
             adoq1.SQL.Add('select * from jhd where 供货商名称=:bh and 录单日期 between #'+edit4.text+ '# and #' +edit5.text+'# order by 编号');
             adoq1.Parameters.ParamByName('bh').Value :=edit1.Text ;
            end
          else
           begin
            adoq1.SQL.Add('select * from jhd where 供货商名称=:bh order by 编号');
            adoq1.Parameters.ParamByName('bh').Value :=edit1.Text;
           end;
         end;
       1:
         if checkbox2.Checked  then
          begin
            // edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
            // edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
             adoq1.SQL.Add('select * from jhd where 供货商名称 like :bh2 and 录单日期 between #'+edit4.text+ '# and #' +edit5.text+'# order by 编号');
             adoq1.Parameters.ParamByName('bh2').Value :=edit1.Text+'%' ;
          end
          else
         begin
          adoq1.SQL.Add('select * from jhd where 供货商名称 like :bh2 order by 编号');
          adoq1.Parameters.ParamByName('bh2').Value :=edit1.Text+'%';
         end;
        end;
   end;
  2:
   begin
     case combobox5.ItemIndex of
      0:
        begin
        if checkbox2.Checked  then
          begin
             //edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
             //edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
             adoq1.SQL.Add('select * from jhd where 经手人=:mc and 录单日期 between #'+edit4.text+ '# and #' +edit5.text+'# order by 编号');
             adoq1.Parameters.ParamByName('mc').Value :=edit1.Text ;
           end
          else
           begin
            adoq1.SQL.Add('select * from jhd where 经手人=:mc order by 编号');
            adoq1.Parameters.ParamByName('mc').Value :=edit1.Text;
            end;
           end;
          1:
         if checkbox2.Checked  then
          begin
             //edit2.Text :=formatdatetime('MM-dd-yy',datetimepicker1.date);
             //edit3.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
             adoq1.SQL.Add('select * from jhd where 经手人 like :mc and 录单日期 between #'+edit4.text+ '# and #' +edit5.text+'# order by 编号');
             adoq1.Parameters.ParamByName('mc').Value :=edit1.Text+'%' ;
          end
          else
         begin
          adoq1.SQL.Add('select * from jhd where 经手人 like :mc order by 编号');
          adoq1.Parameters.ParamByName('mc').Value :=edit1.Text+'%';
         end;
         end;
end;
//end
else
    begin
     adoq1.SQL.Clear ;
     adoq1.SQL.Add('select * from jhd order by 编号 ');
  end;
end;
adoq1.Active :=true;
datas2.DataSet :=nil;
datas2.DataSet :=adoq1;
dbgrid3.DataSource :=datas2;
end;

end;

end.

⌨️ 快捷键说明

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