Beispiel #1
0
 private void cmbExType_TextChanged(object sender, EventArgs e)
 {
     TypeID = ExceptionsTypeManage.getIDbyName(cmbExType.Text.Trim());
     if (TypeID != "")
     {
         if (TypeID == _tempTypeID)
         {
             txtExID.Text = _tempExInfoID;
         }
         else
         {
             string strTemp = "TLW-" + TypeID + "-";
             txtExID.Text = ExceptionsInfoManage.getMaxExInfoID(strTemp);
         }
     }
 }
        /// <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);
                }
            }
        }