复制代码 代码如下:
try
{
using (transactionscope tr = new transactionscope())
{
int i = this.customermanager.addcustomer(customer);
int j = this.homestatusmanager.updatehomestatus(homestatus);
if ((i * j) > 0)
{
messagebox.show("记录插入成功!", "消息", messageboxbuttons.ok, messageboxicon.information);
empty();
tr.complete();
}
else
{
messagebox.show("记录插入失败!联系管理员!", "消息", messageboxbuttons.ok, messageboxicon.information);
empty();
}
tr.dispose();
}
}
catch(exception err)
{
messagebox.show("记录插入失败" +err.tostring(), "消息", messageboxbuttons.ok, messageboxicon.information);
}
您可能感兴趣的文章:
如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!
网友评论