Ejemplo n.º 1
0
        private void btnDishInfoDele_Click(object sender, EventArgs e)
        {
            if (this.gridViewDishInfo.SelectedRowsCount <= 0)
            {
                XtraMessageBox.Show("请先选择要删除(&D)的项", "操作违规",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            string       tempID           = this.gridViewDishInfo.GetFocusedRowCellValue("编号").ToString();
            DialogResult tempDialogResult = XtraMessageBox.Show("编号为:" + tempID + "的菜品信息",
                                                                "确定删除(&D)", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (DialogResult.Yes == tempDialogResult)
            {
                VariedEnum.OperatorStatus EnOperatorStatus;
                try
                {
                    EnOperatorStatus = myBUCMS_DishServer.Delete(tempID);
                    if (ClassAssist.CommonOperator.HandleOperatorEnum("删除(&D)", EnOperatorStatus))
                    {
                        BUT_SysLog.InsertSysLog(VariedEnum.LogType.系统事件, frmAssist.frmLogin.SysUser.UserID,
                                                "成功删除(&D)了编号为:" + tempID + "的菜品信息");
                        paramField = string.Empty;
                        BindGridControl(paramField, paramDishType);
                    }
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show("请确定该条数据没用正在使用后重试", "删除(&D)失败",
                                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }