/// <summary>
        /// 双击修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CheckDatas_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                string       err = string.Empty;
                frmAddSample fas = new frmAddSample();
                //string sql = "FtypeNmae='" + CheckDatas.SelectedRows[0].Cells[0].Value.ToString() + "' and Name='" + CheckDatas.SelectedRows[0].Cells[1].Value.ToString() + "'"+
                //    " and ItemDes='" + CheckDatas.SelectedRows[0].Cells[2].Value.ToString() + "'";
                string sql = "sampleName='" + CheckDatas.SelectedRows[0].Cells[0].Value.ToString() + "' and itemName='" + CheckDatas.SelectedRows[0].Cells[1].Value.ToString() + "'" +
                             " and standardName='" + CheckDatas.SelectedRows[0].Cells[2].Value.ToString() + "'";
                DataTable dt = csql.GetDownItemID(sql, "", out err);
                if (dt != null && dt.Rows.Count > 0)
                {
                    fas.id = dt.Rows[0][0].ToString();
                }

                string[,] a = new string[CheckDatas.SelectedRows.Count, 6];
                for (int i = 0; i < CheckDatas.SelectedRows.Count; i++)
                {
                    a[i, 0] = CheckDatas.SelectedRows[i].Cells[0].Value.ToString();
                    a[i, 1] = CheckDatas.SelectedRows[i].Cells[1].Value.ToString();
                    a[i, 2] = CheckDatas.SelectedRows[i].Cells[2].Value.ToString();
                    a[i, 3] = CheckDatas.SelectedRows[i].Cells[3].Value.ToString();
                    a[i, 4] = CheckDatas.SelectedRows[i].Cells[4].Value.ToString();
                    a[i, 5] = CheckDatas.SelectedRows[i].Cells[5].Value.ToString();
                }
                Global.repairSample = a;
                fas.SaveRepair      = "修改";
                DialogResult dr = fas.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    StringBuilder sb = new StringBuilder();
                    dt = csql.GetDownChkItem("", "", out err);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        DataDisTable.Clear();
                        //for (int i = 0; i < dt.Rows.Count; i++)
                        //{
                        //    addtable(dt.Rows[i][0].ToString(), dt.Rows[i][1].ToString(), dt.Rows[i][2].ToString(), dt.Rows[i][3].ToString(), dt.Rows[i][4].ToString(), dt.Rows[i][5].ToString());
                        //}
                        CheckDatas.DataSource = dt;
                        CheckDatas.Columns[0].HeaderCell.Value = "样品名称";
                        CheckDatas.Columns[1].HeaderCell.Value = "检测项目";
                        CheckDatas.Columns[2].HeaderCell.Value = "检测依据";
                        CheckDatas.Columns[3].HeaderCell.Value = "标准值";
                        CheckDatas.Columns[4].HeaderCell.Value = "判定符号";
                        CheckDatas.Columns[5].HeaderCell.Value = "单位";
                    }
                }
            }
            catch (Exception ex)
            {
                dy.savediary(DateTime.Now.ToString(), "样品修改错误:" + ex.Message, "错误");
                MessageBox.Show(ex.Message, "样品修改");
            }
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmAddSample fas = new frmAddSample();

            fas.SaveRepair = "新增";
            DialogResult dr = fas.ShowDialog();

            if (dr == DialogResult.OK)
            {
                try
                {
                    StringBuilder sb  = new StringBuilder();
                    string        err = string.Empty;
                    DataTable     dt  = csql.GetDownChkItem("", "", out err);
                    if (dt != null)
                    {
                        if (dt.Rows.Count > 0)
                        {
                            DataDisTable.Clear();
                            //for (int i = 0; i < dt.Rows.Count; i++)
                            //{
                            //    addtable(dt.Rows[i][0].ToString(), dt.Rows[i][1].ToString(), dt.Rows[i][2].ToString(), dt.Rows[i][3].ToString(), dt.Rows[i][4].ToString(), dt.Rows[i][5].ToString());
                            //}
                            CheckDatas.DataSource = dt;//DataDisTable;
                            CheckDatas.Columns[0].HeaderCell.Value = "样品名称";
                            CheckDatas.Columns[1].HeaderCell.Value = "检测项目";
                            CheckDatas.Columns[2].HeaderCell.Value = "检测依据";
                            CheckDatas.Columns[3].HeaderCell.Value = "标准值";
                            CheckDatas.Columns[4].HeaderCell.Value = "判定符号";
                            CheckDatas.Columns[5].HeaderCell.Value = "单位";
                        }
                    }
                }
                catch (Exception ex)
                {
                    dy.savediary(DateTime.Now.ToString(), "进入样品信息查询错误:" + ex.Message, "错误");
                    MessageBox.Show(ex.Message, "样品信息查询");
                }
            }
        }