private void btnStart_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(_mdbPath) || string.IsNullOrEmpty(_mdbPath))
            {
                MessageBox.Show("您还没有指定数据文件所在目录或目录中缺失数据库文件", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            lblOperator.Text = "正在进行质检...";
            //var ids = new List<int>() { 11, 1201, 2101, 2201, 3101, 3201, 3301, 3401, 4101, 4201, 4301, 5101, 6101, 6201 };
            var ids = new List <int>();

            RuleHelper.GetCheckedRuleIDs(treeView1.Nodes, ids);
            _workBench         = new WorkBench2();
            _workBench.RulsIds = ids;
            _workBench.Folder  = _dataPath;
            btnStart.Enabled   = false;
            btnResult.Enabled  = false;
            //btnExport.Enabled = false;
            //btnPDF.Enabled = false;
            btnExcel.Enabled = false;
            var form = new ProgressForm(_workBench);

            form.ShowDialog();
            if (form.StopRequested == false)
            {
                RuleHelper.UpdateCheckState(treeView1.Nodes, form.Results);
                LoadResults(_workBench.Results);
                btnResult.Enabled = true;
                //btnExport.Enabled = true;
                //btnPDF.Enabled = true;
                btnExcel.Enabled = true;
                MessageBox.Show("已经完成质检", "完成", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            //if (MessageBox.Show("质检完成,是否需要自动生成一份统计表格?", "质检提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            //{
            //    var dialog = new FolderBrowserDialog { Description = "请选择统计表格保存的文件夹" };
            //    if (dialog.ShowDialog() == DialogResult.OK)
            //    {
            //        var saveFolder = dialog.SelectedPath;
            //        _workBench.Write(saveFolder);
            //    }
            //}
            lblOperator.Text = "就绪";
            btnStart.Enabled = true;
        }
 private void MainForm_Load(object sender, EventArgs e)
 {
     RuleHelper.LoadRules(treeView1, ConfigDocument);
     LoadForm.Instance.Close();
 }