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

📄 mc_chxxtj.pas

📁 异洲酒店管理系统
💻 PAS
📖 第 1 页 / 共 5 页
字号:
                                               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.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.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]='经手人') 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.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.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 出货信息历史表');

⌨️ 快捷键说明

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