今日总结

删除商品:

 

 

private void delete_Click(object sender, EventArgs e)
{
if (goods.CurrentRow == null) return;
if (MessageBox.Show("确定删除?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
{
try
{
string message = "删除失败";
bool b = S.Delete(Getindex(goods.CurrentRow.Index).ID,ref message);
if(b)
{
MessageBox.Show("删除成功");
seacher_Click(null, null);
}
else
{
MessageBox.Show(message);
}
}
catch(Exception)
{
MessageBox.Show("删除失败");
}
}
}

posted @ 2021-11-22 20:46  一条快乐的小鲸鱼  阅读(65)  评论(0编辑  收藏  举报