Пример #1
0
        /// <summary>
        /// 删除项目
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem14_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridView1.SelectedRowsCount == 0)
            {
                XtraMessageBox.Show("请先选择要删除的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string sa001;
            int    re;

            if (XtraMessageBox.Show("确认要删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }

            foreach (int i in gridView1.GetSelectedRows())
            {
                //权限检查
                //if (!AppAction.CheckRight("业务项目删除", gridView1.GetRowCellValue(i, "SA100").ToString())) continue;

                sa001 = gridView1.GetRowCellValue(i, "SA001").ToString();
                re    = FireAction.FireSalesItemRemove(sa001);
                if (re < 0)
                {
                    return;
                }
            }

            this.RefreshData();
        }