/// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsBtnDel_Click(object sender, EventArgs e)
        {
            if (Alert.confirm(Const.DEL_CONFIRM_MSG, Const.NOTES, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
            {
                //获取记录条数
                int n = GetTableRecordCount();
                for (int i = n - 1; i >= 0; i--)
                {
                    if (this._fpUserGroupInfo.ActiveSheet.Cells[2 + i, 0].CellType is CheckBoxCellType)
                    {
                        if (this._fpUserGroupInfo.ActiveSheet.Cells[2 + i, 0].Value != null)
                        {
                            if ((bool)this._fpUserGroupInfo.ActiveSheet.Cells[2 + i, 0].Value)
                            {
                                this._fpUserGroupInfo.ActiveSheet.Rows.Remove(2 + i, 1);
                            }
                        }
                    }
                }

                //更新数据库中用户组、用户信息
                foreach (string str in _strUserGroupSel)
                {
                    //删除用户组
                    UserGroupInformationManagementBLL.DeleteUserGroupInformationByGroupName(str);
                    //删除登录用户的用户组信息
                    UserGroupInformationManagementBLL.UpdateUserInformationWhenDeleteGroup(str);
                }

                //farPoint刷新
                _fpUserGroupInfo.Refresh();

                //设置焦点
                this._fpUserGroupInfo.ActiveSheet.SetActiveCell(UserGroupInformationManagementBLL.GetRecordCountFromTable() + 1, 0);

                //设置删除按钮不可用
                tsBtnDel.Enabled = false;
            }
        }
 /// <summary>
 /// 从表中获取数据
 /// </summary>
 /// <param name="tableName"></param>
 /// <returns></returns>
 private int GetTableRecordCount()
 {
     return(UserGroupInformationManagementBLL.GetRecordCountFromTable());
 }
 /// <summary>
 /// farpoint单击事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void fpUserInfo_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
 {
     if (this._fpUserGroupInfo.ActiveSheet.Cells[e.Row, 1] != null)
     {
         // 判断点击的空间类型是否是.FpCheckBox)
         if (e.EditingControl is FarPoint.Win.FpCheckBox)
         {
             FarPoint.Win.FpCheckBox fpChk = (FarPoint.Win.FpCheckBox)e.EditingControl;
             // 判断是否被选中
             if (fpChk.Checked)
             {
                 if (!_strUserGroupSel.Contains(this._fpUserGroupInfo.ActiveSheet.Cells[e.Row, 1].Value.ToString()))
                 {
                     //记录选中的用户组名称
                     _strUserGroupSel.Add(this._fpUserGroupInfo.ActiveSheet.Cells[e.Row, 1].Value.ToString());
                     //判断是否已全选
                     this._chkSelAll.CheckedChanged -= this.chkSelAll_CheckedChanged;
                     this._chkSelAll.Checked         = _strUserGroupSel.Count == UserGroupInformationManagementBLL.GetRecordCountFromTable() ? true : false;
                     this._chkSelAll.CheckedChanged += this.chkSelAll_CheckedChanged;
                 }
             }
             else
             {
                 // 移除索引号
                 _strUserGroupSel.Remove(this._fpUserGroupInfo.ActiveSheet.Cells[e.Row, 1].Value.ToString());
                 // 全选/全不选checkbox设为未选中
                 this._chkSelAll.CheckedChanged -= this.chkSelAll_CheckedChanged;
                 this._chkSelAll.Checked         = false;
                 this._chkSelAll.CheckedChanged += this.chkSelAll_CheckedChanged;
             }
             // 删除按钮
             this.tsBtnDel.Enabled = (_strUserGroupSel.Count >= 1) ? true : false;
         }
     }
 }