Пример #1
0
 //删除商品
 private void benDeleteCategory_Click(object sender, EventArgs e)
 {
     if (dgvCategoryInfo.SelectedRows.Count > 0)
     {
         int id = Convert.ToInt32(dgvCategoryInfo.SelectedRows[0].Cells[0].Value);
         //根据id删除选中的行
         CategoryInfoBLL bll = new CategoryInfoBLL();
         string          msg = bll.DeleteCategoryById(id) ? "操作成功" : "操作失败";
         MessageBox.Show(msg);
         LoadCategoryInfoByDelFlag(0);
     }
     else
     {
         MessageBox.Show("请选中要删除的行!");
     }
 }