Ejemplo n.º 1
0
        /// <summary>
        /// 删除特殊技术要求菜单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsmiDeleteSpecialRequirement_Click(object sender, EventArgs e)
        {
            if (dgvSpecialRequirements.RowCount == 0)
            {
                return;
            }
            if (dgvSpecialRequirements.CurrentRow == null)
            {
                MessageBox.Show("请选中需要修改的特殊技术要求", "提示信息");
                return;
            }
            string specialRequirementId = dgvSpecialRequirements.CurrentRow.Cells["SpecialRequirementId"].Value.ToString();
            //删除询问
            DialogResult result = MessageBox.Show("确定要删除(序号Id为: " + specialRequirementId + " )这个条特殊要求吗?", "删除询问", MessageBoxButtons.YesNo,
                                                  MessageBoxIcon.Question);

            if (result == DialogResult.No)
            {
                return;
            }
            try
            {
                if (objRequirementService.DeleteSpecialRequirement(specialRequirementId) == 1)
                {
                    dgvSpecialRequirements.DataSource = objRequirementService.GetSpecialRequirementsByODPNo(txtODPNo.Text.Trim());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }