/// <summary>
        /// 查重方法
        /// </summary>
        /// <returns></returns>
        private bool btnCheckupdate()
        {
            bool rbool = true;

            try
            {
                string PositionName = this.cbxPositionName.Text.ToString();
                int    lenth        = cbxDrivewayName.Text.Trim().Length;
                string DrivewayName = cbxDrivewayName.Text.Trim().Substring(0, 4);
                string DrivewayType = cbxDrivewayName.Text.Trim().Substring(lenth - 1, 1);
                string name         = this.txtFVN_Name.Text.Trim();
                int    value        = int.Parse(this.txtFVN_Value.Text.Trim());
                //判断名称是否已存在
                Expression <Func <View_FVN_Driveway_Position, bool> > funviewFVNInfo = n => n.Position_Name == PositionName && n.Driveway_Name == DrivewayName && n.FVN_Name == name && n.FVN_Name != this.dgvFVN.SelectedRows[0].Cells["FVN_Name"].Value.ToString();
                if (FVNDAL.QueryView(funviewFVNInfo).Count() > 0)
                {
                    PublicClass.ShowToolTip(ToolTipIcon.Info, "提示", "该地感名称已存在", txtFVN_Name, this);
                    this.txtFVN_Name.Focus();
                    rbool = false;;
                }
                Expression <Func <View_FVN_Driveway_Position, bool> > funviewFVNInfo1 = n => n.Position_Name == PositionName && n.Driveway_Name == DrivewayName && n.FVN_Value == value && n.FVN_Value != int.Parse(this.dgvFVN.SelectedRows[0].Cells["FVN_Value"].Value.ToString());
                if (FVNDAL.QueryView(funviewFVNInfo1).Count() > 0)
                {
                    PublicClass.ShowToolTip(ToolTipIcon.Info, "提示", "该地感值已存在", txtFVN_Value, this);
                    this.txtFVN_Value.Focus();
                    rbool = false;;
                }
                return(rbool);
            }
            catch
            {
                CommonalityEntity.WriteTextLog("地感管理 btnCheck()");
                rbool = false;
            }
            return(rbool);
        }
        /// <summary>
        /// 双击组件时发生
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvFVN_DoubleClick(object sender, EventArgs e)
        {
            this.btnUpdate.Enabled = true;
            this.btnSave.Enabled   = false;
            if (this.dgvFVN.SelectedRows.Count > 0)//选中行
            {
                if (dgvFVN.SelectedRows.Count > 1)
                {
                    MessageBox.Show("修改只能选中一行!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    //修改的值
                    int ID = int.Parse(this.dgvFVN.SelectedRows[0].Cells["FVN_ID"].Value.ToString());
                    Expression <Func <View_FVN_Driveway_Position, bool> > funviewinto = n => n.FVN_ID == ID;
                    foreach (var n in FVNDAL.QueryView(funviewinto))
                    {
                        if (n.FVN_Name != null)
                        {
                            // 地感名称
                            this.txtFVN_Name.Text = n.FVN_Name;
                        }
                        if (n.FVN_Type != null)
                        {
                            // 地感类型
                            this.cbxFVN_Type.Text = n.FVN_Type;
                        }
                        if (n.FVN_State != null)
                        {
                            // 地感状态
                            this.cbxFVN_State.Text = n.FVN_State;
                        }
                        if (n.FVN_Value != null)
                        {
                            // 地感PLC值
                            this.txtFVN_Value.Text = n.FVN_Value.ToString();
                        }
                        if (n.Position_Name != null)
                        {
                            // 门岗名称
                            this.cbxPositionName.Text = n.Position_Name;
                        }
                        if (n.FVN_Driveway_ID != null)
                        {
                            // 通道名称
                            this.cbxDrivewayName.Text = n.Driveway_Name + n.Driveway_Type;
                        }

                        if (n.FVN_Remark != null || n.FVN_Remark != "")
                        {
                            // 地感备注
                            this.txtFVN_Remark.Text = n.FVN_Remark;
                        }
                        break;
                    }
                }
            }
            else
            {
                MessageBox.Show("请选择要修改的行!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }