Example #1
0
 private void btnDeletePro_Click(object sender, EventArgs e)
 {
     if (dgvProductInfo.SelectedRows.Count > 0)
     {
         if (DialogResult.OK == MessageBox.Show("确定删除", "删除", MessageBoxButtons.OKCancel))
         {
             var proId = Convert.ToInt32(dgvProductInfo.SelectedRows[0].Cells[0].Value);
             var msg   = proiBll.DeleteProductInfoById(proId) ? "删除成功" : "删除失败";
             MessageBox.Show(msg);
             LoadProductInfoByDelFlag(0);
         }
     }
     else
     {
         MessageBox.Show("未选中要删除的行");
     }
 }