今日总结
删除商品:
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("删除失败");
}
}
}