• 大小: 191KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-08
  • 语言: C#
  • 标签: 动态  查询  条件  

资源简介

用C#编写,WINFORM版,可以动态加载需要查询的条件,并且可以自己添加多个条件,逻辑关系可以自己动态组合,比较灵活。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DynamicQuery
{
    public partial class DynamicQuery : Form
    {
        public DynamicQuery()
        {
            InitializeComponent();
        }


        #region 联合查询操作
        #region  联合查询通用操作
        private void SetFilterCondition(ref ComboBox conditionselect)
        {
            try
            {
                for (int i = 0; i < this.fpl.Controls.Count; i++)
                {
                    if (conditionselect.Name == “cbSelect“ + i.ToString())
                    {
                        if (conditionselect.Text == “时间“)
                        {
                            if (this.Controls.Find(“fplFilter“ + i true).Length > 0)
                                this.Controls.Find(“fplFilter“ + i true)[0].Visible = true;
                            if (this.Controls.Find(“txtFilter“ + i true).Length > 0)
                                this.Controls.Find(“txtFilter“ + i true)[0].Visible = false;
                            if (this.Controls.Find(“cbFilter“ + i true).Length > 0)
                                this.Controls.Find(“cbFilter“ + i true)[0].Visible = false;
                        }
                        else if (conditionselect.Text == “供应商名称“)//在通用中需要修改或添加
                        {
                            if (this.Controls.Find(“fplFilter“ + i true).Length > 0)
                                this.Controls.Find(“fplFilter“ + i true)[0].Visible = false;
                            if (this.Controls.Find(“txtFilter“ + i true).Length > 0)
                                this.Controls.Find(“txtFilter“ + i true)[0].Visible = false;
                            if (this.Controls.Find(“cbFilter“ + i true).Length > 0)
                                this.Controls.Find(“cbFilter“ + i true)[0].Visible = true;
                        }
                        else
                        {
                            if (this.Controls.Find(“fplFilter“ + i true).Length > 0)
                                this.Controls.Find(“fplFilter“ + i true)[0].Visible = false;
                            if (this.Controls.Find(“txtFilter“ + i true).Length > 0)
                                this.Controls.Find(“txtFilter“ + i true)[0].Visible = true;
                            if (this.Controls.Find(“cbFilter“ + i true).Length > 0)
                                this.Controls.Find(“cbFilter“ + i true)[0].Visible = false;

                        }



                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void AddFilter()
        {
            try
            {
                for (int i = 0; i < this.fpl.Controls.Count; i++)
           

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     241664  2008-03-22 10:40  DynamicQuery\DynamicQuery\bin\Debug\DynamicQuery.exe

     文件      40448  2008-03-22 10:40  DynamicQuery\DynamicQuery\bin\Debug\DynamicQuery.pdb

     文件       5632  2005-11-11 22:25  DynamicQuery\DynamicQuery\bin\Debug\DynamicQuery.vshost.exe

     目录          0  2008-03-22 10:40  DynamicQuery\DynamicQuery\bin\Debug

     目录          0  2008-03-22 10:25  DynamicQuery\DynamicQuery\bin

     文件      15251  2008-03-22 10:40  DynamicQuery\DynamicQuery\DynamicQuery.cs

     文件       3629  2008-03-22 10:40  DynamicQuery\DynamicQuery\DynamicQuery.csproj

     文件      43730  2008-03-22 10:40  DynamicQuery\DynamicQuery\DynamicQuery.Designer.cs

     文件       9773  2008-03-22 10:40  DynamicQuery\DynamicQuery\DynamicQuery.resx

     文件      99678  2008-03-21 08:15  DynamicQuery\DynamicQuery\edit_add.ico

     文件      99678  2008-03-21 08:15  DynamicQuery\DynamicQuery\edit_remove.ico

     文件        337  2008-03-22 10:29  DynamicQuery\DynamicQuery\Form1.cs

     文件       1158  2008-03-22 10:29  DynamicQuery\DynamicQuery\Form1.Designer.cs

     文件        916  2008-03-22 10:40  DynamicQuery\DynamicQuery\obj\Debug\DynamicQuery.csproj.GenerateResource.Cache

     文件       1761  2008-03-22 10:40  DynamicQuery\DynamicQuery\obj\Debug\DynamicQuery.DynamicQuery.resources

     文件     241664  2008-03-22 10:40  DynamicQuery\DynamicQuery\obj\Debug\DynamicQuery.exe

     文件      40448  2008-03-22 10:40  DynamicQuery\DynamicQuery\obj\Debug\DynamicQuery.pdb

     文件     200210  2008-03-22 10:40  DynamicQuery\DynamicQuery\obj\Debug\DynamicQuery.Properties.Resources.resources

     文件       5120  2008-03-22 10:40  DynamicQuery\DynamicQuery\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     目录          0  2008-03-22 10:40  DynamicQuery\DynamicQuery\obj\Debug\TempPE

     目录          0  2008-03-22 10:40  DynamicQuery\DynamicQuery\obj\Debug

     文件        310  2008-03-22 10:40  DynamicQuery\DynamicQuery\obj\DynamicQuery.csproj.FileList.txt

     目录          0  2008-03-22 10:40  DynamicQuery\DynamicQuery\obj

     文件        479  2008-03-22 10:28  DynamicQuery\DynamicQuery\Program.cs

     文件       1182  2008-03-22 10:23  DynamicQuery\DynamicQuery\Properties\AssemblyInfo.cs

     文件       3354  2008-03-22 10:40  DynamicQuery\DynamicQuery\Properties\Resources.Designer.cs

     文件       6431  2008-03-22 10:40  DynamicQuery\DynamicQuery\Properties\Resources.resx

     文件       1095  2008-03-22 10:23  DynamicQuery\DynamicQuery\Properties\Settings.Designer.cs

     文件        249  2008-03-22 10:23  DynamicQuery\DynamicQuery\Properties\Settings.settings

     目录          0  2008-03-22 10:40  DynamicQuery\DynamicQuery\Properties

............此处省略7个文件信息

评论

共有 条评论