コード例 #1
0
        /// <summary>
        /// 通过ID查询异常信息
        /// </summary>
        /// <param name="listID"></param>
        private void queryByName(List <int> listID)
        {
            int count = 0;

            flowLayoutPanel1.Controls.Clear();
            foreach (int ex in listID)
            {
                string whereStr = _columnID + "=" + ex;
                List <ExceptionsInfo> list;
                if (_pageIndex > 1)
                {
                    list = ExceptionsInfoManage.findTop(_pageIndex, _pageSize, whereStr);
                }
                else
                {
                    list = ExceptionsInfoManage.findFirstPage(_pageSize, whereStr);
                }
                AddResult(list);
                count   = ExceptionsInfoManage.returnCount(whereStr);
                _count += count;
            }

            pnlResultDorkSetting();
        }
コード例 #2
0
        /// <summary>
        /// 根据用户选择的查询方式查询
        /// </summary>
        private void DoQuery()
        {
            if (cmbo.Text != "" && _whereTemp != "")
            {
                _count = 0;
                _listbtn.Clear();
                string whereStr            = null;
                List <ExceptionsInfo> list = null;

                IGraphicsContainer pGContainer = axMapControl1.Map as IGraphicsContainer;
                pGContainer.DeleteAllElements();

                switch (cmbo.Text)
                {
                case "ID":
                    whereStr = "ID like '%" + _whereTemp + "%'";
                    break;

                case "用户名":
                    List <int> listUserID = UserInfoManage.FindByNameArr(_whereTemp);
                    queryByName(listUserID);
                    return;     //完全跳出

                case "项目名称":
                    List <int> listProID = ProjectInfoManage.FindByNameArr(_whereTemp);
                    queryByName(listProID);
                    return;    //完全跳出

                case "异常类型":
                    List <int> listTypeID = ExceptionsTypeManage.FindByNameArr(_whereTemp);
                    queryByName(listTypeID);
                    return;    //完全跳出

                case "异常ID":
                    whereStr = "exceptionID like '%" + _whereTemp + "%'";
                    break;

                case "异常名称":
                    whereStr = "exceptionName like '%" + _whereTemp + "%'";
                    break;

                default:
                    break;
                }

                if (whereStr != null)
                {
                    if (_pageIndex > 1)
                    {
                        list = ExceptionsInfoManage.findTop(_pageIndex, _pageSize, whereStr);
                    }
                    else
                    {
                        list = ExceptionsInfoManage.findFirstPage(_pageSize, whereStr);
                    }
                    flowLayoutPanel1.Controls.Clear();
                    AddResult(list);
                    _count = ExceptionsInfoManage.returnCount(whereStr);
                }
            }
        }