/// <summary>
        /// 查询公司就职表中的信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPerSearch_Click(object sender, EventArgs e)
        {
            //清空
            Performance.Items.Clear();
            //初始一个查询表达式
            Expression <Func <employeePerformance, bool> > expression = x => x.employeeId == x.employeeId;

            //如果某个查询项选中的话 加入查询表达式
            //职工Id
            if (cboxPerSearchId.Checked == true)
            {
                expression = LambdaHelper.And <employeePerformance>(expression, x => x.employeeId == nudPerSearchId.Value);
            }
            //职位Id
            if (cboxPerSearchPosId.Checked == true)
            {
                //name的值可能为空 所以要判断
                expression = LambdaHelper.And <employeePerformance>(expression, x => x.positionId == nudPosSearchId.Value);
            }
            //业绩
            if (cboxPerSearchPerformance.Checked == true)
            {
                double pNumber = Convert.ToDouble(nudPerSearchPerformance.Value);
                expression = LambdaHelper.And <employeePerformance>(expression, x => x.performance == pNumber);
            }

            employeePerformance[] info = dataTools.selectTools.selectEmployeePerformance(expression, x => x.employeeId);
            MessageBox.Show("成功查询到" + info.Length + "条数据");
            for (int count = 0; count < info.Length; count++)
            {
                ListViewItem item = new ListViewItem();
                item.Text = info[count].employeeId.ToString();
                int eId = info[count].employeeId;
                //根据职工Id找到职工的名字
                string epName = dataTools.selectTools.selectEmployeeInfo(u => u.employeeId == eId, u => u.employeeId)[0].employeeName;
                item.SubItems.Add(epName);
                item.SubItems.Add(info[count].positionId.ToString());
                int pId = info[count].positionId;
                //根据职位ID找到职位名字
                string pName = dataTools.selectTools.selectCompanyPosition(u => u.positionId == pId, u => u.positionId)[0].positionName;
                item.SubItems.Add(pName);
                item.SubItems.Add(info[count].performance.ToString());
                Performance.Items.Add(item);
            }
        }
        //查询
        private void btnPosSearch_Click(object sender, EventArgs e)
        {
            listPosition.Items.Clear();
            //初始一个查询表达式
            Expression <Func <companyPosition, bool> > expression = x => x.positionId == x.positionId;

            if (cboxPosSearchId.Checked == true)
            {
                expression = LambdaHelper.And(expression, x => x.positionId == nudPosSearchId.Value);
            }
            if (cboxPosSearchName.Checked == true)
            {
                if (txtPosSearchName.Text != "")
                {
                    expression = LambdaHelper.And(expression, x => x.positionName == txtPosSearchName.Text);
                }
            }
            if (cboxPosSearchDepId.Checked == true)
            {
                expression = LambdaHelper.And(expression, x => x.departmentId == nudPosSearchDepId.Value);
            }
            if (cboxPosSearchMoney.Checked == true)
            {
                double tmp = double.Parse(nudPosSearchMoney.Value.ToString());
                expression = LambdaHelper.And(expression, x => x.positionSalary == tmp);
            }
            companyPosition[] pos = dataTools.selectTools.selectCompanyPosition(expression, x => x.positionId);
            MessageBox.Show("成功查询到" + pos.Length + "条数据");
            for (int count = 0; count < pos.Length; count++)
            {
                ListViewItem item = new ListViewItem();
                item.Text = pos[count].positionId.ToString();
                item.SubItems.Add(pos[count].departmentId.ToString());
                item.SubItems.Add(pos[count].positionName);
                item.SubItems.Add(pos[count].positionSalary.ToString());
                listPosition.Items.Add(item);
            }
        }
        //查询员工信息
        private void btnInfoSearch_Click(object sender, EventArgs e)
        {
            //清空
            listInfo.Items.Clear();
            //初始一个查询表达式
            Expression <Func <employeeInfo, bool> > expression = x => x.employeeId == x.employeeId;

            //如果某个查询项选中的话 加入查询表达式
            if (cboxInfoId.Checked == true)
            {
                //nud的Value不可能为空 所以直接查询即可
                expression = LambdaHelper.And <employeeInfo>(expression, x => x.employeeId == nudInfoSearchId.Value);
            }
            //姓名
            if (cboxInfoName.Checked == true)
            {
                //name的值可能为空 所以要判断
                if (txtInfoSearchName.Text != "")
                {
                    expression = LambdaHelper.And <employeeInfo>(expression, x => x.employeeName == txtInfoSearchName.Text);
                }
            }
            //电话
            if (cboxInfoTel.Checked == true)
            {
                if (txtInfoSearchTel.Text != "")
                {
                    expression = LambdaHelper.And <employeeInfo>(expression, x => x.employeePhone == txtInfoSearchTel.Text);
                }
            }
            //身份证
            if (cboxInfoIdCard.Checked == true)
            {
                if (txtInfoSearchIdCard.Text != "")
                {
                    expression = LambdaHelper.And <employeeInfo>(expression, x => x.employeeIdentity == txtInfoSearchIdCard.Text);
                }
            }
            //性别
            if (cboxInfoSex.Checked == true)
            {
                if (rbtnInfoSearchMale.Checked == true)
                {
                    expression = LambdaHelper.And <employeeInfo>(expression, x => x.employeeSex == 1);
                }
                else
                {
                    expression = LambdaHelper.And <employeeInfo>(expression, x => x.employeeSex == 0);
                }
            }
            //生日
            if (cboxInfoBirth.Checked == true)
            {
                DateTime birth = new DateTime(int.Parse(nudInfoSearchYear.Value.ToString()),
                                              int.Parse(nudInfoSearchMonth.Value.ToString()), int.Parse(nudInfoSearchDay.Value.ToString()));
                expression = LambdaHelper.And <employeeInfo>(expression, x => x.employeeBir == birth);
            }
            employeeInfo[] info = dataTools.selectTools.selectEmployeeInfo(expression, x => x.employeeId);
            MessageBox.Show("成功查询到" + info.Length + "条数据");
            for (int count = 0; count < info.Length; count++)
            {
                ListViewItem item = new ListViewItem();
                item.Text = info[count].employeeId.ToString();
                item.SubItems.Add(info[count].employeeName);
                if (info[count].employeeSex == 0)
                {
                    item.SubItems.Add("女");
                }
                else
                {
                    item.SubItems.Add("男");
                }
                item.SubItems.Add(info[count].employeePhone);
                DateTime birth = (DateTime)info[count].employeeBir;
                item.SubItems.Add(birth.ToString("D"));
                item.SubItems.Add(info[count].employeeIdentity);
                listInfo.Items.Add(item);
            }
        }