Example #1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            long         eId;
            DialogResult strDelete = MessageBox.Show("确定要删除选定记录吗?", "提示", MessageBoxButtons.YesNo);

            if (strDelete.ToString().Equals("No"))
            {
                return;
            }

            if (dgvEquipment.CurrentRow != null)
            {
                eId = Convert.ToInt32(dgvEquipment.CurrentRow.Cells["id"].Value.ToString());
                if (eLogic.FrmEquipmentDelete(eId))
                {
                    //MessageBox.Show("删除记录成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ClearAction();
                    SetDataGridView("");
                }
                else
                {
                    MessageBox.Show("删除记录失败,请从新选择记录操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }