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

📄 mc_chxxtj.pas

📁 异洲酒店管理系统
💻 PAS
📖 第 1 页 / 共 5 页
字号:
                              Query1.ParamByName('Date2').AsDateTime:=DateTimePicker2.DateTime;
                              //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 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]='经手人') then
                                  begin
                                       Query2.Params[0].AsString:=Edit1.Text;
                                  end
                               else
                                  begin
                                       Query2.Params[0].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.Params[0].AsString:=Edit1.Text;
                                  end
                               else
                                  begin
                                       Query1.Params[0].AsInteger:=StrToInt(Edit1.Text);
                                  end;
                              Query1.ParamByName('Date1').AsDateTime:=DateTimePicker1.DateTime;
                              Query1.ParamByName('Date2').AsDateTime:=DateTimePicker2.DateTime;
                             //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 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.Params[0].AsString:=Edit1.Text;
                                  end
                               else
                                  begin
                                       Query2.Params[0].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;//结束不等号
                 end;//-结束符号判断--------------------------------------------
//------------------------------------------------------------------------------------------------------
        end//checkbox2.Checked=True-------------------------------------
             {else
                begin
                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]='数量')
                                 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.Params[0].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.Params[0].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.Params[0].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;

⌨️ 快捷键说明

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