Example #1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnDel_Click(object sender, EventArgs e)
        {
            if (this.gridViewMain.SelectedRowsCount <= 0)
            {
                XtraMessageBox.Show("请先选择要删除的项", "操作违规", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            string       tempID           = this.gridViewMain.GetFocusedRowCellDisplayText(LogID);
            DialogResult tempDialogResult = XtraMessageBox.Show("编号为:" + tempID + "的信息", "确定删除?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (DialogResult.Yes == tempDialogResult)
            {
                VariedEnum.OperatorStatus EnOperatorStatus;
                try
                {
                    EnOperatorStatus = myBUSysLog.Delete(tempID);
                    if (ClassAssist.CommonOperator.HandleOperatorEnum("删除日志信息", EnOperatorStatus))
                    {
                        BUT_SysLog.InsertSysLog(VariedEnum.LogType.系统事件, frmAssist.frmLogin.SysUser.UserID, "成功删除了编号为" + tempID + "的日志信息");
                        GetAllSysLogInfo();
                    }
                }
                catch
                {
                    XtraMessageBox.Show("请确定此条数据不正在被使用后重试", "删除失败", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }