private void DoQuery()
        {
            string property = this.cbProperty.SelectedItem.ToString();
            string propName = null;

            foreach (KeyValuePair <string, string> v in aliaNameAndName)
            {
                if (v.Key == property)
                {
                    propName = v.Value;
                }
            }
            string value = this.CbValue.Text;
            string opera = this.CbOperator.SelectedItem.ToString();

            if (this.selectFeatureClass != null && propName != null && value != null && opera != null)
            {
                foreach (DF2DFeatureClass dffc in selectFeatureClass)
                {
                    DF2DPipe.Class.Query query = new DF2DPipe.Class.Query();

                    DataTable dt = query.DoQuery(propName, opera, value, dffc);
                    queryDTByLayer.Add(dffc, dt);
                }
            }
        }
        private void DoQuery()
        {
            string property = this.teValue.Text.Substring(0, this.teValue.Text.Length - 1);

            if (fieldName == null)
            {
                return;
            }
            string propName = fieldName;

            //foreach (KeyValuePair<string, string> v in aliaNameAndName)
            //{
            //    if (v.Key == property)
            //        propName = v.Value;
            //}
            if (this.selectFeatureClass != null && propName != null && property != null)
            {
                foreach (DF2DFeatureClass dffc in selectFeatureClass)
                {
                    DF2DPipe.Class.Query query = new DF2DPipe.Class.Query();

                    DataTable dt = query.DoQuery(property, propName, dffc);
                    queryDTByLayer.Add(dffc, dt);
                }
            }
        }
        private void DoQuery()
        {
            if (string.IsNullOrEmpty(this._sysFieldName))
            {
                return;
            }
            string value = this.teValue.Text.Trim();

            if (value.Length > 1)
            {
                int lastindex = value.LastIndexOf(';');
                if (lastindex == (value.Length - 1))
                {
                    value = value.Substring(0, value.Length - 1);
                }
            }
            string[] arr1 = value.Split(';');
            if (arr1 == null || arr1.Length == 0)
            {
                return;
            }
            string temp1 = "";

            foreach (string str1 in arr1)
            {
                temp1 += str1;
            }
            if (this.treeLayer.GetAllCheckedNodes() != null)
            {
                DF2DPipe.Class.Query query = new DF2DPipe.Class.Query();

                foreach (TreeListNode node in this.treeLayer.GetAllCheckedNodes())
                {
                    object obj = node.GetValue("NodeObject");
                    if (obj != null && obj is SubClass)
                    {
                        SubClass sc = obj as SubClass;
                        if (sc.Parent == null)
                        {
                            continue;
                        }
                        string   classifyField = sc.Parent.ClassifyField;
                        string[] arrFc2DId     = sc.Parent.Fc2D.Split(';');
                        if (arrFc2DId == null)
                        {
                            continue;
                        }
                        foreach (string fc2DId in arrFc2DId)
                        {
                            DF2DFeatureClass dffc = DF2DFeatureClassManager.Instance.GetFeatureClassByID(fc2DId);
                            if (dffc == null)
                            {
                                continue;
                            }
                            IFeatureClass fc   = dffc.GetFeatureClass();
                            FacilityClass facc = dffc.GetFacilityClass();
                            if (this._sysFieldName == "Additional")
                            {
                                if (fc == null || facc == null || facc.Name != "PipeNode")
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                if (fc == null || facc == null || facc.Name != "PipeLine")
                                {
                                    continue;
                                }
                            }

                            DFDataConfig.Class.FieldInfo fi = facc.GetFieldInfoBySystemName(this._sysFieldName);
                            if (fc == null || facc == null || fi == null)
                            {
                                continue;
                            }
                            int index = fc.FindField(fi.Name);
                            if (index == -1)
                            {
                                continue;
                            }
                            IFields pFields = fc.Fields;
                            IField  pField  = pFields.get_Field(index);


                            string whereClause = UpOrDown.DecorateWhereClasuse(fc) + classifyField + "='" + sc.Name + "'" + " AND ";

                            foreach (string str1 in arr1)
                            {
                                whereClause += pField.Name + "=" + str1 + " OR ";
                            }
                            whereClause = whereClause.Substring(0, whereClause.Length - 3);
                            IFeature       pFeature      = null;
                            IFeatureCursor pFeatureCusor = null;
                            try
                            {
                                IQueryFilter pQueryFilter = new QueryFilterClass();
                                pQueryFilter.WhereClause = whereClause;
                                pFeatureCusor            = fc.Search(pQueryFilter, true);
                                DataTable dt = new DataTable();
                                dt.TableName = facc.Name;
                                DataColumn oidcol = new DataColumn();
                                oidcol.ColumnName = "oid";
                                oidcol.Caption    = "ID";
                                dt.Columns.Add(oidcol);
                                foreach (DFDataConfig.Class.FieldInfo fitemp in facc.FieldInfoCollection)
                                {
                                    if (!fitemp.CanQuery)
                                    {
                                        continue;
                                    }
                                    DataColumn col = new DataColumn();
                                    col.ColumnName = fitemp.Name;
                                    col.Caption    = fitemp.Alias;
                                    dt.Columns.Add(col);
                                }

                                while ((pFeature = pFeatureCusor.NextFeature()) != null)
                                {
                                    DataRow dtRow = dt.NewRow();
                                    dtRow["oid"] = pFeature.get_Value(pFeature.Fields.FindField("OBJECTID"));
                                    foreach (DataColumn col in dt.Columns)
                                    {
                                        int index1 = pFeature.Fields.FindField(col.ColumnName);
                                        if (index1 < 0)
                                        {
                                            continue;
                                        }
                                        object obj1 = pFeature.get_Value(index1);
                                        string str  = "";
                                        if (obj1 != null)
                                        {
                                            IField field = pFeature.Fields.get_Field(index1);
                                            switch (field.Type)
                                            {
                                            case esriFieldType.esriFieldTypeBlob:
                                            case esriFieldType.esriFieldTypeGeometry:
                                            case esriFieldType.esriFieldTypeRaster:
                                                continue;

                                            case esriFieldType.esriFieldTypeDouble:

                                                double d;
                                                if (double.TryParse(obj1.ToString(), out d))
                                                {
                                                    str = d.ToString("0.00");
                                                }
                                                break;

                                            default:
                                                str = obj1.ToString();
                                                break;
                                            }
                                        }
                                        dtRow[col.ColumnName] = str;
                                    }
                                    dt.Rows.Add(dtRow);
                                }
                                if (dt.Rows.Count > 0)
                                {
                                    this._dict[sc.Name] = dt;
                                }
                            }
                            catch
                            {
                            }
                            finally
                            {
                                if (pFeatureCusor != null)
                                {
                                    System.Runtime.InteropServices.Marshal.ReleaseComObject(pFeatureCusor);
                                    pFeatureCusor = null;
                                }
                                if (pFeature != null)
                                {
                                    pFeature = null;
                                }
                            }
                        }
                    }
                }
            }
        }