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

📄 mc_jhxxtj.pas

📁 异洲酒店管理系统
💻 PAS
📖 第 1 页 / 共 3 页
字号:
           Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' DESC');
      end;
   if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
       begin
            Query1.ParamByName('B').AsString:=Edit1.Text;
       End
    Else
       begin
            Query1.ParamByName('B').AsInteger:=StrToInt(Edit1.Text);
       end;
   Query1.ParamByName('Date1').AsDateTime:=DateTimePicker1.DateTime;
   Query1.ParamByName('Date2').AsDateTime:=DateTimePicker2.DateTime;
   Query1.Open;
   Query2.Close;
   Query2.SQL.Clear;
   Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 进货信息历史表');
   if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
      Query2.SQL.Add('Where 经受人 < :B and 进货日期>:Date1 and 进货日期<:Date2')
   Else
      Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' < :B and 进货日期>:Date1 and 进货日期<:Date2');
   if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
       begin
            Query2.ParamByName('B').AsString:=Edit1.Text;
       End
    Else
       begin
            Query2.ParamByName('B').AsInteger:=StrToInt(Edit1.Text);
       end;
   Query2.ParamByName('Date1').AsDateTime:=DateTimePicker1.DateTime;
   Query2.ParamByName('Date2').AsDateTime:=DateTimePicker2.DateTime;
   //Query2.Params[0].AsString:=Edit1.Text;
   Query2.Open;
   Label3.Caption:=Query2.Fields[0].AsString+'种';
   Label5.Caption:=IntToStr(Query1.RecordCount);
   Label7.Caption:=Query2.FieldS[1].AsString;
   Label9.Caption:=Query2.Fields[2].AsString;
   Query2.Close;
end;//结束小于号
if ComboBox4.Items[ComboBox4.ItemIndex]='<>' then
begin
  Query1.Close;
  Query1.SQL.Clear;
  if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
     Query1.SQL.Add('Select * From 进货信息历史表 where 经受人 <> :B and 进货日期>:Date1 and 进货日期<:Date2')
  Else
     Query1.SQL.Add('Select * From 进货信息历史表 where '+ComboBox3.Items[ComboBox3.ItemIndex]+' <> :B and 进货日期>:Date1 and 进货日期<:Date2');
  if cc='ASC' then
     begin
          Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' ASC');
     End
  Else
     begin
          Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' DESC');
     end;
   if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
       begin
            Query1.ParamByName('B').AsString:=Edit1.Text;
       End
    Else
       begin
            Query1.ParamByName('B').AsInteger:=StrToInt(Edit1.Text);
       end;
   Query1.ParamByName('Date1').AsDateTime:=DateTimePicker1.DateTime;
   Query1.ParamByName('Date2').AsDateTime:=DateTimePicker2.DateTime;
  Query1.Open;
  Query2.Close;
  Query2.SQL.Clear;
  Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 进货信息历史表');
  if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
     Query2.SQL.Add('Where 经受人 <> :B and 进货日期>:Date1 and 进货日期<:Date2')
  Else
     Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' <> :B and 进货日期>:Date1 and 进货日期<:Date2');
   if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
       begin
            Query2.ParamByName('B').AsString:=Edit1.Text;
       End
    Else
       begin
            Query2.ParamByName('B').AsInteger:=StrToInt(Edit1.Text);
       end;
   Query2.ParamByName('Date1').AsDateTime:=DateTimePicker1.DateTime;
   Query2.ParamByName('Date2').AsDateTime:=DateTimePicker2.DateTime;
  Query2.Open;
  Label3.Caption:=Query2.Fields[0].AsString+'种';
  Label5.Caption:=IntToStr(Query1.RecordCount);
  Label7.Caption:=Query2.FieldS[1].AsString;
  Label9.Caption:=Query2.Fields[2].AsString;
  Query2.Close;
end;//结束不等号
end;//-结束符号判断
end
//-结束时间
Else
If CheckBox2.Checked = True Then
begin
if ComboBox4.text='Like' then
begin
if Edit1.text='*' then
begin
   Query1.Close;
   Query1.SQL.Clear;
   if cc='ASC' then Query1.SQL.Add('select * From 进货信息历史表 ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' ASC')
   else Query1.SQL.Add('select * From 进货信息历史表 ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' DESC');
   Query1.Open;
   Query2.Close;
   Query2.SQL.Clear;
   Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 进货信息历史表');
   Query2.Open;
   Label3.Caption:=Query2.Fields[0].AsString+'种';
   Label5.Caption:=IntToStr(Query1.RecordCount);
   Label7.Caption:=Query2.FieldS[1].AsString;
   Label9.Caption:=Query2.Fields[2].AsString;
   Query2.Close;
End
Else
begin
   if (ComboBox3.Items[ComboBox3.ItemIndex]='单据编号') or (ComboBox3.Items[ComboBox3.ItemIndex]='商品编号') or (ComboBox3.Items[ComboBox3.ItemIndex]='数量')
      or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库编号') then
      begin
        Query1.Close;
        Query1.SQL.Clear;
        Query1.SQL.Add('Select * From 进货信息历史表 where '+ComboBox3.Items[ComboBox3.ItemIndex]+' Like :A');
        if cc='ASC' then
           begin
                Query1.SQL.Add('ORDER BY '+ComboBox3.Items[ComboBox3.ItemIndex]+' ASC');
           End
        Else
           begin
                 Query1.SQL.Add('ORDER BY '+ComboBox3.Items[ComboBox3.ItemIndex]+' DESC');
           end;
        Query1.ParamByName('A').AsString:=Edit1.Text+'%';
        Query1.Open;
        Query2.Close;
        Query2.SQL.Clear;
        Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 进货信息历史表');
        Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' Like :A');
        Query2.Params[0].AsString:=Edit1.Text+'%';
        Query2.Open;
        Label3.Caption:=Query2.Fields[0].AsString+'种';
        Label5.Caption:=IntToStr(Query1.RecordCount);
        Label7.Caption:=Query2.FieldS[1].AsString;
        Label9.Caption:=Query2.Fields[2].AsString;
        Query2.Close;
      end;//结束判断字段为整形
   if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
       begin
        if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
           begin
             Query1.Close;
             Query1.SQL.Clear;
             Query1.SQL.Add('Select * From 进货信息历史表 where 经受人 Like :A');
             if cc='ASC' then
                begin
                     Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' ASC');
                End
             Else
                begin
                      Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' DESC');
                end;
             Query1.ParamByName('A').AsString:=Edit1.Text+'%';
             Query1.Open;
             Query2.Close;
             Query2.SQL.Clear;
             Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 进货信息历史表');
             Query2.SQL.Add('Where 经受人 Like :A');
             Query2.Params[0].AsString:=Edit1.Text+'%';
             Query2.Open;
             Label3.Caption:=Query2.Fields[0].AsString+'种';
             Label5.Caption:=IntToStr(Query1.RecordCount);
             Label7.Caption:=Query2.FieldS[1].AsString;
             Label9.Caption:=Query2.Fields[2].AsString;
             Query2.Close;
          end//结束判断字段为字符型[经受人]
        Else
           begin
         Query1.Close;
         Query1.SQL.Clear;
         Query1.SQL.Add('Select * From 进货信息历史表 where '+ComboBox3.Items[ComboBox3.ItemIndex]+' Like :A');
         if cc='ASC' then
            begin
                 Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' ASC');
            End
         Else
            begin
                 Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' DESC');
            end;
         Query1.ParamByName('A').AsString:=Edit1.Text+'%';
         Query1.Open;
         Query2.Close;
         Query2.SQL.Clear;
         Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 进货信息历史表');
         Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' Like :A');
         Query2.Params[0].AsString:=Edit1.Text+'%';
         Query2.Open;
         Label3.Caption:=Query2.Fields[0].AsString+'种';
         Label5.Caption:=IntToStr(Query1.RecordCount);
         Label7.Caption:=Query2.FieldS[1].AsString;
         Label9.Caption:=Query2.Fields[2].AsString;
         Query2.Close;
    end;
   end;//结束判断字段为字符型
end;//结束Edit1.Text不为*
end//结束Like------------------------------
Else
begin//开始不等符号判断
if ComboBox4.Items[ComboBox4.ItemIndex]='=' then
begin
   Query1.Close;
   Query1.SQL.Clear;
   if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
      Query1.SQL.Add('Select * From 进货信息历史表 where 经受人 = :B')
   Else
      Query1.SQL.Add('Select * From 进货信息历史表 where '+ComboBox3.Items[ComboBox3.ItemIndex]+' = :B');
   if cc='ASC' then
      begin
           Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' ASC');
      End
   Else
      begin
           Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' DESC');
      end;
   if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
      begin
           Query1.ParamByName('B').AsString:=Edit1.Text;
      End
   Else
      begin
           Query1.ParamByName('B').AsInteger:=StrToInt(Edit1.Text);
      end;
   Query1.Open;
   Query2.Close;
   Query2.SQL.Clear;
   Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 进货信息历史表');
   if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
      Query2.SQL.Add('Where 经受人 = :B')
   Else
      Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' = :B');
   if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
       begin
            Query2.Params[0].AsString:=Edit1.Text;
       End
    Else
       begin
            Query2.Params[0].AsInteger:=StrToInt(Edit1.Text);
       end;
   Query2.Open;
   Label3.Caption:=Query2.Fields[0].AsString+'种';
   Label5.Caption:=IntToStr(Query1.RecordCount);
   Label7.Caption:=Query2.FieldS[1].AsString;
   Label9.Caption:=Query2.Fields[2].AsString;
   Query2.Close;
end;//结束等号判断
if ComboBox4.Items[ComboBox4.ItemIndex]='>' then
begin
  Query1.Close;
  Query1.SQL.Clear;
  if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
     Query1.SQL.Add('Select * From 进货信息历史表 where 经受人 > :B')
  Else
     Query1.SQL.Add('Select * From 进货信息历史表 where '+ComboBox3.Items[ComboBox3.ItemIndex]+' > :B');
  if cc='ASC' then
     begin
          Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' ASC');
     End
  Else
     begin
          Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' DESC');
     end;
   if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
       begin
            Query1.Params[0].AsString:=Edit1.Text;
       End
    Else
       begin
            Query1.Params[0].AsInteger:=StrToInt(Edit1.Text);
       end;
  Query1.Open;
  Query2.Close;
  Query2.SQL.Clear;
  Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 进货信息历史表');
  if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
     Query2.SQL.Add('Where 经受人 > :B')
  Else
     Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' > :B');
   if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
       begin
            Query2.Params[0].AsString:=Edit1.Text;
       End
    Else
       begin
            Query2.Params[0].AsInteger:=StrToInt(Edit1.Text);
       end;
  //Query2.Params[0].AsString:=Edit1.Text;
  Query2.Open;
  Label3.Caption:=Query2.Fields[0].AsString+'种';
  Label5.Caption:=IntToStr(Query1.RecordCount);
  Label7.Caption:=Query2.FieldS[1].AsString;
  Label9.Caption:=Query2.Fields[2].AsString;
  Query2.Close;
end;//结束大于号
if ComboBox4.Items[ComboBox4.ItemIndex]='<' then
begin
   Query1.Close;
   Query1.SQL.Clear;
   if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
      Query1.SQL.Add('Select * From 进货信息历史表 where 经受人 < :B')
   Else
      Query1.SQL.Add('Select * From 进货信息历史表 where '+ComboBox3.Items[ComboBox3.ItemIndex]+' < :B');
   if cc='ASC' then
      begin
           Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' ASC');
      End
   Else
      begin
           Query1.SQL.Add('ORDER BY '+ComboBox1.Items[ComboBox1.ItemIndex]+' DESC');
      end;
   if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
       begin
            Query1.Params[0].AsString:=Edit1.Text;
       End
    Else
       begin
            Query1.Params[0].AsInteger:=StrToInt(Edit1.Text);
       end;
   //Query1.Params[0].AsString:=Edit1.Text;
   Query1.Open;
   Query2.Close;
   Query2.SQL.Clear;
   Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 进货信息历史表');
   if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
      Query2.SQL.Add('Where 经受人 < :B')
   Else
      Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' < :B');
   if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
       begin
            Query2.Params[0].AsString:=Edit1.Text;
       End
    Else
       begin
            Query2.Params[0].AsInteger:=StrToInt(Edit1.Text);
       end;
   Query2.Open;
   Label3.Caption:=Query2.Fields[0].AsString+'种';
   Label5.Caption:=IntToStr(Query1.RecordCount);
   Label7.Caption:=Query2.FieldS[1].AsString;
   Label9.Caption:=Query2.Fields[2].AsString;
   Query2.Close;
end;//结束小于号
if ComboBox4.Items[ComboBox4.ItemIndex]='<>' then

⌨️ 快捷键说明

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